Closed iiDestiny closed 1 year ago
@shangamesh @bjguillot thanks
Hi If you are using latest version of SDK (i.e 2.3.0) then as a part of signature button integration, "algorithm" need to be provided as additional field in "createCheckoutSessionConfig" while rendering Amazon Pay button.
Example of "createCheckoutSessionConfig" :
createCheckoutSessionConfig: {
payloadJSON: '{"webCheckoutDetails":{"checkoutReviewReturnUrl":"https://localhost/test/checkoutReview.html"},"storeId": "amzn1.application-oa2-client.xxxxx","scopes": ["name", "email", "phoneNumber", "billingAddress"]}',
signature: 'SIGNATURE', // Signature Obtained by calling "generateButtonSignature(payload)" method
algorithm: 'AMZN-PAY-RSASSA-PSS-V2' // This Parameter is mandatory
}
yea, just pulled the latest version today
Thank you for your reply, I'm going to try it
Thanks, it work
Thanks for the update
HI, I'm not sure what's going on, the code didn't change anything and suddenly it says signature mismatch again @shangamesh
Hello, Please use the following button code if you are using latest version of SDK (i.e 2.3.2)
createCheckoutSessionConfig: {
payloadJSON: '{"webCheckoutDetails":{"checkoutReviewReturnUrl":"https://localhost/test/checkoutReview.html"},"storeId": "amzn1.application-oa2-client.xxxxx","scopes": ["name", "email", "phoneNumber", "billingAddress"]}',
signature: 'SIGNATURE', // Signature Obtained by calling "generateButtonSignature(payload)" method
}
The field algorithm: 'AMZN-PAY-RSASSA-PSS-V2'
is not required. We reverted the change of having the algorithm in v 2.3.1.
Please use latest version of SDK & remove algorithm from button code. It will work
Thanks
@shangamesh Hi, sorry to bother you again. After upgrading to version 2.6.2 based on the previous SDK version 2.3.2, I followed the release instructions to include the algorithm in the client retrieval. However, I'm still experiencing a signature failure. I am quite puzzled.
After the issue with version 2.3.2 last time, there were no code changes made. Only the algorithm identifier mentioned in the version release notes was added.
@iiDestiny
I took version 2.6.2 & tested the button signature. I can conform it is working fine (i.e button is not throwing InvalidSignature error) with AMZN-PAY-RSASSA-PSS-V2
algorithm
I noticed that in $payload passed to generateButtonSignature method doesn't contain storeId
which is required field. Can you pass storeId
in payload & verify it once ?
Thank you, I suspect that caching was affecting the signature. Now it is working properly.
I have checked the documentation many times and then followed the integration guide to coding
https://developer.amazon.com/zh/docs/amazon-pay-checkout/add-the-amazon-pay-button.html
PHP
The values in my sandbox
Front-end section
Format in newwork
api response
error
Clicking the pay button always gets a signature error