Chord OMS
...
Chord OMS Overview
Payments

Stripe Checkout

3min

This document will help you with understanding Stripe checkout

Introduction

Chord uses Stripe's 1-step checkout. When a customer hits the Checkout button in the store after they place items in their cart, the store will redirect the customer’s browser to Stripe to complete checkout.

Why are checkout totals in Stripe are higher than cart totals?

When the customer checks out in the store, the OMS does not have the billing/shipping address for the customer. Therefore, it cannot calculate the correct sales tax and shipping rates. Addresses are only collected during checkout in Stripe.

OMS implements a workflow to capture the correct shipping and tax amounts from the customer. When initiating a Stripe checkout session, the OMS:

  1. Charges the highest possible shipping rate.
  2. Charges the maximum tax rate (10%)

When checking out, customers may observe that the total in Stripe does not match the total in the store checkout. Tenants are advised to include appropriate text in their store checkout to inform users of the discrepancy.

When the checkout is complete, OMS receives the customer’s checkout information and addresses from the Stripe webhook. OMS then calculates the correct tax and shipping amounts and the difference/credit owed to the customer. OMS triggers a job to refund the difference to the customer.

Embedded Checkout

Chord now allows for Stripe’s embed checkout. Simply provide a STRIPE_EMBED_CHECKOUT = enabled in the OMS store configuration and OMS will prepare a checkout session suitable for using Stripe’s embed checkout.

For more information, refer to Chord's Embedded Checkout documentation.



Allowing carts for ad-hoc charges

Tenants can make additional charges on completed orders by attaching the customer's payment method to their Stripe account. By enabling STRIPE_ALWAYS_OFF_SESSION in the OMS, we inform Stripe that we wish to charge the customer's credit card as needed.

Technically, this is done by setting the payment_method_options when creating the PaymentIntent

JS


By default, customers that have a subscription item in their orders will always have this setting turned on because we will need to be able to charge their card once their subscription renews.

Apple Pay

To display Apple Pay, the STRIPE_ALWAYS_OFF_SESSION environment variable in the OMS must be disabled. Disabling this environment variable and activating this payment method in your Stripe dashboard should allow for this payment method to be present on checkout. To present Apple Pay, an apple pay-enabled browser (like Safari) on an apple pay-enabled device (like an iPhone) must be used.

Unfortuantely, there is currently a trade-off. Per a recent change from Apple Pay and Stripe, Apple Pay does not allow for this method to be used as a recurring payment method (i.e. to be used for future use). Disabling this environment variable (which allows for this payment method to be active) will conflict with using any other payment methods (including Stripe credit card) for any additional ad-hoc charges after an order is completed.

This means that Chord customers using Stripe checkout will have to decide whether to have Apple Pay be available as a payment method, knowing that this will prevent ad-hoc charges from being added, after the fact, to a completed order.

Attempting to charge a customer after an order is completed, while STRIPE_ALWAYS_OFF_SESSION is disabled will result in this error:

The provided PaymentMethod was previously used with a PaymentIntent without Customer attachment, shared with a connected account without Customer attachment, or was detached from a Customer. It may not be used again. To use a PaymentMethod multiple times, you must attach it to a Customer first.

For example:



Document image

Document image


if you have any questions or need help, please reach out to us at [email protected]



Updated 14 May 2024
Did this page help you?