Broadleaf Microservices
  • v1.0.0-latest-prod

Preparing a PaymentTransactionServices Payment for PayPal 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 (the PayPal button), we expect a PayPal Order to be created, and the customer to be prompted to login & select their preferred payment method. From there, we expect the frontend to provide the PayPal Order id to PaymentTransactionServices to execute any subsequent transactions.

Payment Creation

When creating a payment, the following fields are expected by this integration module

{
  ...
  gatewayType: "PAYPAL_CHECKOUT_V2",
  type: "THIRD_PARTY_ACCOUNT",
  paymentMethodProperties: {
    "ORDER_ID": "order_id_from_frontend_integration"
  },
  isSingleUsePaymentMethod: true,
  ...
}
Note
Also see how to add a payment via the Commerce SDK.