Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Amazon Pay button on localhost: #32

Open
rossaddison opened this issue Dec 4, 2022 · 0 comments
Open

Testing Amazon Pay button on localhost: #32

rossaddison opened this issue Dec 4, 2022 · 0 comments

Comments

@rossaddison
Copy link

rossaddison commented Dec 4, 2022

To download the private key two methods are recommended here:

Method 1:
Using the following keys on windows 10 creates ---BEGIN OPENSSH PRIVATE KEY --- file as mentioned in the index page.

ssh-keygen -t rsa -b 2048 -f private.pem
ssh-keygen -f private.pem -e -m PKCS8 > public.pub

Method 2
Using https://sellercentral-europe.amazon.com/external-payments/amazon-pay/integration-central 'Create Api Keys', downloads the private key automatically in the left hand corner of the browser eg. AmazonPay_SANDBOX-AGQNBBAR7LO44CKBVHJWB4AB.
This file is a ---BEGIN PRIVATE KEY --- file ie. without the OPENSSH and the RSA.

I was initially getting an invalid Signature error as follows with Method 1: (Security keys have been adjusted)

image

I am now getting an invalid Login exception as follows with Method 2 thankfully using my live amazon account before I progress to the sandbox.

My question is ... when I begin hosting my website, what type of private key file ie. OPENSSH / RSA / BLANK should I use. It would appear that the ssh-keygen -t rsa -b 2048 -f private.pem is not generating a suitable file.

Under the API\Client generateButtonSignature function, I php echoed the $hashedButtonRequest variable in the controller before signing and the view output did in fact match my merchant details. So it would appear the culprit is the file that was generated by the ssh-keygen -t rsa -b 2048 -f private.pem.

After creating a test buyer on sellercentral using a different email address, I logged into payments.amazon.co.uk using this buyers email address and successfully received the following page.

image

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant