All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cardpay.sdk.api.PaymentsApi Maven / Gradle / Ivy

The newest version!
package com.cardpay.sdk.api;

import com.cardpay.sdk.client.CollectionFormats.*;
import com.cardpay.sdk.model.AuthenticationDataResponse;
import com.cardpay.sdk.model.DisputeList;
import com.cardpay.sdk.model.PaymentGatewayCreationResponse;
import com.cardpay.sdk.model.PaymentPatchRequest;
import com.cardpay.sdk.model.PaymentRequest;
import com.cardpay.sdk.model.PaymentResponse;
import com.cardpay.sdk.model.PaymentUpdateResponse;
import com.cardpay.sdk.model.PaymentsList;
import com.cardpay.sdk.model.TransactionMethodsList;
import java.time.OffsetDateTime;
import retrofit2.Call;
import retrofit2.http.*;

public interface PaymentsApi {
  /**
   * Create payment
   * Endpoint for creation payments. Request example presented for Gateway mode.
   * @param paymentRequest paymentRequest (required)
   * @return Call<PaymentGatewayCreationResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @POST("api/payments")
  Call createPayment(
    @retrofit2.http.Body PaymentRequest paymentRequest
  );

  /**
   * Get payment 3DS result information
   * 
   * @param paymentId Payment ID (required)
   * @return Call<AuthenticationDataResponse>
   */
  @GET("api/payments/{paymentId}/threedsecure")
  Call getAuthenticationData(
    @retrofit2.http.Path("paymentId") String paymentId
  );

  /**
   * Get a list of disputes by payment id
   * 
   * @param paymentId Payment ID (or refund ID, or recurring ID) (required)
   * @return Call<DisputeList>
   */
  @GET("api/disputes/{paymentId}")
  Call getDispute(
    @retrofit2.http.Path("paymentId") String paymentId
  );

  /**
   * Get a list of disputes
   * 
   * @param requestId Request ID (required)
   * @param type Defines dispute entity type: `CB` - for chargebacks `RR` - for retrieval requests `FR` - for fraud reports (required)
   * @param maxCount Limit number of returned dispute entities Must be less or equal to 1000, default is 100, minimal value is 1 (optional)
   * @param offset Starting position (offset) in the list of dispute entities. Must be less or equal to 10000, default is 0, minimal value is 0 (optional)
   * @param regEndTime Dispute registration date & time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period ends (inclusive); the default is current time UTC (format - yyyy-MM-dd'T'HH:mm:ss.SSS'Z') Must be less than 10 days after reg_start_time (optional)
   * @param regStartTime Dispute registration date & time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period starts (inclusive); the default is 24 hours before reg_end_time UTC (format - yyyy-MM-dd'T'HH:mm:ss.SSS'Z') (in UTC format) (optional)
   * @param sortOrder Sort based on order of results. `asc` for ascending order or `desc` for descending order (default value) by dispute registration date (optional)
   * @return Call<DisputeList>
   */
  @GET("api/disputes")
  Call getDisputes(
    @retrofit2.http.Query("request_id") String requestId, @retrofit2.http.Query("type") String type, @retrofit2.http.Query("max_count") Integer maxCount, @retrofit2.http.Query("offset") Integer offset, @retrofit2.http.Query("reg_end_time") OffsetDateTime regEndTime, @retrofit2.http.Query("reg_start_time") OffsetDateTime regStartTime, @retrofit2.http.Query("sort_order") String sortOrder
  );

  /**
   * Get payment information
   * 
   * @param paymentId Payment ID (required)
   * @return Call<PaymentResponse>
   */
  @GET("api/payments/{paymentId}")
  Call getPayment(
    @retrofit2.http.Path("paymentId") String paymentId
  );

  /**
   * Get payment and payout methods
   * Endpoint to get payment and payout methods by current terminal code
   * @param requestId Request ID, not unique ID of request (required)
   * @param payoutMethodsOnly If `true` was received - **only** available payout methods section will be returned in response (without 'payment_methods' section).  If `false` or absent - available payment and payout methods (both the sections) will be returned in response. (optional)
   * @return Call<TransactionMethodsList>
   */
  @GET("api/payment_methods")
  Call getPaymentMethods(
    @retrofit2.http.Query("request_id") String requestId, @retrofit2.http.Query("payout_methods_only") Boolean payoutMethodsOnly
  );

  /**
   * Get payments information
   * 
   * @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<PaymentsList>
   */
  @GET("api/payments")
  Call getPayments(
    @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 payment
   * 
   * @param paymentId Payment ID (required)
   * @param paymentPatchRequest paymentPatchRequest (required)
   * @return Call<PaymentUpdateResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @PATCH("api/payments/{paymentId}")
  Call updatePayment(
    @retrofit2.http.Path("paymentId") String paymentId, @retrofit2.http.Body PaymentPatchRequest paymentPatchRequest
  );

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy