Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
amazon-pay-async
Advanced tools
Readme
npm i amazon-pay-async
API wrapper for Amazon Pay using promises and offer defined types for Typescript moduls.
Instantiate an amazonPayment instance with the environment variable, and all required config parameters.
The AmazonPayClient
class has a public, static property called Environments
which is an enum containing four properties: Production
and Sandbox
, pass one of these in the configuration object. Use ProductionEU
and SandboxEU
for European countries.
Example:
import AmazonPayClient from 'amazon-pay-async';
var client = new AmazonPayClient({
clientId: 'Client ID'
mwsAccessKey: 'MWS Access Key',
mwsSecretKey: 'MWS Secret Key',
sellerId: 'Amazon Seller ID',
environment: AmazonPayClient.Environments.Production,
});
This module will automatically sign all requests and convert nested objects to dot notation.
Example:
await client.offAmazonPayments.refund({
AmazonCaptureId: 'Amazon capture ID',
RefundReferenceId: 'Refund Reference ID',
RefundAmount: {
Amount: 123.45,
CurrencyCode: 'USD'
}
})
Will make a call with the following parameters:
{
"AmazonCaptureId": "Amazon capture ID",
"RefundReferenceId": "Refund Reference ID",
"RefundAmount.Amount": 123.45,
"RefundAmount.CurrencyCode": "USD"
}
As the module offers pre-defined types for Typescript modules, here's a TS example:
Example:
import { IRefundRequest, IRefundResponse } from 'amazon-pay-async';
const refundResponse: IRefundResponse = await client.offAmazonPayments.refund({
AmazonCaptureId: 'Amazon capture ID',
RefundReferenceId: 'Refund Reference ID',
RefundAmount: {
Amount: 123.45,
CurrencyCode: 'USD'
}
} as IRefundRequest);
This is a mirrored version of the https://github.com/MadisonReed/amazon-payments package. For any usage information regarding version 0.x please refer for the original package.
FAQs
API wrapper for Amazon Pay using promises and defining types
The npm package amazon-pay-async receives a total of 19 weekly downloads. As such, amazon-pay-async popularity was classified as not popular.
We found that amazon-pay-async demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.