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.
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?