Salesforce Commerce Cloud cartridges
Accept cards, wallets, and local payment methods in a Salesforce B2C Commerce storefront with the Pay.com cartridges.
The Pay.com cartridges for Salesforce B2C Commerce add Pay.com as a payment method at the SFRA checkout, and to PWA Kit storefronts through a Custom API. Customers pay with the cards, wallets, and local payment methods your Pay.com account offers, and card details are entered in Pay.com-hosted frames.
B2C Commerce creates and validates the order before any payment is taken. The order stays CREATED until the cartridges confirm the payment with Pay.com on the server, and only then is it placed.
To install the cartridges and connect them to your Pay.com account, see Set up the Salesforce Commerce Cloud cartridges. Every setting and its default is in Settings.
Supported features
The cartridges support these checkout and order management features.
| Feature | Description |
|---|---|
| Checkout | Cards, wallets, and local payment methods at SFRA's checkout, with the payment form on the review step, above Place order. By default, each payment method is an option of its own on the payment step, and the card is entered in secure fields styled like your checkout. See Checkout settings. |
| Capture | Capture automatically when the customer pays, or authorize at checkout and capture later in Merchant Tools → Pay.com → Orders, or when the order's shipping status becomes SHIPPED. |
| Refunds | Refund a captured payment from Pay.com → Orders, in full or in part. Refunds made in the Pay.com dashboard reach the order. Voiding releases an authorization. |
| Payment review | A payment that doesn't match its order holds the order for review. Accept or deny it in Pay.com → Orders. |
| Express checkout | Apple Pay and Google Pay buttons on product pages, the cart, the mini-cart, and the top of the checkout page. Customers pay without filling in the checkout form, and B2C Commerce still creates and validates the order first. A product page button buys that one product from a basket of its own and leaves the customer's basket as it was. |
| Saved cards | Registered customers can save a card when they pay in Pay.com's Universal checkout, pay with it later, and add or delete cards in My Account. With card fields, the default, there's no option to save a card at checkout. Pay.com keeps the card. The storefront keeps only its brand, last four digits, and expiration date. |
| Apple Pay domain | The storefront serves Apple's domain association file through a static mapping, and registers its domain with Apple through Pay.com. |
| Headless storefronts | PWA Kit storefronts take payments through the cartridges' pay-com Custom API. See PWA Kit. |
How orders stay in sync
The storefront confirms each payment with Pay.com on its server. Webhooks, which the PayCom-ProcessWebhooks job processes every minute, and the PayCom-Reconcile job, which runs every 15 minutes, reconcile payments when a customer closes the browser before returning to your store.
| Pay.com outcome | B2C Commerce order |
|---|---|
| Paid | Placed as NEW, payment status PAID, confirmed and ready to export. SFRA sends the order confirmation email. |
| Authorized (manual capture) | Placed as NEW, confirmed and ready to export, with the authorization to capture in Pay.com → Orders before it expires. |
| Funds pending, for example a bank debit | Placed as NEW, not confirmed and not exported until the funds clear. The confirmation email waits until then, and the order is canceled if the funds don't clear. |
| Failed | FAILED, and the customer's basket comes back, so they can pay again. |
| Requires manual review | Placed, not confirmed and not exported, with the reason on the order. |
A customer who leaves an unpaid order, back to the cart or the checkout, gets their basket back once the order's payment session is blocked. The reconciler fails an order still unpaid after Fail unpaid orders after (minutes), once its payment session is blocked. An order with a payment in flight is kept.
A payment that completes after its order failed reopens the order when the stock is still there. Otherwise, Late payments decides whether the payment is refunded or the order is held for review. A refund made in the Pay.com dashboard is recorded on its order, and a full refund marks the order's payment refunded.
The cartridges subscribe to the 12 shared plugin webhook events.
Pay.com orders in Business Manager
Merchant Tools → Pay.com → Orders lists the site's Pay.com orders. On an order, you can capture an authorization (in full or in part), void it, refund a captured payment (in full or in part), and accept or deny a payment held for review. A refund after a manual capture goes through the capture's charge.
Apple Pay
The Apple Pay button shows only on a domain registered with Apple. In Merchant Tools → SEO → Static Mapping, map /.well-known/apple-developer-merchantid-domain-association to the PayDotCom-AppleDomain controller. Then, under Apple Pay in Merchant Tools → Pay.com → Settings and Connect, check the Domain and click Register for Apple Pay. The storefront sends its domain to Pay.com, and Pay.com asks Apple to check the file. This registers the domain for the active environment, so register it again after you switch between sandbox and live.
The storefront must be on HTTPS at the root of its domain.
PWA Kit
For a PWA Kit storefront, put int_pay_com_scapi:int_pay_com on the site's cartridge path and turn on hook execution for the Commerce API in Administration → Global Preferences → Feature Switches. The pay-com Custom API then takes payments with the same rules. Shopper Orders creates the order, the Custom API ties the payment session to it, and only the cartridges place it once Pay.com confirms the payment. Its calls use the customer's SLAS token, so add the c_pay_com_checkout scope to the storefront's SLAS client.
| Endpoint | What it does |
|---|---|
POST /baskets/{basketId}/payment-session | The basket's payment session, to render Pay.com's payment form on, after Shopper Baskets adds a PAY_COM payment instrument. It also returns checkout settings, including the payment form, available payment options, and whether express buttons show at the top of checkout. |
POST /orders/{orderNo}/payment-session | Called after createOrder in Shopper Orders to bind the session to the order at its exact total, report when the form holds a different session, or report that the order is already paid. |
POST /returns | Called on the storefront's return page with the return URL's token to confirm the payment with Pay.com and return the next redirect target. |
POST /baskets/{basketId}/express-quote, POST /baskets/{basketId}/express-payer | Prices the basket for express checkout using the wallet's address, then populates the basket with the payer's details. |
GET /saved-cards, POST /saved-cards/sync, DELETE /saved-cards/{cardId}, POST /saved-cards/setup, and POST /saved-cards/setup-result | Lists, syncs, deletes, and adds saved cards for a registered customer. |
Set Headless: return page URL and Headless: card saved page URL to the storefront's pages.
Data the cartridges send
The cartridges communicate with Pay.com in three ways:
- The checkout page loads Pay.com.js from
https://js.pay.com/v1. Card details are entered in Pay.com frames and sent only to Pay.com. - The storefront's server calls the Pay.com API (
https://api.pay.com/v1, orhttps://api.sandbox.pay.com/v1for the sandbox) to create payment sessions, to confirm, capture, and refund payments, to manage saved cards, and to read the payment methods your account offers. - For Apple Pay, the storefront downloads Apple's domain association file from Pay.com at most once a day, and sends its domain to the Pay.com API when a Business Manager user clicks Register for Apple Pay.