WePay.checkoutFind()

Search for checkouts associated with an account. Returns an array of matching checkouts.

An array of checkouts matching the search parameters. Each element of the array will include the same data as returned from the Create Checkout machine.

Usage

Hover over inputs/exits for more info.

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


// Search for checkouts associated with an account. Returns an array of matching checkouts.

WePay.checkoutFind({

accessToken: '604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184',

accountId: 1548718026,

start: 10,

limit: 25,

referenceId: '123abc',

state: 'active',

preapprovalId: 123,

startTime: 1209600,

endTime: 1209600,

sortOrder: 'DESC',

shippingFee: 2.99,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

accessToken required

The string access token of the user accepting the checkout payment.

'604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184'
accountId required

The unique ID of the account you want to create a checkout for.

1548718026
start

The start position for your search (default 0).

10
limit

The maximum number of returned entries (default 50).

25
referenceId

The unique reference id of the checkout (set by Create Checkout machine).

'123abc'
state

What state the checkout is in.

'active'
preapprovalId

The ID of the preapproval that was used to create the checkout. Useful if you want to look up all of the payments for an auto_recurring preapproval.

123
startTime

All checkouts after a given unix timestamp.

1209600
endTime

All checkouts before a given unix timestamp.

1209600
sortOrder

Sort the results of the search by time created. Use "DESC" for most recent to least recent. Use "ASC" for least recent to most recent. Defaults to "DESC".

'DESC'
shippingFee

All checkouts that have the given shipping fee.

2.99

Exits

error

An unexpected error occurred.

success

OK.

[ { checkout_id: 513220415,
    account_id: 1548718026,
    type: 'donation',
    short_description: 'test payment',
    currency: 'USD',
    amount: 20,
    state: 'captured',
    soft_descriptor: 'WPY*Wolverine',
    auto_capture: true,
    create_time: 1439582902,
    delivery_type: 'point_of_sale',
    gross: 23.96,
    long_description: 'This is a test payment.',
    reference_id: '123abc',
    callback_uri: 'http://www.example.com',
    fee: { app_fee: 1, fee_payer: 'payer', processing_fee: 0.96 },
    chargeback: 
     { amount_charged_back: 0,
       dispute_uri: 'http://wepay.com/dispute/payer_create/148/81bdda6feea880d5d586' },
    refund: { amount_refunded: 0, refund_reason: 'null' },
    hosted_checkout: 
     { checkout_uri: 'http://wepay.com/api/iframe/513220415/8a8d959e/api_checkout?iframe=1',
       redirect_uri: 'http://www.test.com',
       shipping_fee: 2,
       require_shipping: true,
       shipping_address: 
        { name: 'Test Smith',
          address1: 'Main Street',
          address2: '',
          city: 'Sunnyvale',
          country: 'US',
          state: 'CA',
          zip: '94085' },
       theme_object: 
        { theme_id: 21146702,
          name: 'test',
          primary_color: 'ffffff',
          secondary_color: '000000',
          background_color: 'ffffff',
          button_color: '000000' },
       mode: 'iframe' },
    payer: 
     { email: 'test@test.com',
       name: 'Test Smith',
       home_address: 'null' },
    npo_information: 'null',
    payment_error: 'null' } ]