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 Summary
Modifier and TypeMethodDescriptioncancelAuthorization
(String pspReference, Map<String, Object> bodyParams, String currencyCode, String transactionReferenceId, String applicationId, String tenantId) ExecutesDefaultTransactionTypes.REVERSE_AUTH
orDefaultTransactionTypes.REFUND
transactions.capture
(String pspReference, Map<String, Object> bodyParams, String currencyCode, String transactionReferenceId, String applicationId, String tenantId) Executes theDefaultTransactionTypes.CAPTURE
transactions.createSession
(@NonNull CreateCheckoutSessionRequest request, String applicationId, String tenantId) This method is responsible for making call to create session end-point of Adyen.getAvailablePaymentMethods
(AdyenPaymentMethodsRequest request, String applicationId, String tenantId) Gathers a map of available payment methods that's used to inform what should be rendered by Adyen frontend components.readStoredPaymentMethods
(String customerReference, String merchantAccount, String applicationId, String tenantId) Reads saved payment method from adyen for customer referencerefund
(String pspReference, Map<String, Object> bodyParams, String currencyCode, String transactionReferenceId, String applicationId, String tenantId) Executes theDefaultTransactionTypes.REFUND
transactions.void
removeStoredPaymentMethod
(String customerReference, String merchantAccount, String storedPaymentMethodId, String applicationId, String tenantId) Deleates saved payment method from adyen for customer referencestartTransaction
(Map<String, Object> bodyParams, String currencyCode, String transactionReferenceId, String applicationId, String tenantId) ExecutesDefaultTransactionTypes.AUTHORIZE
orDefaultTransactionTypes.AUTHORIZE_AND_CAPTURE
transactions.submitPaymentDetails
(AdyenPaymentDetailsRequest request, String applicationId, String tenantId) Submits details for a payment created using "/payments" API.updatePayPalOrder
(UpdateExpressPayPalOrderRequest request, String applicationId, String tenantId) Updates the PayPal Order object to help advance the PayPal express checkout interaction.
-
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 sessionapplicationId
- the application idtenantId
- 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 idtenantId
- 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) ExecutesDefaultTransactionTypes.AUTHORIZE
orDefaultTransactionTypes.AUTHORIZE_AND_CAPTURE
transactions.- Parameters:
bodyParams
- the request bodycurrencyCode
- The currency code for this transactiontransactionReferenceId
- - transactionReferenceId that will be used ad idempotency key for the adyen requestapplicationId
- the application idtenantId
- 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 detailsapplicationId
- the application idtenantId
- 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) ExecutesDefaultTransactionTypes.REVERSE_AUTH
orDefaultTransactionTypes.REFUND
transactions.- Parameters:
pspReference
- the Adyen payment referencebodyParams
- the request bodycurrencyCode
- The currency code for this transactiontransactionReferenceId
- - transactionReferenceId that will be used ad idempotency key for the adyen requestapplicationId
- the application idtenantId
- 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 theDefaultTransactionTypes.CAPTURE
transactions.- Parameters:
pspReference
- the Adyen payment referencebodyParams
- the request bodycurrencyCode
- The currency code for this transactiontransactionReferenceId
- - transactionReferenceId that will be used ad idempotency key for the adyen requestapplicationId
- the application idtenantId
- 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 theDefaultTransactionTypes.REFUND
transactions.- Parameters:
pspReference
- the Adyen payment referencebodyParams
- the request bodycurrencyCode
- The currency code for this transactiontransactionReferenceId
- - transactionReferenceId that will be used ad idempotency key for the adyen requestapplicationId
- the application idtenantId
- 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 adyenmerchantAccount
- - merchant account id/name in adyen associated with current site/shopapplicationId
- - the application idtenantId
- - 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 adyenmerchantAccount
- - merchant account id/name in adyen associated with current site/shopstoredPaymentMethodId
- - id of adyen stored payment methodapplicationId
- - the application idtenantId
- - the tenant id- Throws:
ProviderApiException
- if the request failed
-