Coder Social home page Coder Social logo

amazon-pay-sdk-php's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazon-pay-sdk-php's Issues

amzn/amazon-pay-sdk-php not directly installable by composer

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"
    }]

Does this work with marketplace?

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?

What is the best way to manage recurring payments

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.

InheritShippingAddress does not seem to default to true

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.

Replace file_get_contents with curl in OpenSslVerifySignature.php

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 response is an error, $status might not be defined on ResponseParser.php

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 doesn't work in version 2.x

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

Throw Exceptions for non 200 Responses

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.

Multi Currency Error

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?

Ensure that the received SNS IP address is from an Amazon AWS IP.

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.

access to undefined property aud

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 ;-)

Charge convenience method doesn't authorize - FIXED: needs to set a confirmOrder arg

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.

Different amazon response format to "SetOrderReferenceDetails" method

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, '&lt;' 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 &quot;Tilde skills: Design and Produce Text Documents, Word 2013&quot; (digital)  - 1 item(s);
book &quot;Accelerated Tilde Skills Produce Spreadsheets: Excel 2013&quot; (digital)  - 1 item(s);
book &quot;Tilde skills: Produce Desktop Published Documents, Publisher 2013&quot; (digital)  - 1 item(s);
book &quot;Tilde skills: Create Electronic Presentations, PowerPoint 2013&quot; (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 &quot;The Psychedelic Renaissance&quot; (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.

synchronous mode returns Pending

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.

Unorganized/Unclear Sample Code

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.

Error setting certificate verify locations: CAfile: ~/cacert.pem CApath: /etc/ssl/certs.

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.

Undefined variable: status

The error comes up on

AmazonPay\ResponseParser.php
line (97)

The variable "$status" needs have a default value at the beginning of the function.

Send amount on login screen

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 "Maximum number of retry attempts reached" exception produces a lot of warnings

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

Feature Request

Could you add a way to add 'custom' charges? For example above the charge amount in the email:
screenshot from 2015-07-12 20-57-53
make it so that we can have something like:

Cost: ..
Shipping: ...
Total: ...

Currently there is only the amount value we can change.

Can't settle in a production environment

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.

Full address and Name is not showing in the response of getOrderReferenceDetails

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"
}

PHP7 should be supported

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?

  • what are currently known issues? (i checked the codebase with php7cc tool and it didn't find any issues, but that doesn't necessarily mean that everything works fine)
  • when will that get fixed? timeline?
  • how can community help to have it faster?

Thanks in advance for your response.

client class not found,,

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);

Pay, A, Login type button image not found in JP sandbox mode.

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

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();

Seller Details not provided

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.

Fix Codestyle

At least convert everything to leading spaces instead of these "tabs mixins" to start with.

urldecode the access_token in GetORODetails call

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

Code sample link is invalid

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.

Ambiguous LoggerInterface

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:

  • Add an adapter-interface and an adapter for Psr\Log\LoggerInterface and also an default-adapter shipped with the SDK.
  • Remove 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

  • Publish a repository which only consists of files from the directoy /AmazonPay and /tst.

Charge method - see how the customer has payed

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.

Issue on live servers

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

release tags

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?

Use Exception subclasses or error codes

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.

Cannot get /user/profile in v3.0.0

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.

Why HttpClient implementation is limited to use Curl?

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.

client object response false.

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.

Unable to post request, underlying exception of SSL certificate problem

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.