Interface PaymentGatewaySavedPaymentMethodService

All Superinterfaces:
PaymentGatewayTypeAware

public interface PaymentGatewaySavedPaymentMethodService extends PaymentGatewayTypeAware
This service is responsible for interacting with the payment gateway for the saved payment methods. This service can be used to modify, add or remove the payment method properties before the saved payment method will be created, updated or removed.
Author:
Dima Myroniuk (dmyroniuk)
  • Method Details

    • exchangeSingleUseTokenIfApplicable

      @Deprecated(forRemoval=true) default Map<String,String> exchangeSingleUseTokenIfApplicable(@NonNull @NonNull Map<String,String> paymentMethodProperties, @Nullable String tenantId, @Nullable String applicationId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Exchanges the short-lived (typically single-use) payment token for a long-lived, multi-use token.
      Parameters:
      paymentMethodProperties - the map that contains the single-use payment token. This map shouldn't be modified.
      tenantId - the id for the current tenant
      applicationId - the id for the current application
      Returns:
      the map that contains the multi-use payment token
      Throws:
      ExchangeSingleUseTokenException - when an error occurred during token exchanging
    • modifyPaymentMethodPropertiesForCreate

      default Map<String,String> modifyPaymentMethodPropertiesForCreate(@NonNull @NonNull PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId)
      The handler is used to modify, add or remove the payment method properties before creating the saved payment method.
      Parameters:
      paymentInfo - the information about payment
      applicationId - the id for the current application
      tenantId - the id for the current tenant
      Returns:
      the modified payment method properties
      Throws:
      PaymentMethodPropertiesModificationException - when an error occurred during the modification of the payment method properties
    • modifyPaymentMethodPropertiesForUpdate

      default Map<String,String> modifyPaymentMethodPropertiesForUpdate(@NonNull @NonNull PaymentInfo originalPaymentInfo, @NonNull @NonNull PaymentInfo updatedPaymentInfo, @Nullable String applicationId, @Nullable String tenantId)
      The handler is used to modify, add or remove the payment method properties before updating the saved payment method.
      Parameters:
      originalPaymentInfo - the PaymentInfo reflecting the payment's original state
      updatedPaymentInfo - the PaymentInfo reflecting the payment's updated state
      applicationId - the id for the current application
      tenantId - the id for the current tenant
      Returns:
      The reuse token properties
      Throws:
      PaymentMethodPropertiesModificationException - when an error occurred during the modification of the payment method properties
    • deleteGatewaySavedPaymentMethod

      default Map<String,String> deleteGatewaySavedPaymentMethod(@NonNull @NonNull PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId)
      The handler is used to modify, add or remove the payment method properties before deleting the saved payment method.
      Parameters:
      paymentInfo - the PaymentInfo reflecting the payment current state
      applicationId - the id for the current application
      tenantId - the id for the current tenant
      Returns:
      the modified payment method properties
      Throws:
      PaymentMethodPropertiesModificationException - when an error occurred during the modification of the payment method properties
    • buildCustomerNotification

      @Nullable default PaymentCustomerNotification buildCustomerNotification(SavedPaymentMethodInfo savedPaymentMethodInfo, @Nullable String applicationId, @Nullable String tenantId)
      This method is used to build the notification that should be sent to the customer when the saved payment method is created.
      Parameters:
      savedPaymentMethodInfo - the SavedPaymentMethodInfo that represents the information about the saved payment method
      applicationId - the id for the current application
      tenantId - the id for the current tenant
      Returns:
      the payment notification that should be sent to the customer