Skip to content

Commit 0dc95af

Browse files
committed
Update 2020.03.26
1 parent 37e22de commit 0dc95af

File tree

1,479 files changed

+67736
-42002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,479 files changed

+67736
-42002
lines changed

composer.lock

Lines changed: 992 additions & 936 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/amzn/amazon-pay-sdk-php/AmazonPay/Client.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
class Client implements ClientInterface, LoggerAwareInterface
2525
{
26-
const SDK_VERSION = '3.6.0';
26+
const SDK_VERSION = '3.7.1';
2727
const MWS_VERSION = '2013-01-01';
2828
const MAX_ERROR_RETRY = 3;
2929

@@ -316,16 +316,21 @@ public function getUserInfo($accessToken)
316316

317317
// To make sure double encoding doesn't occur decode first and encode again.
318318
$accessToken = urldecode($accessToken);
319-
$url = $this->profileEndpoint . '/auth/o2/tokeninfo?access_token=' . $this->urlEncode($accessToken);
319+
$url = $this->profileEndpoint . '/auth/o2/tokeninfo';
320320

321321
$httpCurlRequest = new HttpCurl($this->config);
322+
$httpCurlRequest->setAccessToken($accessToken);
323+
$httpCurlRequest->setHttpHeader();
322324

323325
$response = $httpCurlRequest->httpGet($url);
324326
$data = json_decode($response);
325327

326328
// Ensure that the Access Token matches either the supplied Client ID *or* the supplied App ID
327329
// Web apps and Mobile apps will have different Client ID's but App ID should be the same
328330
// As long as one of these matches, from a security perspective, we have done our due diligence
331+
if (!isset($data->aud)) {
332+
throw new \Exception('The tokeninfo API call did not succeed');
333+
}
329334
if (($data->aud != $this->config['client_id']) && ($data->app_id != $this->config['app_id'])) {
330335
// The access token does not belong to us
331336
throw new \Exception('The Access Token belongs to neither your Client ID nor App ID');
@@ -361,7 +366,7 @@ private function setParametersAndPost($parameters, $fieldMappings, $requestParam
361366
}
362367

363368
// Ensure that no unexpected type coercions have happened
364-
if ($param === 'capture_now' || $param === 'confirm_now' || $param === 'inherit_shipping_address' || $param === 'request_payment_authorization') {
369+
if ($param === 'capture_now' || $param === 'confirm_now' || $param === 'inherit_shipping_address' || $param === 'request_payment_authorization' || $param === 'expect_immediate_authorization') {
365370
if (!is_bool($value)) {
366371
throw new \Exception($param . ' value ' . $value . ' is of type ' . gettype($value) . ' and should be a boolean value');
367372
}
@@ -622,7 +627,7 @@ public function getOrderReferenceDetails($requestParameters = array())
622627
* @optional requestParameters['created_end_time'] - [String] (Date/Time ISO8601) Limited to 31 days
623628
* @optional requestParameters['sort_order'] - [String] (Ascending/Descending)
624629
* @optional requestParameters['mws_auth_token'] - [String]
625-
* @optional requestParameters['status_list'] - [Array]
630+
* @optional requestParameters['order_status_list'] - [Array]
626631
*/
627632
public function listOrderReference($requestParameters = array())
628633
{
@@ -791,6 +796,7 @@ public function setOrderAttributes($requestParameters = array())
791796
* @optional requestParameters['authorization_amount'] - [String]
792797
* @optional requestParameters['currency_code'] - [String]
793798
* @optional requestParameters['mws_auth_token'] - [String]
799+
* @optional requestParameters['expect_immediate_authorization'] - [Boolean] Default value is false
794800
*/
795801
public function confirmOrderReference($requestParameters = array())
796802
{
@@ -805,7 +811,8 @@ public function confirmOrderReference($requestParameters = array())
805811
'failure_url' => 'FailureUrl',
806812
'authorization_amount' => 'AuthorizationAmount.Amount',
807813
'currency_code' => 'AuthorizationAmount.CurrencyCode',
808-
'mws_auth_token' => 'MWSAuthToken'
814+
'mws_auth_token' => 'MWSAuthToken',
815+
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
809816
);
810817

811818
if (isset($requestParameters['authorization_amount']) && !isset($requestParameters['currency_code'])) {

vendor/amzn/amazon-pay-sdk-php/AmazonPay/ClientInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public function setOrderAttributes($requestParameters = array());
156156
* @optional requestParameters['authorization_amount'] - [String]
157157
* @optional requestParameters['currency_code'] - [String]
158158
* @optional requestParameters['mws_auth_token'] - [String]
159+
* @optional requestParameters['expect_immediate_authorization'] - [Boolean] Default value is false
159160
*/
160161
public function confirmOrderReference($requestParameters = array());
161162

vendor/amzn/amazon-pay-sdk-php/AmazonPay/HttpCurl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function httpGet($url, $userAgent = null)
102102

103103
// Setting the HTTP header with the Access Token only for Getting user info
104104
if ($this->header) {
105-
$this->headerArray[] = 'Authorization: bearer ' . $this->accessToken;
105+
$this->headerArray[] = 'x-amz-access-token : ' . $this->accessToken;
106106
}
107107

108108
$response = $this->execute($ch);

vendor/amzn/amazon-pay-sdk-php/CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.7.1 - March 2021
2+
- Fixed Secuity issue - Sending access token via HTTP header instead of query string in URL for GetUserInfo API
3+
4+
3.7.0 - January 2021
5+
- Added additional attribute (expect_immediate_authorization) to ConfirmOrderReference. This value can be set to true or false (Boolean). See Amazon Pay Strong Customer Authentication (SCA) Upgrade Integration Guide for more information.
6+
17
3.6.0 - November 2019
28
- Add GetMerchantNotificationConfiguration API call
39
- Add SetMerchantNotificationConfiguration API call

vendor/amzn/amazon-pay-sdk-php/NOTICE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*-*-**-***-*****-********-*************
22
Amazon Pay SDK (PHP)
3-
Copyright 2013-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
Licensed under the Apache License, Version 2.0 (the "License");
55
*-*-**-***-*****-********-*************
66

vendor/amzn/amazon-pay-sdk-php/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ $requestParameters['notification_configuration_list'] = $notificationConfigurati
335335
// $requestParameters['notification_configuration_list'] = array('https://dev.null/ipn' => array('ALL'));
336336

337337
// if you are calling on behalf of another merhcant using delegated access, be sure to set the merchant ID and auth token:
338-
// $requestParameters['merchant_id'] = 'A3URCZVLDMDI45';
339-
// $requestParameters['mws_auth_token'] = 'amzn.mws.d6ac8f2d-6a5f-b06a-bc12-1d0dbf4ca63d';
338+
// $requestParameters['merchant_id'] = 'THE_MERCHANT_ID';
339+
// $requestParameters['mws_auth_token'] = 'THE_MWS_AUTH_TOKEN';
340340

341341
$response = $client->setMerchantNotificationConfiguration($requestParameters);
342342
if ($response->toArray()['ResponseStatus'] !== '200') {
@@ -387,6 +387,7 @@ and the amount captured by making the `capture` API call after the shipment is c
387387
| Platform ID | `platform_id` | no | Platform ID of the Solution provider |
388388
| Custom Information | `custom_information` | no | Any custom string |
389389
| MWS Auth Token | `mws_auth_token` | no | MWS Auth Token required if API call is made on behalf of the seller |
390+
| ExpectImmediateAuthorization | `expect_immediate_authorization` | no | Setting value to true, will make OrderReferenceObject to be closed automatically in case no authorization is triggered within 60 minutes |
390391

391392
```php
392393
// Create an array that will contain the parameters for the charge API call

vendor/amzn/amazon-pay-sdk-php/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "amzn/amazon-pay-sdk-php",
33
"type": "library",
44
"description": "Amazon Pay SDK (PHP)",
5-
"version": "3.6.0",
5+
"version": "3.7.1",
66
"keywords": [
77
"amazon",
88
"pay",

vendor/amzn/amazon-pay-sdk-php/tst/unit/ClientTest.php

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ public function testConfirmOrderReferenceWithAllSCA()
362362
'success_url' => 'SuccessUrl',
363363
'failure_url' => 'FailureUrl',
364364
'authorization_amount' => 'AuthorizationAmount.Amount',
365-
'currency_code' => 'AuthorizationAmount.CurrencyCode'
365+
'currency_code' => 'AuthorizationAmount.CurrencyCode',
366+
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
366367
);
367368

368369
$action = 'ConfirmOrderReference';
@@ -389,7 +390,8 @@ public function testConfirmOrderReferenceWithAllButCurrencyCodeSCA()
389390
'mws_auth_token' => 'MWSAuthToken',
390391
'success_url' => 'SuccessUrl',
391392
'failure_url' => 'FailureUrl',
392-
'authorization_amount' => 'AuthorizationAmount.Amount'
393+
'authorization_amount' => 'AuthorizationAmount.Amount',
394+
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
393395
);
394396

395397
$action = 'ConfirmOrderReference';
@@ -415,7 +417,8 @@ public function testConfirmOrderReferenceWithUrlSCA()
415417
'amazon_order_reference_id' => 'AmazonOrderReferenceId',
416418
'mws_auth_token' => 'MWSAuthToken',
417419
'success_url' => 'SuccessUrl',
418-
'failure_url' => 'FailureUrl'
420+
'failure_url' => 'FailureUrl',
421+
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
419422
);
420423

421424
$action = 'ConfirmOrderReference';
@@ -457,6 +460,33 @@ public function testConfirmOrderReferenceWithoutSCA()
457460
$this->assertEquals($apiParametersString, $expectedStringParams);
458461
}
459462

463+
/*
464+
* Test to validate ConfirmOrderReference API with ExpectImmediateAuthorization optional value as null
465+
* It is expected to accept only Boolean value (i.e true or false)
466+
*/
467+
public function testConfirmOrderReferenceWithExpectImmediateAuthorizationValueAsNull() {
468+
$client = new Client($this->configParams);
469+
$fieldMappings = array(
470+
'merchant_id' => 'SellerId',
471+
'amazon_order_reference_id' => 'AmazonOrderReferenceId',
472+
'mws_auth_token' => 'MWSAuthToken',
473+
'success_url' => 'SuccessUrl',
474+
'failure_url' => 'FailureUrl',
475+
'authorization_amount' => 'AuthorizationAmount.Amount',
476+
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
477+
);
478+
$action = 'ConfirmOrderReference';
479+
$parameters = $this->setParametersAndPost($fieldMappings, $action);
480+
$apiCallParams = $parameters['apiCallParams'];
481+
$apiCallParams['expect_immediate_authorization'] = null;
482+
try{
483+
$response = $client->confirmOrderReference($apiCallParams);
484+
}
485+
catch (\Exception $expected) {
486+
$this->assertRegExp('/should be a boolean value/i', strval($expected));
487+
}
488+
}
489+
460490
public function testCancelOrderReference()
461491
{
462492
$client = new Client($this->configParams);
@@ -1227,7 +1257,7 @@ private function setParametersAndPost($fieldMappings, $action)
12271257
$expectedParameters['Action'] = $action;
12281258

12291259
foreach ($fieldMappings as $parm => $value) {
1230-
if ($parm === 'capture_now' || $parm === 'confirm_now' || $parm === 'inherit_shipping_address' || $parm === 'request_payment_authorization') {
1260+
if ($parm === 'capture_now' || $parm === 'confirm_now' || $parm === 'inherit_shipping_address' || $parm === 'request_payment_authorization' || $parm === 'expect_immediate_authorization') {
12311261
$expectedParameters[$value] = true;
12321262
$apiCallParams[$parm] = true;
12331263
} elseif ($parm === 'order_item_categories') {

vendor/aws/aws-sdk-php/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"require": {
1919
"php": ">=5.5",
2020
"guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0",
21-
"guzzlehttp/psr7": "^1.4.1",
22-
"guzzlehttp/promises": "^1.0",
23-
"mtdowling/jmespath.php": "^2.5",
21+
"guzzlehttp/psr7": "^1.7.0",
22+
"guzzlehttp/promises": "^1.4.0",
23+
"mtdowling/jmespath.php": "^2.6",
2424
"ext-pcre": "*",
2525
"ext-json": "*",
2626
"ext-simplexml": "*"

0 commit comments

Comments
 (0)