Interface PaymentGatewayPaymentModificationService
- All Superinterfaces:
PaymentGatewayTypeAware
This service is responsible for interacting with the payment gateway to modify a payment's
paymentMethodProperties.
- Author:
- Dima Myroniuk (dmyroniuk)
-
Method Summary
Modifier and TypeMethodDescriptionProvides the set ofPaymentInfo.getPaymentMethodProperties()map keys for any properties that declare a callback url used to redirect back to a Broadleaf context following an interaction like 3DS verification or a HPP interaction.default voidmodifyFullPaymentForCreate(@NonNull PaymentInfo paymentInfo, String applicationId, String tenantId) When a payment is being newly created, the request information will be copied to aPaymentInfoand passed into this method.modifyPaymentMethodProperties(@NonNull PaymentInfo paymentInfo, String applicationId, String tenantId) Modify the givenPaymentInfo.getPaymentMethodProperties()for alternative values used by the gateway.modifyPaymentMethodProperties(@NonNull Map<String, String> paymentMethodProperties, String applicationId, String tenantId) Deprecated, for removal: This API element is subject to removal in a future version.updateGatewayPayment(@NonNull UpdateGatewayPaymentRequest request, String applicationId, String tenantId) Updates the payment gateway's representation of the payment.Methods inherited from interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware
getGatewayType
-
Method Details
-
modifyPaymentMethodProperties
@Deprecated(forRemoval=true) default Map<String,String> modifyPaymentMethodProperties(@NonNull @NonNull Map<String, String> paymentMethodProperties, @Nullable String applicationId, @Nullable String tenantId) Deprecated, for removal: This API element is subject to removal in a future version.Modify the givenpaymentMethodPropertiesfor alternative values used by the gateway. In most cases, this involves swapping a provided payment representation for a different style of representation. For example, swapping a digital wallet token for the payment gateway's token.- Parameters:
paymentMethodProperties- the payment method propertiesapplicationId- the application idtenantId- the tenant id- Returns:
- the modified payment method properties
- Throws:
PaymentMethodPropertiesModificationException- if an error occurred during the modification of the payment method properties
-
modifyPaymentMethodProperties
default Map<String,String> modifyPaymentMethodProperties(@NonNull @NonNull PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId) Modify the givenPaymentInfo.getPaymentMethodProperties()for alternative values used by the gateway. In most cases, this involves swapping a provided payment representation for a different style of representation. For example, swapping a digital wallet token for the payment gateway's token.- Parameters:
paymentInfo- the information about payment. Note thatPaymentInfo.getAttributes()will contain additional system-provided values such as those found inPaymentInfoAttributes.applicationId- the application idtenantId- the tenant id- Returns:
- the modified payment method properties
- Throws:
PaymentMethodPropertiesModificationException- if an error occurred during the modification of the payment method properties
-
modifyFullPaymentForCreate
default void modifyFullPaymentForCreate(@NonNull @NonNull PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId) When a payment is being newly created, the request information will be copied to a
PaymentInfoand passed into this method. The implementation can then customize the values as needed depending on the gateway-specific requirements. All values from the modifiedPaymentInfowill then be mapped back onto the payment, essentially as a full replacement.For backwards compatibility, this method is called after
modifyPaymentMethodProperties(PaymentInfo, String, String)has already run.- Parameters:
paymentInfo- the object containing payment details which should be directly mutated. All fields from this instance will be mapped back onto the ultimate payment object. Note - unlikemodifyPaymentMethodProperties(PaymentInfo, String, String), thePaymentInfo.getAttributes()in the input will not contain system-provided extra entries forPaymentInfoAttributes, as the goal is to keep the input/output as pure as possible. Thus, the recommendation is to pre-process those extras in the other method if needed.applicationId- the application idtenantId- the tenant id- Throws:
PaymentMethodPropertiesModificationException- if an error occurred during the modification of the payment method propertiesInvalidPaymentConfigurationException- if the provided details are somehow invalid and payment creation should be rejected- Since:
- PaymentGatewayCommon 2.0.5
-
updateGatewayPayment
default Map<String,Object> updateGatewayPayment(@NonNull @NonNull UpdateGatewayPaymentRequest request, @Nullable String applicationId, @Nullable String tenantId) Updates the payment gateway's representation of the payment.- 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.
-
getCallbackUrlKeys
Provides the set ofPaymentInfo.getPaymentMethodProperties()map keys for any properties that declare a callback url used to redirect back to a Broadleaf context following an interaction like 3DS verification or a HPP interaction.- Returns:
- a set of
PaymentInfo.getPaymentMethodProperties()map keys
-
modifyPaymentMethodProperties(PaymentInfo, String, String)