Sample Capture and Void Flows

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.

Requests to create and capture a transaction

To handle requests to create and capture transactions as separate actions:

Step 1 | Requests to create a transaction

  1. Wix calls Create Transaction. The total amount for the payment, the credit card details, and authorizeOnly are included in the request body as follows:

    Copy
  2. The PSP authorizes the payment and responds with an HTTP status code of 200, and this JSON object:

    Copy
  3. The PSP sends this webhook to Submit Event:

    Copy

Step 2 | Requests to capture a transaction

  1. Wix calls Capture Transaction. The total amount for the payment is included in the request body as follows:
    Copy
  2. The PSP captures the payment and responds with an HTTP status code of 200, and this JSON object:
    Copy
  3. The PSP sends this webhook to Submit Event:
    Copy

Requests to create and void a transaction

To handle requests to create and void transactions as separate actions:

Step 1 | Requests to create a transaction

  1. Wix calls Create Transaction. The total amount for the payment, the credit card details, and authorizeOnly are included in the request body as follows:

    Copy
  2. The PSP authorizes the payment and responds with an HTTP status code of 200, and this JSON object:

    Copy
  3. The PSP sends this webhook to Submit Event:

    Copy

Step 2 | Requests to void a transaction

  1. Wix calls Void Transaction. The total amount for the payment is included in the request body as follows:
    Copy
  2. The PSP voids the payment and responds with an HTTP status code of 200, and this JSON object:
    Copy
  3. The PSP sends this webhook to Submit Event:
    Copy

Requests to capture or void an already captured or voided transaction

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:

Capture requests for an already captured transaction

This flow shows how to respond to a capture request for a transaction that has already been captured:

  1. Wix calls Capture Transaction. The total amount for the payment is included in the request body as follows:
    Copy
  2. The PSP captures the payment and responds with an HTTP status code of 200, and this JSON object:
    Copy
  3. The PSP sends this webhook to Submit Event:
    Copy

Capture requests for an already voided transaction

This flow shows how to respond to a capture request for a transaction that has already been voided:

  1. Wix calls Capture Transaction. The total amount for the payment is included in the request body as follows:
    Copy
  2. The PSP captures the payment and responds with an HTTP status code of 200, and this JSON object:
    Copy
  3. The PSP sends this webhook to Submit Event:
    Copy

Void requests for an already captured transaction

This flow shows how to respond to a void request for a transaction that has already been captured:

  1. Wix calls Void Transaction. The total amount for the payment is included in the request body as follows:
    Copy
  2. The PSP voids the payment and responds with an HTTP status code of 200, and this JSON object:
    Copy
  3. The PSP sends this webhook to Submit Event:
    Copy

Void requests for an already voided transaction

This flow shows how to respond to a void request for a transaction that has already been voided:

  1. Wix calls Void Transaction. The total amount for the payment is included in the request body as follows:
    Copy
  2. The PSP voids the payment and responds with an HTTP status code of 200, and this JSON object:
    Copy
  3. The PSP sends this webhook to Submit Event:
    Copy
Did this help?