WePay.checkoutCapture()

Capture a checkout that was not auto captured.

If auto_capture was set to false when the checkout was created, you will need to make this call to release funds to the account. Until you make this call the money will be held by WePay and if you do not capture the funds within 14 days then the payment will be automatically cancelled or refunded. You can only make this call if the checkout is in state 'reserved'.

Usage

Hover over inputs/exits for more info.

var WePay = require('machinepack-wepay');


// Capture a checkout that was not auto captured.

WePay.checkoutCapture({

accessToken: '604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184',

checkoutId: 12345,

useProduction: false,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

accessToken required

The string access token of the user you want to capture a payment for.

'604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184'
checkoutId required

The unique ID of the checkout to be captured.

12345
useProduction

Use WePay production API - payments will be charged. Defaults to WePay staging - payments are not charged.

false

Exits

error

An unexpected error occurred.

success

OK.

{ checkout_id: 12345, state: 'captured' }