Interface MyFatoorahProvider

All Known Implementing Classes:
ExternalMyFatoorahProvider

public interface MyFatoorahProvider
The MyFatoorah provider that is used to execute the requests to the MyFatoorah API.
Author:
Dima Myroniuk (dmyroniuk)
  • Method Details

    • initiateSession

      InitSessionResponse initiateSession(@Nullable String customerId, @Nullable String currencyCode, @Nullable String applicationId, @Nullable String tenantId)
      This method is responsible for making call to init-session end-point of MyFatoorah.
      Parameters:
      customerId - the customer ID
      currencyCode - The currency code for this request
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from MyFatoorah API.
      Throws:
      ProviderApiException - if the request failed
    • executePayment

      MyFatoorahResponse executePayment(Map<String,Object> bodyParams, @Nullable String currencyCode, @Nullable String applicationId, @Nullable String tenantId)
      Executes the DefaultTransactionTypes.AUTHORIZE transactions.
      Parameters:
      bodyParams - the request body
      currencyCode - the currency code for the transaction
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the MyFatoorah ExecutePayment API response
      Throws:
      ProviderApiException - if the request failed
    • getPaymentStatus

      MyFatoorahResponse getPaymentStatus(String id, String keyType, @Nullable String currencyCode, @Nullable String applicationId, @Nullable String tenantId)
      Gathers the status of a MyFatoorah payment based upon the invoiceId or paymentId
      Parameters:
      id - paymentId or invoiceId to get payment status.
      keyType - paymentId or invoiceId
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the status of a MyFatoorah payment
    • reverseAuthorize

      MyFatoorahResponse reverseAuthorize(Map<String,Object> bodyParams, @Nullable String currencyCode, @Nullable String applicationId, @Nullable String tenantId)
      Executes the DefaultTransactionTypes.REVERSE_AUTH transactions.
      Parameters:
      bodyParams - the request body
      currencyCode - The currency code for this transaction
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from MyFatoorah API
      Throws:
      ProviderApiException - if the request failed
    • capture

      MyFatoorahResponse capture(Map<String,Object> bodyParams, @Nullable String currencyCode, @Nullable String applicationId, @Nullable String tenantId)
      Executes the DefaultTransactionTypes.CAPTURE transactions.
      Parameters:
      bodyParams - the request body
      currencyCode - The currency code for this transaction
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from MyFatoorah API
      Throws:
      ProviderApiException - if the request failed
    • refund

      MyFatoorahResponse refund(Map<String,Object> bodyParams, @Nullable String currencyCode, @Nullable String applicationId, @Nullable String tenantId)
      Executes the DefaultTransactionTypes.REFUND transactions.
      Parameters:
      bodyParams - the request body
      currencyCode - The currency code for this transaction
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from MyFatoorah API
      Throws:
      ProviderApiException - if the request failed
    • getRefundStatus

      MyFatoorahResponse getRefundStatus(String refundId, @Nullable String currencyCode, @Nullable String applicationId, @Nullable String tenantId)
      Gathers the status of a MyFatoorah refund by id
      Parameters:
      refundId - the id of the MyFatoorah refund
      currencyCode - The currency code for this request
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the status of a MyFatoorah refund
      Throws:
      ProviderApiException - if the request failed
    • initiatePayment

      MyFatoorahInitiatePaymentResponse initiatePayment(MyFatoorahInitiatePaymentRequest initPaymentRequest, @Nullable String applicationId, @Nullable String tenantId)
      This method is responsible for making call to init-payment end-point of MyFatoorah.
      Parameters:
      initPaymentRequest - init payment request
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from MyFatoorah API.