Skip to content

Testing Amazon Pay button on localhost:  #32

@rossaddison

Description

@rossaddison

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

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions