Interface AdyenProvider

All Known Implementing Classes:
ExternalAdyenProvider

public interface AdyenProvider
The Adyen provider that is used to execute the requests to the Adyen API.
  • Method Details

    • createSession

      Map<String,Object> createSession(@NonNull @NonNull CreateCheckoutSessionRequest request, @Nullable String applicationId, @Nullable String tenantId)
      This method is responsible for making call to create session end-point of Adyen.
      Parameters:
      request - The request to create a session
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from Adyen API.
      Throws:
      ProviderApiException - if the request failed
    • getAvailablePaymentMethods

      Map<String,Object> getAvailablePaymentMethods(AdyenPaymentMethodsRequest request, @Nullable String applicationId, @Nullable String tenantId)
      Gathers a map of available payment methods that's used to inform what should be rendered by Adyen frontend components.
      Parameters:
      request - Request payload describing the context in which the payment methods will be considered.
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      a map of available payment methods that's used to inform what should be rendered by Adyen frontend components.
      Throws:
      ProviderApiException - if the request failed
    • startTransaction

      AdyenResponse startTransaction(Map<String,Object> bodyParams, @Nullable String currencyCode, @Nullable String transactionReferenceId, @Nullable String applicationId, @Nullable String tenantId)
      Executes DefaultTransactionTypes.AUTHORIZE or DefaultTransactionTypes.AUTHORIZE_AND_CAPTURE transactions.
      Parameters:
      bodyParams - the request body
      currencyCode - The currency code for this transaction
      transactionReferenceId - - transactionReferenceId that will be used ad idempotency key for the adyen request
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from Adyen API
      Throws:
      ProviderApiException - if the request failed
    • submitPaymentDetails

      AdyenResponse submitPaymentDetails(AdyenPaymentDetailsRequest request, @Nullable String applicationId, @Nullable String tenantId)
      Submits details for a payment created using "/payments" API. This step is only needed when no final state has been reached on the "/payments" request, for example when the shopper was redirected to another page to complete the payment.
      Parameters:
      request - the request with payment details
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from Adyen API
      Throws:
      ProviderApiException - if the request failed
    • cancelAuthorization

      AdyenResponse cancelAuthorization(String pspReference, Map<String,Object> bodyParams, @Nullable String currencyCode, @Nullable String transactionReferenceId, @Nullable String applicationId, @Nullable String tenantId)
      Executes DefaultTransactionTypes.REVERSE_AUTH or DefaultTransactionTypes.REFUND transactions.
      Parameters:
      pspReference - the Adyen payment reference
      bodyParams - the request body
      currencyCode - The currency code for this transaction
      transactionReferenceId - - transactionReferenceId that will be used ad idempotency key for the adyen request
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from Adyen API
      Throws:
      ProviderApiException - if the request failed
    • capture

      AdyenResponse capture(String pspReference, Map<String,Object> bodyParams, @Nullable String currencyCode, @Nullable String transactionReferenceId, @Nullable String applicationId, @Nullable String tenantId)
      Executes the DefaultTransactionTypes.CAPTURE transactions.
      Parameters:
      pspReference - the Adyen payment reference
      bodyParams - the request body
      currencyCode - The currency code for this transaction
      transactionReferenceId - - transactionReferenceId that will be used ad idempotency key for the adyen request
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from Adyen API
      Throws:
      ProviderApiException - if the request failed
    • refund

      AdyenResponse refund(String pspReference, Map<String,Object> bodyParams, @Nullable String currencyCode, @Nullable String transactionReferenceId, @Nullable String applicationId, @Nullable String tenantId)
      Executes the DefaultTransactionTypes.REFUND transactions.
      Parameters:
      pspReference - the Adyen payment reference
      bodyParams - the request body
      currencyCode - The currency code for this transaction
      transactionReferenceId - - transactionReferenceId that will be used ad idempotency key for the adyen request
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from Adyen API
      Throws:
      ProviderApiException - if the request failed
    • updatePayPalOrder

      UpdateExpressPayPalOrderResponse updatePayPalOrder(UpdateExpressPayPalOrderRequest request, @Nullable String applicationId, @Nullable String tenantId)
      Updates the PayPal Order object to help advance the PayPal express checkout interaction.
      Parameters:
      request - Request object describing the data that is to be updated.
      applicationId - the current context's application id.
      tenantId - the current context's tenant id.
      Returns:
      The gateway's response to the update.
    • readStoredPaymentMethods

      AdyenStoredPaymentMethodsResponse readStoredPaymentMethods(String customerReference, String merchantAccount, @Nullable String applicationId, @Nullable String tenantId)
      Reads saved payment method from adyen for customer reference
      Parameters:
      customerReference - - a shopper reference that identifies customer and was used to store payment in adyen
      merchantAccount - - merchant account id/name in adyen associated with current site/shop
      applicationId - - the application id
      tenantId - - the tenant id
      Returns:
      the response from Adyen API
      Throws:
      ProviderApiException - if the request failed
    • removeStoredPaymentMethod

      void removeStoredPaymentMethod(String customerReference, String merchantAccount, String storedPaymentMethodId, @Nullable String applicationId, @Nullable String tenantId)
      Deleates saved payment method from adyen for customer reference
      Parameters:
      customerReference - - a shopper reference that identifies customer and was used to store payment in adyen
      merchantAccount - - merchant account id/name in adyen associated with current site/shop
      storedPaymentMethodId - - id of adyen stored payment method
      applicationId - - the application id
      tenantId - - the tenant id
      Throws:
      ProviderApiException - if the request failed