WePay.checkoutCancel()

Cancel a checkout.

This machine allows you to lookup the details of a specific checkout on WePay using the checkout_id. Response parameters marked "if available" will only show up if they have values.

Usage

Hover over inputs/exits for more info.

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


// Cancel a checkout.

WePay.checkoutCancel({

accessToken: '604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184',

checkoutId: 12345,

cancelReason: 'Product was defective. Do not want.',

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 get details for.

12345
cancelReason required

The reason the payment is being cancelled.

'Product was defective. Do not want.'
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: 'cancelled' }