amzn / amazon-pay-sdk-php

Amazon Pay PHP SDK

Home Page:https://pay.amazon.com/documentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When doing a $response = $client->getOrderReferenceDetails($requestParameters);

l337 opened this issue · comments

I get an null reference to AmazonOrderReferenceId when I call:
$response = $client->getOrderReferenceDetails($requestParameters);

Client.php has this mapping in the $feildMappings array:
'amazon_order_reference_id' => 'AmazonOrderReferenceId'

The example reference this (which is correct for the charge method)
$requestParameters['amazon_reference_id'] = 'amazon_reference_id';

but if you want to successfully use getOrderReferenceDetails you have to change:
references from amazon_order_reference_id to amazon_reference_id
in the getOrderReferenceDetails

Now I can succesfully get a 200 response when doing a:
$response = $client->getOrderReferenceDetails($requestParameters);
$response->toJson();

Thanks for your feedback
In the charge method,
amazon_reference_id can either accept an Order Reference ID or an Billing Agreement ID. So the naming of the key cannot be specific to say 'amazon_order_reference_id' or 'amazon_billing_agreement_id'

I have pushed the latest update wherein the amazon_order_reference_id is also taken in as a key to the charge method . Hence you can use the same stack