@madisonreed/amazon-payments
API wrapper for Amazon Payments
Last updated 4 years ago by madisonreedadmin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @madisonreed/amazon-payments 
SYNC missed versions from official npm registry.

Installation:

npm install amazon-payments

Usage:

Initialize the amazonPayment object with the environment variable, and all required config parameters.

The amazonPayments.Environment object contains two properties: Production and Sandbox, pass one of these in the configuration object.

Example:

var amazonPayments = require('amazon-payments');
var payment = amazonPayments.connect({
  environment: amazonPayments.Environment.Production,
  sellerId: 'Amazon Seller ID',
  mwsAccessKey: 'MWS Access Key',
  mwsSecretKey: 'MWS Secret Key',
  clientId: 'Client ID'
});

Note about request parameters

This module will automatically sign all requests and convert nested objects to dot notation.

Example:

payment.offAmazonPayments.refund({
  AmazonCaptureId: 'Amazon capture ID',
  RefundReferenceId: 'Refund Reference ID',
  RefundAmount: {
    Amount: 123.45,
    CurrencyCode: 'USD'
  }
}, function(err) {
  console.log(err);
})

Will make a call with the following parameters:

{
  "AmazonCaptureId": "Amazon capture ID",
  "RefundReferenceId": "Refund Reference ID",
  "RefundAmount.Amount": 123.45,
  "RefundAmount.CurrencyCode": "USD"
}

api.getTokenInfo(accessToken, callback)

getTokenInfo takes two parameters: accesToken and callback. More Info

callback: err, tokenInfo

Example:

payment.api.getTokenInfo('access token from button', function(err, tokenInfo) {
  console.log(tokenInfo);
});

api.getProfile(accessToken, callback)

getProfile takes two parameters: accesToken and callback. More Info

callback: err, profile

Example:

payment.api.getProfile('access token from button', function(err, profile) {
  console.log(profile);
});

offAmazonPayments.*

All the methods in the offAmazonPayments object take two parameters: params and callback. The functions are all named the same as their respective API calls, except with a lowercase first letter. More Info

Current Tags

  • 0.2.5                                ...           latest (4 years ago)

2 Versions

  • 0.2.5                                ...           4 years ago
  • 0.2.3                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |