Broadleaf Microservices
  • v1.0.0-latest-prod

Preparing a PaymentTransactionServices Payment PayPal v1 Transactions

To execute PayPal 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.

Via PayPal’s frontend integration, we expect a PayPal Payment to be created, and the customer to be prompted to login and select their preferred payment method. From there, we expect the frontend to provide the PayPal Payment ID and Payer ID to PaymentTransactionServices to execute any subsequent transactions.

Specify the paymentID and payerID in the paymentMethodProperties to create a Payment:

{
  ...
  gatewayType: "PAYPAL_CHECKOUT",
  type: "THIRD_PARTY_ACCOUNT",
  paymentMethodProperties: {
    "PAYMENTID": paymentID,
    "PAYERID": payerID
  },
  isSingleUsePaymentMethod: true,
  ...
}
Note
Also see how to add a payment via the Commerce SDK.