com.cardpay.sdk.api.RefundsApi Maven / Gradle / Ivy
package com.cardpay.sdk.api;
import com.cardpay.sdk.client.CollectionFormats.*;
import com.cardpay.sdk.model.RefundRequest;
import com.cardpay.sdk.model.RefundResponse;
import com.cardpay.sdk.model.RefundUpdateRequest;
import com.cardpay.sdk.model.RefundUpdateResponse;
import com.cardpay.sdk.model.RefundsList;
import java.time.OffsetDateTime;
import retrofit2.Call;
import retrofit2.http.*;
public interface RefundsApi {
/**
* Create refund
*
* @param refundRequest refundRequest (required)
* @return Call<RefundResponse>
*/
@Headers({
"Content-Type:application/json"
})
@POST("api/refunds")
Call createRefund(
@retrofit2.http.Body RefundRequest refundRequest
);
/**
* Get refund information
*
* @param refundId Refund ID (required)
* @return Call<RefundResponse>
*/
@GET("api/refunds/{refundId}")
Call getRefund(
@retrofit2.http.Path("refundId") String refundId
);
/**
* Get list of refunds
*
* @param requestId Request ID (required)
* @param currency [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of transactions currency (optional)
* @param endTime Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period ends (not inclusive), UTC time, must be less than 7 days after 'start_time', default is current time (format: yyyy-MM-dd'T'HH:mm:ss'Z') (optional)
* @param maxCount Limit number of returned transactions (must be less than 10000, default is 1000, minimal value is 1) (optional)
* @param merchantOrderId Merchant order number from the merchant system (optional)
* @param paymentMethod Used payment method type name from payment methods list (optional)
* @param sortOrder Sort based on order of results. `asc` for ascending order or `desc` for descending order (default value) (optional)
* @param startTime Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period starts (inclusive), UTC time, default is 24 hours before 'end_time' (format: yyyy-MM-dd'T'HH:mm:ss'Z') (optional)
* @return Call<RefundsList>
*/
@GET("api/refunds")
Call getRefunds(
@retrofit2.http.Query("request_id") String requestId, @retrofit2.http.Query("currency") String currency, @retrofit2.http.Query("end_time") OffsetDateTime endTime, @retrofit2.http.Query("max_count") Integer maxCount, @retrofit2.http.Query("merchant_order_id") String merchantOrderId, @retrofit2.http.Query("payment_method") String paymentMethod, @retrofit2.http.Query("sort_order") String sortOrder, @retrofit2.http.Query("start_time") OffsetDateTime startTime
);
/**
* Update refund
*
* @param refundId Refund ID (required)
* @param refundUpdateRequest refundUpdateRequest (required)
* @return Call<RefundUpdateResponse>
*/
@Headers({
"Content-Type:application/json"
})
@PATCH("api/refunds/{refundId}")
Call updateRefund(
@retrofit2.http.Path("refundId") String refundId, @retrofit2.http.Body RefundUpdateRequest refundUpdateRequest
);
}