Skip to content

Commit 8d630a9

Browse files
author
Shangamesh T
committed
Amazon Pay NodeJS 2.2.1
1 parent 55120de commit 8d630a9

File tree

6 files changed

+9
-16
lines changed

6 files changed

+9
-16
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#### Version 2.2.1 - January 2022
2+
* Applied patch to address issues occurred in Version 2.2.0.
3+
**Please dont use Version 2.2.0**
4+
15
#### Version 2.2.0 - January 2022
26
* Migrated signature generating algorithm from AMZN-PAY-RSASSA-PSS to AMZN-PAY-RSASSA-PSS-V2 & increased salt length from 20 to 32
37
* Note : From this SDK version, "algorithm" need to be provided as additional field in "createCheckoutSessionConfig" while rendering Amazon Pay button.

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,6 @@ Example call to generateButtonSignature function:
384384
};
385385
const signature = testPayClient.generateButtonSignature(payload);
386386
```
387-
Note :
388-
As part of signature button integration, "algorithm" need to be provided as additional field in "createCheckoutSessionConfig" while rendering Amazon Pay button.
389-
390-
Example of "createCheckoutSessionConfig" :
391-
``` js
392-
createCheckoutSessionConfig: {
393-
payloadJSON: '{"webCheckoutDetails":{"checkoutReviewReturnUrl":"https://localhost/test/checkoutReview.html"},"storeId": "amzn1.application-oa2-client.xxxxx","scopes": ["name", "email", "phoneNumber", "billingAddress"]}',
394-
signature: 'SIGNATURE', // Signature Obtained by calling "generateButtonSignature(payload)" method
395-
algorithm: 'AMZN-PAY-RSASSA-PSS-V2' // This Parameter is mandatory
396-
}
397-
```
398387

399388
## Manual Signing (Advanced Use-Cases Only)
400389
This SDK provides the ability to help you manually sign your API requests if you want to use your own code for sending the HTTPS request over the Internet.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@amazonpay/amazon-pay-api-sdk-nodejs",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "Amazon Pay Checkout V2 Integration",
55
"main": "src/client.js",
66
"directories": {},

src/clientHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function sign(privateKey, stringToSign) {
8686
return sign.sign({
8787
key: privateKey,
8888
padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
89-
saltLength: 32
89+
saltLength: 20
9090
}, 'base64');
9191
}
9292

src/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
module.exports = {
4-
SDK_VERSION: '2.2.0',
4+
SDK_VERSION: '2.2.1',
55
API_VERSION: 'v2',
66
RETRIES: 3,
77
API_ENDPOINTS: {
@@ -17,5 +17,5 @@ module.exports = {
1717
eu: 'eu',
1818
jp: 'jp'
1919
},
20-
AMAZON_SIGNATURE_ALGORITHM: 'AMZN-PAY-RSASSA-PSS-V2'
20+
AMAZON_SIGNATURE_ALGORITHM: 'AMZN-PAY-RSASSA-PSS'
2121
};

0 commit comments

Comments
 (0)