Cert++
Close

Payment resubmission and cart-change invalidation in checkout

Key Takeaway

Submitting payment again reverses, refunds or replaces the earlier payment, depending on its state. Changing the cart after the billing address is set invalidates the payment and clears the billing address.

In a B2B Commerce checkout, a POST to the Checkout Payments resource submits the buyer's payment. A separate call places the order. What happens between those calls matters, because a new payment submission or a cart change can affect the payment already in the checkout. Custom code that edits the cart or billing address at the wrong time often causes payment and order placement errors.

How to submit payment and place the order
  1. Submit the buyer's payment with a POST to the Checkout Payments resource: /commerce/webstores/webstoreId/checkouts/activeOrCheckoutId/payments.
  2. Place the order with a separate POST to /commerce/webstores/webstoreId/checkouts/activeOrCheckoutId/orders. The orders POST takes no request parameters and no request body.

The activeOrCheckoutId value is either a checkout ID or the value active, which means the active checkout.

The Checkout Payments resource takes a tokenized payment from a payment provider. The resource works for both Salesforce Payments and custom payment adapters.

Salesforce Accredited B2B Commerce Developer Professional Study Guide

Checklist progress

0/124Learned

Code implementations against the 4 crucial reference implementations used in checkout and payment interfaces with in-depth knowledge of all supported actions

0/23

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Salesforce Accredited B2B Commerce Developer Professional studiers. 757 members and growing.