amzn / amazon-pay-sdk-php Goto Github PK
View Code? Open in Web Editor NEWAmazon Pay PHP SDK
Home Page: https://pay.amazon.com/documentation
License: Apache License 2.0
Amazon Pay PHP SDK
Home Page: https://pay.amazon.com/documentation
License: Apache License 2.0
It seems the package rename has left composer confused - perhaps a new packagist entry is needed?
$ composer require amzn/amazon-pay-sdk-php
[InvalidArgumentException]
Could not find package amzn/amazon-pay-sdk-php at any version for your mini
mum-stability (stable). Check the package spelling or your minimum-stability
As a work around, I was able to install after adding a custom repository to let composer know where to look:
"repositories": [{
"type": "vcs",
"url": "https://github.com/amzn/amazon-pay-sdk-php.git"
}]
Well we want to build a website in which we are the a third party marketplace provider. Buyers buy goods from other sellers, and we collect about 2-3% transaction fee each time an invoice is paid. I wonder, does this amazon login-and-pay SDK handles this marketplace scenario? I do notice that there are both a merchant ID and a seller ID, so I guess these two can be different?
I was wondering what would be the best way to schedule future AuthorizeOnBillingAgreement calls for exiting billing agreements.
The simplest way that comes to mind is a cron job that queries the database daily for buyer records that need to be charged that day, list them and call AuthorizeOnBillingAgreement with an interval.
I could not find anything on the docs, the forum, stackoverflow, or the web, so I decided to make an issue here that might be of benefits to others as well.
Apologies if this issue is out of scope for this repo.
Apparently on a pay
call InheritShippingAddress
(inherit_shipping_address) gets sent as false by default (or the docs are wrong).
https://developer.amazon.com/docs/amazon-pay-api/authorizeonbillingagreement.html
The docs state the param is true by default, and the example call in this README doesn't even mention it, so unless you somehow magically know you're by default being excluded from Seller Protection promises.
Amazon hit us with a chargeback and excluded the order from Seller Protection because this library does not document that param, nor does it adhere to the default "true" value as stated in the API docs. Even though we use the Amazon address book address, the address doesn't seem to get attached to the payment unless you explicitly pass inherit_shipping_address
as true
in the pay call.
This same bug was reported and fixed in the C-Sharp SDK: amzn/amazon-pay-sdk-csharp#15
So it seems sensible to have this fixed so that it is the default so it's consistent with documentation.
Some web hosting companies disable the allow_url_fopen
PHP option. In that case the function call in line 143 of the file src/OffAmazonPaymentsNotifications/Impl/OpenSslVerifySignature.php fails.
file_get_contents
should be replaced with curl. Like so:
private function _getCertificateFromCertifcatePath($certificatePath)
{
try {
$cert = $this->curl_get_contents($certificatePath);
} catch (Exception $ex) {
throw new OffAmazonPaymentsNotifications_InvalidMessageException(
"Error with signature validation - unable to request signing ".
"certificate at " . $certificatePath, null, $ex
);
}
if ($cert === false) {
throw new OffAmazonPaymentsNotifications_InvalidMessageException(
"Error with signature validation - unable to request signing ".
"certificate at " . $certificatePath
);
}
return $cert;
}
private function curl_get_contents($requestUrl, $postdata = null) {
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // dont return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "OpenSeelVerifySignature::curl", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 3, // stop after 3redirects
);
$ch = curl_init($requestUrl);
curl_setopt_array( $ch, $options );
//echo "<pre>"; var_dump($requestUrl);
//var_dump($postdata); echo "</pre>";
if ($postdata) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
}
$content = curl_exec( $ch );
$err = curl_errno( $ch );
$errmsg = curl_error( $ch );
$header = curl_getinfo( $ch );
curl_close( $ch );
return $content;
}
If I receive an error response such as following:
<ErrorResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
<Error>
<Type>Sender</Type>
<Code>InvalidBillingAgreementId</Code>
<Message>The BillingAgreementId C01-0006795-6194664 is invalid.</Message>
</Error>
<RequestId>63c96864-68ea-4d66-897a-08e8363c43f7</RequestId>
</ErrorResponse>
The getStatus() method on ResponseParser.php might not have $status defined as $path
won't be found on the error response.
SCA upgrade is not possible for version 2.x, Hmmm...that didn't work
is always displayed.
The issue is that mappings for SuccessUrl and FailureUrl are missing in \PayWithAmazon\Client::confirmOrderReference
This would be a BC Break. But it would be nice to have just some nice Exceptions to catch containing the original response and some convince helpers for status codes etc.
Maybe this behavior could be introduced with a config flag to not break current implementations, too.
Related with #14 which I saw to late.
Hi Everyone
I'm trying to use the multi currency feature, i have a GBP account but a multi currency site, all ok when passing GBP but on EUR i get the error
The OrderReferenceId S02-2145412-7791090 has constraints CurrencyMismatch and cannot be confirmed
I'm trying
walletWidget.setPresentmentCurrency("EUR"); // ISO-4217 currency code, merchant is expected to enter valid list of currency supported by Amazon Pay.
walletWidget.bind("walletWidgetDiv");
Seems to have no effect, does anyone have a sample working code where setPresentmentCurrency is working?
From https://payments.amazon.com/documentation/apireference/201757720, section "Secure IPN processing":
You must ensure that the received SNS IP address is from an Amazon AWS IP. To do so, parse the list of AWS public IP address ranges and make sure that the received IP address is within one of those ranges.
The list of AWS public IP address ranges is available in JSON form at https://ip-ranges.amazonaws.com/ip-ranges.json. The information in this file is generated from Amazon's internal system-of-record and is authoritative. It changes several times per week and you should poll accordingly.
Merchants using Amazon Pay would benefit from an easy way to download audit reports. Much of the request preparation and response parsing logic from the payments client could be reused to enable easy report downloads. See https://github.com/ejegg/login-and-pay-with-amazon-sdk-php/tree/master for a working implementation.
If Amazon is interested in this functionality, I can rebase that work onto 3.1.0.
Is it possible to collect the billing address after authorization/capture? Needed for tax purposes.
hi!
Thank you ask them always so convenient to use.
Somehow seems url of Japan only sandbox is different.
https://github.com/amzn/login-and-pay-with-amazon-sdk-php/blob/master/PayWithAmazon/Client.php#L1550
% dig api.sandbox.amazon.co.jp +short
not found
% dig api-sandbox.amazon.co.jp +short
54.240.249.108
But it is also possible to fix the code, i wrote the issue because I thought there if be changed A record is good.
Confirmation Regards
In current version 2.1.0 we do get (on requests with old/invalid tokens):
PHP Notice: Undefined property: stdClass::$aud in [...]/vendor/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Client.php on line 306
PHP Stack trace:
...
PHP 11. PayWithAmazon\Client->getUserInfo() [...]/AmazonGateway.php:153
this is caused by Client.php not checking for errors and unconditionally accessing $data->aud:
public function getUserInfo($accessToken)
...
$response = $httpCurlRequest->httpGet($url);
$data = json_decode($response);
if ($data->aud != $this->config['client_id']) {
// The access token does not belong to us
throw new \Exception('The Access token entered is incorrect');
}
You should also catch something like this:
if (isset($data->error) && $data->error === 'invalid_token') {
throw new \Exception('The Access token entered is incorrect');
}
because in that case, $data->aud will not exist. And maybe also throw an exception if $data is empty because of json parsing errors ;-)
The confirmOrderReference function expects an 'authorization_amount' parameter.
You're setting this index for the authorize function in $authorizeParameters, but the confirmOrderReference will always return a Draft status without that parameter. If the status is "Draft", the authorize() function is never called, because of the condition in line 1428 if ($oroStatus['State'] === 'Open') {
I added this @ line 1368 and it worked fine:
$confirmParameters['authorization_amount'] = $requestParameters['charge_amount'];
Let me know if you need any more explanation.
release 2.0.2 is broken because of undefined function call of getStatus in ResponseParser.php
Hello everybody,
I'm investigating support case when user receives 500 error during checkout process.
I have found the following message in log file:
PHP Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /home/authorcloudware/public_html/vendor/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseParser.php on line 69
PHP Warning: simplexml_load_string(): HTTP/1.1 200 OK in /home/authorcloudware/public_html/vendor/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseParser.php on line 69
PHP Warning: simplexml_load_string(): ^ in /home/authorcloudware/public_html/vendor/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseParser.php on line 69
PHP Fatal error: Call to a member function addChild() on a non-object in /home/authorcloudware/public_html/vendor/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseParser.php on line 72
I started to dig into this problem. So, the first step in checkout process is send "SetOrderReferenceDetails" request. I do it, I receive response from Amazon and I call toArray() function on the received response in order to check "OrderStatus".
If you check toArray() function in ResponseParser class you will see that it calls private _simpleXmlObject method. And here is a particular line that causes problem:
$response = simplexml_load_string((string) $response['ResponseBody']);
For the problem order $response['ResponseBody'] contains:
HTTP/1.1 200 OK
Date: Fri, 13 Nov 2015 16:45:03 GMT
Server: AmazonMWS
X-Amz-Date: Fri, 13 Nov 2015 16:45:03 GMT
x-amzn-Authorization: AAA SignedHeaders=X-Amz-Date;x-amzn-ActionTrace, identity=com.amazon.aaa.MarketplacePaymentService.AndromedaControlService.amzn1.aaa.id.qhz3ylg755gkejyk5sh44qm3wy.Default/1, Signed=true, Encrypted=true, Signature=8OHYWjZ8ApH0pN409nW4qrGrBtSu138H1psENEFcySw=, Algorithm=HmacSHA256
x-amzn-ActionTrace: amzn1.tr.e2da79bd-8a25-11e5-a6ea-0a5838420000.0..@mfNis
x-mws-request-id: 340a07b0-dc8e-4f86-a0d6-113bc09bc4d6
x-mws-timestamp: 2015-11-13T16:45:02.870Z
x-mws-response-context: C7YhiTl9ytxfKxXnS3jV02ZvK0x/RJ1ejYwnsY8n/f7xgbImW57/J/7WtlczRwGWR0oQhWsLlyb6 ZgMY4b+mug==
Content-Type: text/xml
Content-Length: 1446
Vary: Accept-Encoding,User-Agent
<SetOrderReferenceDetailsResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
<SetOrderReferenceDetailsResult>
<OrderReferenceDetails>
<OrderReferenceStatus>
<State>Draft</State>
</OrderReferenceStatus>
<ExpirationTimestamp>2016-05-11T16:07:38.659Z</ExpirationTimestamp>
<SellerOrderAttributes>
<StoreName>StoreName</StoreName>
<SellerOrderId>571</SellerOrderId>
</SellerOrderAttributes>
<OrderTotal>
<CurrencyCode>USD</CurrencyCode>
<Amount>99.80</Amount>
</OrderTotal>
<ReleaseEnvironment>Live</ReleaseEnvironment>
<SellerNote>book "Tilde skills: Design and Produce Text Documents, Word 2013" (digital) - 1 item(s);
book "Accelerated Tilde Skills Produce Spreadsheets: Excel 2013" (digital) - 1 item(s);
book "Tilde skills: Produce Desktop Published Documents, Publisher 2013" (digital) - 1 item(s);
book "Tilde skills: Create Electronic Presentations, PowerPoint 2013" (digital) - 1 item(s);</SellerNote>
<AmazonOrderReferenceId>P01-5757159-5192176</AmazonOrderReferenceId>
<CreationTimestamp>2015-11-13T16:07:38.659Z</CreationTimestamp>
</OrderReferenceDetails>
</SetOrderReferenceDetailsResult>
<ResponseMetadata>
<RequestId>340a07b0-dc8e-4f86-a0d6-113bc09bc4d6</RequestId>
</ResponseMetadata>
</SetOrderReferenceDetailsResponse>
that doesn't look like a valid XML, while for another order (which go through system without any problem) $response['ResponceBody'] looks like:
<SetOrderReferenceDetailsResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
<SetOrderReferenceDetailsResult>
<OrderReferenceDetails>
<OrderReferenceStatus>
<State>Draft</State>
</OrderReferenceStatus>
<ExpirationTimestamp>2016-05-11T16:07:38.659Z</ExpirationTimestamp>
<SellerOrderAttributes>
<StoreName>StoreName</StoreName>
<SellerOrderId>573</SellerOrderId>
</SellerOrderAttributes>
<OrderTotal>
<CurrencyCode>USD</CurrencyCode>
<Amount>14.95</Amount>
</OrderTotal>
<ReleaseEnvironment>Live</ReleaseEnvironment>
<SellerNote>book "The Psychedelic Renaissance" (digital) - 1 item(s);</SellerNote>
<AmazonOrderReferenceId>P01-5757159-5192176</AmazonOrderReferenceId>
<CreationTimestamp>2015-11-13T16:07:38.659Z</CreationTimestamp>
</OrderReferenceDetails>
</SetOrderReferenceDetailsResult>
<ResponseMetadata>
<RequestId>a584e730-07fd-4d2d-9fae-5c9059c428f5</RequestId>
</ResponseMetadata>
</SetOrderReferenceDetailsResponse>
So, no HTTP headers included in response. My question is why it happens? Why there are different response format for one method? I will appreciate any help.
Regards,
Tamara.
In sandbox, calling the convenience "charge" method always returns "Pending" as AuthorizationStatus.
I set "capture_now" as true, which means to use synchronous mode.
According to the doc,
"In synchronous mode, an Authorization object cannot be in the Pending state"
So, why returns "Pending"? Is it because of the sandbox?
I haven't tried with the live yet.
The instructions provided aren't very clear. Also, all the instructions for this are in several different places. They also use different methods for doing things, so you have to jump around to figure things out, and they aren't thoroughly explained. Please fix this as it could deter developers from using your service in the future.
Hello Team,
We are getting an error while making a POST call to the endpoint i.e. "https://mws.amazonservices.com/OffAmazonPayments/2013-01-01".
Here is the stack trace:
"Array ( [url] => https://mws.amazonservices.com/OffAmazonPayments/2013-01-01 [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => 0 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) [primary_port] => 0 [local_ip] => [local_port] => 0 )"
Any help would be really appreciated.
Thanks.
The error comes up on
AmazonPay\ResponseParser.php
line (97)
The variable "$status" needs have a default value at the beginning of the function.
Hi,
Is there any possibility we can send the charge amount parameter to the login screen? And get the amount on the Authorize page?
In my case, I offering a user upgrade using amazon payment. I Integrated the amazon button on the upgrade page but when the user clicks on the Amazon payment button it redirects to the login page. How I can send the amount parameter which I need after login.?
The constructor of OffAmazonPaymentsService_Exception assumes the array passed as a parameter contains all fields. But actually when the exception is thrown only Message and StatusCode are provided.
This happens in several places.
As a result we get a lot of warnings:
E_NOTICE Undefined index: ErrorType
E_NOTICE Undefined index: RequestId
E_NOTICE Undefined index: XML
E_NOTICE Undefined index: ResponseHeaderMetadata
Possible in a test environment, why?
I make three payment site.
It is a system to settle the product of different price to each.
When I tried it in the test environment, the sales were created without any problem.
However, when I replaced the widget .js with the one in the production environment, that was not done.
Why is this happening?
The structure is such that the payment information is passed from the payment site through the shipping address and payment information widget, and through the file checkout.php.
The code described on this page is for reference when creating.
https://qiita.com/arawow/items/8d9b4b5434a48332b246
Please help me.
To the end, thank you for keeping in touch with the Japanese ugly English.
I want full selected address when the user selects any address from the address book.
Following is the response what I got when "getOrderReferenceDetails" is executed.
{
"GetOrderReferenceDetailsResult": {
"OrderReferenceDetails": {
"OrderReferenceStatus": {
"State": "Draft"
},
"Destination": {
"DestinationType": "Physical",
"PhysicalDestination": {
"StateOrRegion": "Maharashtra",
"City": "Pune",
"CountryCode": "IN",
"PostalCode": "411057"
}
},
"ExpirationTimestamp": "2018-01-03T11:27:29.805Z",
"IdList": {
},
"SellerOrderAttributes": {
"StoreName": "ZACK ACADEMY"
},
"OrderTotal": {
"CurrencyCode": "USD",
"Amount": "253.98"
},
"ReleaseEnvironment": "Sandbox",
"SellerNote": "12-31-2020 - LEED Green Associate Exam Prep Online Anytime - Online, Live",
"AmazonOrderReferenceId": "S01-4810502-0586824",
"CreationTimestamp": "2017-07-07T11:27:29.805Z",
"RequestPaymentAuthorization": "false"
}
},
"ResponseMetadata": {
"RequestId": "86c8e015-a182-4eca-b86f-b6c799ad6115"
},
"ResponseStatus": "200"
}
People will be more & more interested in PHP7 support (I believe there's no need to mention the reasons/benefits).
Would it be possible to update us about PHP7 support matter here?
php7cc
tool and it didn't find any issues, but that doesn't necessarily mean that everything works fine)Thanks in advance for your response.
Please help me to fix this error in joomla..
i include class.php file and call that class but it giving me error about class not found.
if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
require_once (JPATH_ROOT.DS.'components'.DS.'com_eshop'.DS.'plugins'.DS.'payment'.DS.'AmazonPay'.DS.'Client.php');
$config = array(
'merchant_id' => 'YOUR_MERCHANT_ID',
'access_key' => 'YOUR_ACCESS_KEY',
'secret_key' => 'YOUR_SECRET_KEY',
'client_id' => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
'region' => 'REGION',
'sandbox' => true);
$client = new Client($config);
// Also you can set the sandbox variable in the config() array of the Client class by
$client->setSandbox(true);
Hi,
the charge method could also be used for convenience in case we see a soft decline (Order is suspenden => do not to a set call but do confirm and auth).
https://github.com/amzn/login-and-pay-with-amazon-sdk-php/blob/cbe6c69c0499d6b759b1dd468b302e3238068582/PayWithAmazon/Client.php#L1189
This will ease up the remedy workflow for merchants using this method.
Best wishes
Daniel
You may confirm this from following urls-
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();
I want to write a unit test for authorization and billing agreement. Is there any way to get a valid access_token without using a browser?
I testet the order process about hundred times and I can not find out why sometimes the seller details are not provided in Amazon Seller Central - Payment Details.
What could be the reason why sometimes the seller details are empty (not provided)? I am using the same code without changes.
Is this a browser cache problem? If so how to solve it?
I also found out that after the buyer loggs in and the shipping addresses and the payments methods are shown (for selection) after 3 seconds the payments methods are loaded again (you can see flash it).
Is this reloading the reason why sometimes the seller details are not provided in seller central?
I have 4 different test accounts for testing payments. I login with first acount and test the payment, then login with next account and test payment. Is this a probem?
This also happens in the demo example SampleCartDemo - OneTimePayments. Using the example code seller details are not provided every time.
What else could be a reason why seller details are not provided (the sourcecode is always the same):
The session variables? The access token? What else? How to solve it?
Thank you.
At least convert everything to leading spaces instead of these "tabs mixins" to start with.
Hi Shravan,
we just encountered a situation where the API told us, that the access_token is not a valid AddressConstenToken.
The cause was that we extracted the value with $_REQUEST['access_token'] and simply passed it on to the call.
The format was ATza%7d... instead of Atza|..., so the call failed. A urldecode solved the problem.
Could you please add a check, so that the value can be passed in and the SDK takes care about the rest?
Best wishes
Daniel
Link to a sample integration demo https://amzn.github.io/login-and-pay-with-amazon-sdk-samples/
is either invalid or page is unavailable for some reason.
Just would like to point out that the directory tree in your README.md is a wee bit out of sync. Nothing critical but easy to fix.
The SDK ships it's own version of Psr\Log\LoggerInterface
which causes some IDEs (like PHPStorm) to remark an ambiguity when composer is used to install the real Psr\Log\LoggerInterface
which is available twice then.
Currently, I have to fork this SDK and remove the Psr\Log\LoggerInterface
to get rid of that remark.
I see the following solution:
Psr\Log\LoggerInterface
and also an default-adapter shipped with the SDK.Psr\Log\LoggerInterface
-Files from the project and depend on composer alone. There is currently no implementation other than NullLogger
shipped with the SDK so the interface alone makes not much sense. The interface-typehint will work without the interface-files. Using use
and typehinting don't require the actual interface
to be present.OR
/AmazonPay
and /tst
.How can I see which charge method the customer selected to buy my product/service?
I want to see it in my seller central.
And are there any API functions calls to find you which charge method the customer used?
I want to find out how many customer pay with creditcard (and which creditcard: mastercard, Visa, ...) and how many pay with direct debit / debit transfair.
Thank you.
i configures the Paywith amazon on local and it work fines while moving to live server it dosent work on live server.
server have PHP Version 5.3.29
cURL Information 7.38.0 enabled
when i can the Apicalls/getdetails.php nothing returns it should return the ->GetOrderReferenceDetails ,
it looks the class client is not Instantiate on live server what could be problem please guide me.
Regards
can you pls use tags so we can stick to versions and not risk using a version with a breaking change... noone likes breaking payments,
just dont reuse the same tag
how do you not this for amazon, this is an official library right?
At https://packagist.org/packages/amzn/login-and-pay-with-amazon-sdk-php , v1.0 still points to rev 3bf17e8 from back in April. Please update it to point to 'removed unused remaining IPN fields' so users with the default version installed don't get 'undefined index IsSample' errors.
Users need a better way to determine error categories than parsing error messages. One good solution would be problem-specific Exception types, such as BadMethodCallException for missing parameters or a hypothetical PayWithAmazon\BadSignatureException for an improperly-signed incoming IPN message. Alternatively, the SDK could define a set of integer constants to use as error codes.
Authorization: bearer header added by HttpCurl::httpGet() is overwritten by HttpCurl::execute() method. As a result, attempts to get /user/profile detail end of with a 400 / malformed request result.
Pull request to follow.
Hi today in my PhpStorm suggestion i read a notice related to namespace "Psr\Log" is duplicated.
investigating i see that this library internally implement this standard.
Can we switch to https://github.com/php-fig/log implementation?
Nowadays, we have a variety of HTTP client implementations in the PHP world, and nothing seems to rely on the specific curl's feature found in HttpCurlInterface
, so I suppose that we can simply have just an interface like HttpClientInterface
instead of the curl-limited interface.
On GetDetails.php where the client object created by this code:
$client = new AmazonPay\Client($amazonpay_config);
it gives {'success':false} in response.
PS: I included amazon-pay.phar file and also added configuration for Amazon seller central keys.
Hi,
I have integrated the login with the amazonPaymentButton like shown at https://amzn.github.io/amazon-pay-sdk-samples/simple.html
After the login is successfull it retrieves the parameters access_token, token_type, expires_in and scope
Now at first I want to simply get the userinfo back.
I try it that way:
$config = array(
'merchant_id' => $amazonMerchantID,
'access_key' => $amazonAccessKey,
'secret_key' => $amazonSecretKey,
'client_id' => $amazonClientID,
'region' => 'de',
'sandbox' => true
);
$client = new Client($this->configParams);
// Also you can set the sandbox variable in the config() array of the Client class by
$client->setSandbox(true);
$userInfo = $client->getUserInfo($access_token);
But then I'm getting the following error:
Fatal error: Uncaught Exception: Unable to post request, underlying exception of SSL certificate problem: unable to get local issuer certificate in ...\includes\vendor\amzn\amazon-pay-sdk-php\AmazonPay\HttpCurl.php on line
I'm testing in my localhost. So I have no SSL.
But in the amazon documentation they said, that I don't need a https url when I'm develop at localhost.
So, what am I doing wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.