Payment Transactions
A PaymentTransaction
in Violet is an object that represents the intent to collect payment from a customer for a specific Order, tracks the lifecycle of the payment process, and provides you with any specific payment information you may need on your end for payment processing. PaymentTransaction
s are automatically generated when Orders are created and are visible are a part of the Order response.
When an Order is created, if you are using Violet as your payment orchestrator, the PaymentTransaction
object indicates information such as the following:
- The unique identifier of the Order that this payment transaction is associated with.
- Unique identifiers for the underlying Bags that this payment transaction is associated with.
- Amount and currency that the shopper will be charged
- Underlying payment provider being used to process the payment and related payouts. For example,
STRIPE
. - Payment provider specific transaction data, such as transaction and payment method identifiers in the payment provider system. This comes back as a part of the
metadata
field and may differ based on underlying payment provider. - Payment statuses associated with the order.
- Errors, if any, associated with the payment transaction.
Flexible Payment and Transfer Strategies
Violet offers flexible options to implement more precise and tailored payment strategies. The PaymentTransaction
model exposes the capture_method
and transfer_method
applied to the Order. This can be set at either the Channel or Merchant level.
- Capture Method — This defines how the shopper’s payment method is charged. Available options are
AUTOMATIC
,EXTERNAL
andCUSTOM
.- Automatic — Violet generates a pending charge on the shopper’s payment method and automatically captures it once the order is successfully submitted.
- External — The channel manages all aspects of fund capture from the shopper. Violet does not take any action with Stripe to charge the shopper in this scenario and assumes payment has been captured directly by you.
- Custom — Violet creates a pending charge on the shopper’s payment method but will only capture funds when triggered separately by the channel. This setup is ideal if you want the shopper to be charged once specific conditions have been met. For example, capture funds only after the merchant fulfills the order. (Support for
CUSTOM
capture will be released in a future iteration of this feature. Timing TBD.)
- Transfer Method — This determines how Merchants receive funds for each order placed through Violet. Available options are
AUTOMATIC
,EXTERNAL
andCUSTOM
.- Automatic — Violet generates and processes the transfer of funds to Merchants automatically as part of each order submission, ensuring merchants are paid in an automated fashion.
- External — The Channel fully manages Merchant transfers and payouts for orders placed through Violet. Violet does not generate any transfer, distribution or payout records for bags and orders associated with these Merchants.
- Custom — Violet creates Distribution records for Merchants but only transfers funds when prompted by the channel. While merchants can view their pending Distributions in the Merchant Dashboard, they will not receive funds until the channel initiates the transfer of funds. (APIs for
CUSTOM
transfer initiation will be launched on Nov 18.)
The capture_status
field on the PaymentTransaction
indicates the current stage of the payment capture process for this Order. It progresses through the following statuses:
Requires Payment Method
A Payment Transaction Capture Status is in the REQUIRES_PAYMENT_METHOD
state when it is first created and doesn’t have a payment method. An Order cannot be submitted if a payment method has not been added.
Requires Authorization
A Payment Transaction Capture Status is in the REQUIRES_AUTHORIZATION
state when it has a payment method that has not been authorized. Authorization verifies that funds are available on the attached payment method and places a hold.
Requires Action
A Payment Transaction Capture Status is in the REQUIRES_ACTION
state when the payment method on the payment transaction requires additional steps, such as 3D secure. Not all payment transactions end up in this state.
Authorized
A Payment Transaction Capture Status is in the AUTHORIZED
state when the payment method attached to this payment transaction has been authorized. Once a payment method has been authorized, the price of a cart cannot change.
Captured
A Payment Transaction Capture Status is in the CAPTURED
state when the payment method attached to this payment transaction has been captured and the shopper has been charged. This state denotes a completed Order.
Failed
A Payment Transaction Capture Status is in the FAILED
state when making a call to authorize or settle the payment method attached to this payment transaction, the payment provider responded with an error that cannot be reversed.
Refunded
A Payment Transaction Capture Status is in the REFUNDED
state if a refund comes in for a Bag post Order submission and the full amount is refunded to the shopper.
Partially Refunded
A Payment Transaction Capture Status is in the PARTIALLY_REFUNDED
state if a refund comes in for a Bag post Order submission and only a partial amount is refunded to the shopper.
Bypassed
A Payment Transaction Capture Status is in the BYPASSED
state if Violet is not handling charging the shopper for this Order. This status is only present when capture_method
is marked as EXTERNAL
.
The transfer_status
field on the PaymentTransaction
indicates the current state of fund transfers to the associated parties in this Order, including channel commissions and any transfers to the Merchant. It progresses through the following statuses:
Pending
A Payment Transaction Transfer Status is in the PENDING
state when transfers to associated parties have not been initiated.
Sent
A Payment Transaction Transfer Status is in the SENT
state once all funds have been sent to the channel and merchant, post order submission.
Failed
A Payment Transaction Transfer Status is in the FAILED
state if Violet is unable to transfer funds to the Merchant during Checkout. This could occur if the merchant has not set up a payout account, or if the payout account is not enabled for fund transfer.
Partially Reversed
A Payment Transaction Transfer Status is in the PARTIALLY_REVERSED
state if a partial refund has been processed for this Order. This state denotes that funds originally sent as a part of Order placement have been partially reversed.
Reversed
A Payment Transaction Transfer Status is in the REVERSED
state if a full refund has been processed for this Order. This state denotes that funds originally sent as a part of Order placement have all been reversed.
Bypassed
A Payment Transaction Transfer Status is in the BYPASSED
state if Violet is not handling fund transfer to the channel or merchant. This status is only present when transfer_method
is marked as EXTERNAL
.
The following snippet illustrates how Payment Transactions appear as a part of the Order response.
Was this page helpful?