npm install @madisonreed/amazon-payments
Initialize the amazonPayment object with the environment variable, and all required config parameters.
amazonPayments.Environment object contains two properties:
Sandbox, pass one of these in the configuration object. Use
SandboxEU for European countries.
var amazonPayments = ;var payment = amazonPayments;
Note about request parameters
This module will automatically sign all requests and convert nested objects to dot notation.
Will make a call with the following parameters:
getTokenInfo takes two parameters: accesToken and callback. More Info
callback: err, tokenInfo
getProfile takes two parameters: accesToken and callback. More Info
callback: err, profile
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
SNS Response handling
Version 0.1.2 added SNS response handling for dealing with SNS messages. This also includes support for IPN endpoints. This will check the signature and attempt to parse any XML within IPN requests, if the message is not JSON it will return the raw message data, otherwise it will be the parsed response.