A Core dna store is a set of records and an API that moves a purchase from cart to order: products described in every language and priced in every currency the store sells in, a cart, a checkout that becomes an order, invoices, payments, tax and shipping. The site builds the storefront on top: the cart and checkout pages, their scripts, and the customer emails.
L2–L3
Unit 08 · Reference
Commerce provider reference
ReferencePage 31 of 31Updated
Every payment, tax and shipping provider the platform ships, one entry each: what it can do, what it is configured with, how to test it, and what to check before the site goes live.
True of every provider below, and not repeated in each entry:
A provider is a record, not a setting. Payment methods are added under Invoices › Payment methods, tax providers under Taxes. Each has a name, an on or off switch (Active or Enabled), an optional site, and the configuration listed below. Like every record, it exists only on the environment where it was created, so staging and production each need their own.
Payment methods are shared by every site of the account.GET /cdna-api/invoices/payment-methods?active=1 lists the active methods of every site, so filter it to entries whose site is the current one or none.
Active is the switch that offers a method. To offer a method only for some currencies, amounts or countries, filter the list in the checkout's own code.
These are the providers the platform ships: four payment provider types, three tax provider types and the template shipping method.
Payment providers
Stripe
Type
stripe
Capabilities
Cards, and the other payment method types the connected Stripe account has switched on. At checkout, 3-D Secure and bank redirects, as the purchase response's PAYMENT_AUTHENTICATION_REQUIRED and PAYMENT_REDIRECT. Full and partial refunds from the site's admin. Works at checkout and in forms.
Configuration
Only the connected account's id (account_id), set by the "Connect account" button. There are no API keys to enter: the platform's own Stripe keys are used, through Stripe Connect. The payment methods list gives the browser the publishableKey and accountId it needs.
Order created
By Stripe's webhook, which Core dna registers for the whole platform; a site registers nothing. The purchase call normally answers PAYMENT_PENDING: the checkout is split from its cart and kept for Checkouts.standaloneLifetime (a year by default) while the shopper waits on the payment-processing page, and the webhook completes it into an order. See The payment-processing page and webhooks.
Test mode
The Test Mode switch selects the platform's test or live Stripe keys. Pay with Stripe's test cards.
Go-live checklist
Test Mode off, and the account connected.
Stripe's script hosts in the CSP policy setting.
The payment-processing page built and polling.
The payment method types switched on in Stripe confirm within Checkouts.standaloneLifetime of the attempt, a year by default.
Refunds issued from the site's admin, so the site records them.
One small real order placed and refunded.
PayPal
Type
paypal
Capabilities
PayPal, and PayPal's card fields. Full and partial refunds from the site's admin. Works at checkout and in forms.
Configuration
clientId and clientSecret, from a PayPal REST app
Order created
During the purchase call, which captures the payment and creates the order in the same request. PayPal needs no webhook.
Test mode
Test Mode uses PayPal's sandbox, with the credentials of a sandbox REST app
Go-live checklist
The live REST app's client ID and secret, and Test Mode off.
PayPal's script hosts in the CSP policy setting.
A routine to compare PayPal's dashboard with the site's orders, regularly.
One small real order placed and refunded.
PayPal Donate
Type
paypal-donate
Capabilities
The PayPal donate button, for donations through a form's payment element. A donation through a hosted button starts as a draft invoice, finalised with the amount PayPal reports. Refund a donation in PayPal.
Configuration
businessEmail (the PayPal account that receives the money) or hostedButtonId (a button made in PayPal). It also uses the environment's PayPal Donate salt, set by Core dna.
Completed by
PayPal's notification, which the platform checks with PayPal before trusting it. The notification address is sent with each donation, so nothing is registered. The form submission is completed, and its Completed event fires, when the notification arrives
Test mode
Test Mode uses PayPal's sandbox, for the button and for checking notifications
Go-live checklist
The live business email or button, and Test Mode off.
The salt confirmed on production with Core dna.
One real donation made, and the form submission seen as completed.
Mock Pay
Type
mock-pay
Capabilities
None real: it reports payments as successful without taking any money, and the orders it creates look like real ones. Refunds are accepted when its refunds switch is on.
Configuration
failureRate (never, random or always; default never), and switches for authorisation, partial capture and refunds (authorizationSupported, partialCaptureSupported, refundsSupported, all off by default)
Test mode
It is only ever a test. Use always to exercise the decline path and random for retries
Go-live checklist
No Mock Pay method Active on any site of the account.
GET /cdna-api/invoices/payment-methods?active=1 on the live hostname returns no "paymentServiceProviderType": "mock-pay".
A tax provider is chosen per checkout: the provider of the tax zone that matches the address, or the default provider when none does. Every provider receives the default warehouse's address as the ship-from address when no other warehouse is given, and returns the tax per line, shipping included.
Avalara
Type
avalara
Capabilities
Calculation per line, including shipping. Address validation, on by default: Avalara validates the address before it calculates. Submits the transaction to Avalara after payment, when submit_documents is on. Product tax codes through tax categories.
The sandbox switch sends requests to Avalara's sandbox, with a sandbox account's credentials
Go-live checklist
Production credentials and company code, and the sandbox switch off.
Nexus configured in Avalara for every place the client must collect. Elsewhere Avalara returns zero tax.
A default item tax code and a shipping tax code set, and a tax category on every product whose code differs from the default.
Submit documents on, if the client files returns from Avalara.
The default warehouse's address correct.
Stripe Tax
Type
stripe
Capabilities
Calculation per line, including shipping, through the platform's Stripe keys and the account of the site's Stripe payment method. Submits the transaction to Stripe after payment, when submit_documents is on.
Uses the platform's Stripe test keys, which Core dna manages; arrange testing with Core dna
Go-live checklist
Test mode off, and the Stripe payment method connected to the same account.
A registration in Stripe for every place the client must collect. Elsewhere Stripe Tax returns zero tax.
The default item tax code and the shipping tax code set.
Mock
Type
mock
Capabilities
One flat percentage on every line, shipping included. Nothing is submitted anywhere.
Configuration
rate, the percentage
Test mode
It is only ever a test
Go-live checklist
No live tax zone, and not the default provider, points at it: it would charge real shoppers a made-up rate.
Shipping
Template method
Type
The one kind of shipping method: even a flat rate is a template.
Capabilities
Any calculation a template can make from the items, their products and the address: bands by weight or value, free shipping over an amount, regions by postcode. The template creates rates with rates.create(total, name, serviceLevel, courierName): the rates it creates are the method's result, worked out by the template's own logic and tables.
Configuration
Name, Active, a group, its shipping categories, the warehouses it serves for pickup, and the template code in the site's template language. Where the method ships, by region or by site, is decided in the template.
Test mode
Test on a test site, with a method that offers a single free rate if the build needs one, and compare every rate with a hand calculation
Go-live checklist
Every product has a shipping category, or a default shipping category is set.
Every method has at least one shipping category, and together they cover every category in use.
Each template tested with a domestic, an international and a pickup order, and one order per band.
Region rules written in the template from the delivery address, and any site rule checked there with the site's id.