This article shows how to handle payment capture and voiding when implementing the Capture Transaction and Void Transaction endpoints. For general information about these endpoints, see Capturing and Voiding Payments.
This article outlines the following flows:
Note: The following examples use a card payment method, but they can be applied to other payment methods.
To handle requests to create and capture transactions as separate actions:
Wix calls Create Transaction. The total amount for the payment, the credit card details, and authorizeOnly
are included in the request body as follows:
The PSP authorizes the payment and responds with an HTTP status code of 200
, and this JSON object:
The PSP sends this webhook to Submit Event:
200
, and this JSON object:
To handle requests to create and void transactions as separate actions:
Wix calls Create Transaction. The total amount for the payment, the credit card details, and authorizeOnly
are included in the request body as follows:
The PSP authorizes the payment and responds with an HTTP status code of 200
, and this JSON object:
The PSP sends this webhook to Submit Event:
200
, and this JSON object:
If Wix knows that a transaction has already been captured or voided, there's no reason to make additional calls because they return an error. However, sometimes Wix may not know the result of a previous call due to network issues, so it makes an additional call. The following flows demonstrate how a PSP should handle those cases:
This flow shows how to respond to a capture request for a transaction that has already been captured:
200
, and this JSON object:
This flow shows how to respond to a capture request for a transaction that has already been voided:
200
, and this JSON object:
This flow shows how to respond to a void request for a transaction that has already been captured:
200
, and this JSON object:
This flow shows how to respond to a void request for a transaction that has already been voided:
200
, and this JSON object: