Asynchronous Payment Methods
Salesforce B2C Commerce uses specific APIs and order status to support order checkout processes that integrate with asynchronous payment method such as PayPal, iDeal, GlobalCollect, and many others.
Using an asynchronous method means that during order submission, the customer leaves the storefront and is redirected to the payment site. After successful payment completion, the customer is redirected to B2C Commerce where the order is created.
Order creation is separate from order placement using two pipelets: CreateOrder and PlaceOrder. The FailOrder pipelet is used to set the order status to FAILED.
Typical order processing is as follows:
- Order creation: CreateOrder
- Payment authorization
- Order placement: PlaceOrder
Order Status: CANCELLED
The order can be canceled via the CancelOrder pipelet and in Business Manager. This is what happens:
- Order status is set to CANCELLED
- Coupon redemptions are removed
- Product list purchases are removed
- Order history entry is created
- Inventory is released
Order Status: CREATED
The order record is saved in B2C Commerce with the status CREATED before the payment is authorized. If the shopper doesn't return to the online store to complete order processing, a customer service representative (CSR), at the shopper's request, can use Business Manager to update the status of the order to NEW, which causes the order to move on to the fulfillment process.
If a shopper continually navigates, invoking this part of the checkout process, B2C Commerce will not fill up with CREATED orders. Instead, an order is associated with a basket when it is created and is used if the customer returns to the beginning of the checkout process.
Order Status: FAILED
When an order fails, the following occurs:
- Order status is set to FAILED.
- Coupon redemptions that were created are removed.
- Inventory reservations are canceled.
The FAILED status means that an order did not successfully complete payment authorization and could not be placed. Although the order exists, it's marked as FAILED because a problem occurred that could not be recovered.
Orders with the FAILED status can't be reopened or canceled. The CancelOrder pipelet will abort on the error exit when it is executed on an order with the FAILED status. The pipelet returns the error status code: OrderProcessStatusCode.ORDER_ALREADY_FAILED.
However, a new order to replace the failed one can be placed. Using the FAILED status value, a customer service representative (CSR) can search in the Business Manager Ordering module to identify and manage failed orders.
Order Journal
For asynchronous payment methods, the following pipelets create the corresponding action in B2C Commerce's order journal.
Pipelet | Action |
---|---|
CreateOrder |
CREATE_FOR_AUTHORIZATION CREATE |
CreateOrder2 |
CREATE_FOR_AUTHORIZATION |
FailOrder | FAILED |