Bypassing Payments through Violet
Bypassing Payments through Violet
With Payment Bypassing, you are able to leverage Violet’s Checkout capabilities while bypassing all order payment requirements. The channel assumes all responsibility for facilitating payments between the shopper and the merchant, and Violet only handles order placement and management.
- Sharing your payment flow with Violet beforehand. We will need to review your existing relationship with Merchants and current payment mechanisms and then enable your application for payment bypassing on our end. You can reach out to us on support@violet.io to start this process.
- Subscribe to the
ORDER_CANCELED
,ORDER_REFUNDED
, andORDER_RETURNED
webhooks, or the catchallORDER_UPDATED
webhook. This is to ensure that channels can facilitate a refund back to the shopper when necessary, as Violet will send a webhook when a merchant triggers a refund.
Changes to Checkout
When bypassing payments, the two major changes to Checkout are the following:
-
You do not need a payment intent created by Violet, so you can leave out the
wallet_based_checkout
flag from the Create Cart API or mark it as false. -
If you currently apply a payment method manually to the cart during Checkout, you can skip this call. This is the
/checkout/cart/:cart_id/payment
API.
The remainder of the calls made to Violet during the checkout flow all remain the same.
Even when payment bypassing is enabled, if a payment method is passed in during checkout, Violet WILL charge this payment method and use the Violet payments flow. You can use this as a fallback if there is an issue while you build out your payments logic.
Merchant Level Payment Bypassing
If you are looking to migrate from using the Violet payments stack to your own, you may want to bypass payments on a per merchant basis. You can do this through the following:
Adding the Merchant to the bypass list
Add the Merchant to the payment bypass list using the following API.
PUT apps/{app_id}/configuration/payments-bypass/{merchant_id}
This API will add the given merchant_id
to the payments bypass list for this app_id
. If the merchant doesn’t exist or you do not have permissions for this merchant an exception will be thrown.
Confirm that the merchant has been added for bypassing
Confirm that the merchant has been added by calling the following API
GET apps/{app_id}/configuration/payments-bypass
This API will fetch the list of MerchantPaymentBypassRecord
s associated to this app_id
.
Go through Violet Checkout
Go through the Violet checkout flow with the following modifications
-
Do NOT include the
wallet_based_checkout
flag in the Create Cart call, if you are currently using payment intent based payment method. -
Do NOT call the Apply Payment method during the checkout process, if you are manually applying a payment method to the cart.
-
During submission, include the following body, where
app_order_id
is theorder_id
from your system.
Orders that have products from multiple merchants must either
all be payment-bypassed merchants
or
all Violet-based payment merchants.
If not, an UnsupportedMerchantPaymentsException
will be thrown.
To delete a merchant from the payment bypass list, you can call DELETE apps/{app_id}/configuration/payments-bypass/{merchant_id}
or simply include payment methods to the order during checkout. If a payment method is included, Violet will honor that payment method.
DELETE apps/{app_id}/configuration/payments-bypass/{merchant_id}
This API will remove the given merchant_id
from the payments bypass list for this app_id
. If the merchant doesn’t exist or isn’t present in this list, an exception will be thrown.
When Violet receives a Refund for an Order that bypassed our payments flow, we emit a notification and expect the Shopper and Merchant to be refunded by you. In order to receive notifications, please subscribe to the ORDER_REFUNDED
webhook. You are able to view refunds that come for Orders, even if the payment was handled externally, through GET orders/{order_id}/refunds
. A sample response for an external refund is as follows:
Was this page helpful?