Broadleaf Microservices
  • v1.0.0-latest-prod

Preparing a PaymentTransactionServices Payment for the Amazon Payment Services

To execute the Amazon Payment Services transactions via PaymentTransactionServices, we must first create a Payment in PaymentTransactionServices. These Payments are most commonly created during the payment stage of your checkout flow.

Before creating the Payment in PaymentTransactionServices, a new token has to be created. See 18.1.2 Create New Token Service in Amazon Pay Services Payfort API.

Then specify the token_name from the response in the paymentMethodProperties to create a Payment:

{
  ...
  gatewayType: "AMAZON_PAYMENT_SERVICES",
  type: "CREDIT_CARD",
  paymentMethodProperties: {
    "token_name": token,
    "language": "en"
  },
  isSingleUsePaymentMethod: true,
  ...
}
Note
Also see how to add a payment via the Commerce SDK.