Skip to content

Commit

Permalink
Update 2020.03.26
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagosampaio committed Mar 26, 2021
1 parent 37e22de commit 0dc95af
Show file tree
Hide file tree
Showing 1,479 changed files with 67,736 additions and 42,002 deletions.
1,928 changes: 992 additions & 936 deletions composer.lock

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions vendor/amzn/amazon-pay-sdk-php/AmazonPay/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class Client implements ClientInterface, LoggerAwareInterface
{
const SDK_VERSION = '3.6.0';
const SDK_VERSION = '3.7.1';
const MWS_VERSION = '2013-01-01';
const MAX_ERROR_RETRY = 3;

Expand Down Expand Up @@ -316,16 +316,21 @@ public function getUserInfo($accessToken)

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

$httpCurlRequest = new HttpCurl($this->config);
$httpCurlRequest->setAccessToken($accessToken);
$httpCurlRequest->setHttpHeader();

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

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

// Ensure that no unexpected type coercions have happened
if ($param === 'capture_now' || $param === 'confirm_now' || $param === 'inherit_shipping_address' || $param === 'request_payment_authorization') {
if ($param === 'capture_now' || $param === 'confirm_now' || $param === 'inherit_shipping_address' || $param === 'request_payment_authorization' || $param === 'expect_immediate_authorization') {
if (!is_bool($value)) {
throw new \Exception($param . ' value ' . $value . ' is of type ' . gettype($value) . ' and should be a boolean value');
}
Expand Down Expand Up @@ -622,7 +627,7 @@ public function getOrderReferenceDetails($requestParameters = array())
* @optional requestParameters['created_end_time'] - [String] (Date/Time ISO8601) Limited to 31 days
* @optional requestParameters['sort_order'] - [String] (Ascending/Descending)
* @optional requestParameters['mws_auth_token'] - [String]
* @optional requestParameters['status_list'] - [Array]
* @optional requestParameters['order_status_list'] - [Array]
*/
public function listOrderReference($requestParameters = array())
{
Expand Down Expand Up @@ -791,6 +796,7 @@ public function setOrderAttributes($requestParameters = array())
* @optional requestParameters['authorization_amount'] - [String]
* @optional requestParameters['currency_code'] - [String]
* @optional requestParameters['mws_auth_token'] - [String]
* @optional requestParameters['expect_immediate_authorization'] - [Boolean] Default value is false
*/
public function confirmOrderReference($requestParameters = array())
{
Expand All @@ -805,7 +811,8 @@ public function confirmOrderReference($requestParameters = array())
'failure_url' => 'FailureUrl',
'authorization_amount' => 'AuthorizationAmount.Amount',
'currency_code' => 'AuthorizationAmount.CurrencyCode',
'mws_auth_token' => 'MWSAuthToken'
'mws_auth_token' => 'MWSAuthToken',
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
);

if (isset($requestParameters['authorization_amount']) && !isset($requestParameters['currency_code'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public function setOrderAttributes($requestParameters = array());
* @optional requestParameters['authorization_amount'] - [String]
* @optional requestParameters['currency_code'] - [String]
* @optional requestParameters['mws_auth_token'] - [String]
* @optional requestParameters['expect_immediate_authorization'] - [Boolean] Default value is false
*/
public function confirmOrderReference($requestParameters = array());

Expand Down
2 changes: 1 addition & 1 deletion vendor/amzn/amazon-pay-sdk-php/AmazonPay/HttpCurl.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function httpGet($url, $userAgent = null)

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

$response = $this->execute($ch);
Expand Down
6 changes: 6 additions & 0 deletions vendor/amzn/amazon-pay-sdk-php/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.7.1 - March 2021
- Fixed Secuity issue - Sending access token via HTTP header instead of query string in URL for GetUserInfo API

3.7.0 - January 2021
- 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.

3.6.0 - November 2019
- Add GetMerchantNotificationConfiguration API call
- Add SetMerchantNotificationConfiguration API call
Expand Down
2 changes: 1 addition & 1 deletion vendor/amzn/amazon-pay-sdk-php/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*-*-**-***-*****-********-*************
Amazon Pay SDK (PHP)
Copyright 2013-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
*-*-**-***-*****-********-*************

Expand Down
5 changes: 3 additions & 2 deletions vendor/amzn/amazon-pay-sdk-php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ $requestParameters['notification_configuration_list'] = $notificationConfigurati
// $requestParameters['notification_configuration_list'] = array('https://dev.null/ipn' => array('ALL'));

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

$response = $client->setMerchantNotificationConfiguration($requestParameters);
if ($response->toArray()['ResponseStatus'] !== '200') {
Expand Down Expand Up @@ -387,6 +387,7 @@ and the amount captured by making the `capture` API call after the shipment is c
| Platform ID | `platform_id` | no | Platform ID of the Solution provider |
| Custom Information | `custom_information` | no | Any custom string |
| MWS Auth Token | `mws_auth_token` | no | MWS Auth Token required if API call is made on behalf of the seller |
| 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 |

```php
// Create an array that will contain the parameters for the charge API call
Expand Down
2 changes: 1 addition & 1 deletion vendor/amzn/amazon-pay-sdk-php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "amzn/amazon-pay-sdk-php",
"type": "library",
"description": "Amazon Pay SDK (PHP)",
"version": "3.6.0",
"version": "3.7.1",
"keywords": [
"amazon",
"pay",
Expand Down
38 changes: 34 additions & 4 deletions vendor/amzn/amazon-pay-sdk-php/tst/unit/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ public function testConfirmOrderReferenceWithAllSCA()
'success_url' => 'SuccessUrl',
'failure_url' => 'FailureUrl',
'authorization_amount' => 'AuthorizationAmount.Amount',
'currency_code' => 'AuthorizationAmount.CurrencyCode'
'currency_code' => 'AuthorizationAmount.CurrencyCode',
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
);

$action = 'ConfirmOrderReference';
Expand All @@ -389,7 +390,8 @@ public function testConfirmOrderReferenceWithAllButCurrencyCodeSCA()
'mws_auth_token' => 'MWSAuthToken',
'success_url' => 'SuccessUrl',
'failure_url' => 'FailureUrl',
'authorization_amount' => 'AuthorizationAmount.Amount'
'authorization_amount' => 'AuthorizationAmount.Amount',
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
);

$action = 'ConfirmOrderReference';
Expand All @@ -415,7 +417,8 @@ public function testConfirmOrderReferenceWithUrlSCA()
'amazon_order_reference_id' => 'AmazonOrderReferenceId',
'mws_auth_token' => 'MWSAuthToken',
'success_url' => 'SuccessUrl',
'failure_url' => 'FailureUrl'
'failure_url' => 'FailureUrl',
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
);

$action = 'ConfirmOrderReference';
Expand Down Expand Up @@ -457,6 +460,33 @@ public function testConfirmOrderReferenceWithoutSCA()
$this->assertEquals($apiParametersString, $expectedStringParams);
}

/*
* Test to validate ConfirmOrderReference API with ExpectImmediateAuthorization optional value as null
* It is expected to accept only Boolean value (i.e true or false)
*/
public function testConfirmOrderReferenceWithExpectImmediateAuthorizationValueAsNull() {
$client = new Client($this->configParams);
$fieldMappings = array(
'merchant_id' => 'SellerId',
'amazon_order_reference_id' => 'AmazonOrderReferenceId',
'mws_auth_token' => 'MWSAuthToken',
'success_url' => 'SuccessUrl',
'failure_url' => 'FailureUrl',
'authorization_amount' => 'AuthorizationAmount.Amount',
'expect_immediate_authorization' => 'ExpectImmediateAuthorization'
);
$action = 'ConfirmOrderReference';
$parameters = $this->setParametersAndPost($fieldMappings, $action);
$apiCallParams = $parameters['apiCallParams'];
$apiCallParams['expect_immediate_authorization'] = null;
try{
$response = $client->confirmOrderReference($apiCallParams);
}
catch (\Exception $expected) {
$this->assertRegExp('/should be a boolean value/i', strval($expected));
}
}

public function testCancelOrderReference()
{
$client = new Client($this->configParams);
Expand Down Expand Up @@ -1227,7 +1257,7 @@ private function setParametersAndPost($fieldMappings, $action)
$expectedParameters['Action'] = $action;

foreach ($fieldMappings as $parm => $value) {
if ($parm === 'capture_now' || $parm === 'confirm_now' || $parm === 'inherit_shipping_address' || $parm === 'request_payment_authorization') {
if ($parm === 'capture_now' || $parm === 'confirm_now' || $parm === 'inherit_shipping_address' || $parm === 'request_payment_authorization' || $parm === 'expect_immediate_authorization') {
$expectedParameters[$value] = true;
$apiCallParams[$parm] = true;
} elseif ($parm === 'order_item_categories') {
Expand Down
6 changes: 3 additions & 3 deletions vendor/aws/aws-sdk-php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"require": {
"php": ">=5.5",
"guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0",
"guzzlehttp/psr7": "^1.4.1",
"guzzlehttp/promises": "^1.0",
"mtdowling/jmespath.php": "^2.5",
"guzzlehttp/psr7": "^1.7.0",
"guzzlehttp/promises": "^1.4.0",
"mtdowling/jmespath.php": "^2.6",
"ext-pcre": "*",
"ext-json": "*",
"ext-simplexml": "*"
Expand Down
10 changes: 10 additions & 0 deletions vendor/aws/aws-sdk-php/src/AccessAnalyzer/AccessAnalyzerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* This client is used to interact with the **Access Analyzer** service.
* @method \Aws\Result applyArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise applyArchiveRuleAsync(array $args = [])
* @method \Aws\Result createAccessPreview(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAccessPreviewAsync(array $args = [])
* @method \Aws\Result createAnalyzer(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAnalyzerAsync(array $args = [])
* @method \Aws\Result createArchiveRule(array $args = [])
Expand All @@ -15,6 +17,8 @@
* @method \GuzzleHttp\Promise\Promise deleteAnalyzerAsync(array $args = [])
* @method \Aws\Result deleteArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteArchiveRuleAsync(array $args = [])
* @method \Aws\Result getAccessPreview(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccessPreviewAsync(array $args = [])
* @method \Aws\Result getAnalyzedResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAnalyzedResourceAsync(array $args = [])
* @method \Aws\Result getAnalyzer(array $args = [])
Expand All @@ -23,6 +27,10 @@
* @method \GuzzleHttp\Promise\Promise getArchiveRuleAsync(array $args = [])
* @method \Aws\Result getFinding(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFindingAsync(array $args = [])
* @method \Aws\Result listAccessPreviewFindings(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAccessPreviewFindingsAsync(array $args = [])
* @method \Aws\Result listAccessPreviews(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAccessPreviewsAsync(array $args = [])
* @method \Aws\Result listAnalyzedResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAnalyzedResourcesAsync(array $args = [])
* @method \Aws\Result listAnalyzers(array $args = [])
Expand All @@ -43,5 +51,7 @@
* @method \GuzzleHttp\Promise\Promise updateArchiveRuleAsync(array $args = [])
* @method \Aws\Result updateFindings(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFindingsAsync(array $args = [])
* @method \Aws\Result validatePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise validatePolicyAsync(array $args = [])
*/
class AccessAnalyzerClient extends AwsClient {}
4 changes: 4 additions & 0 deletions vendor/aws/aws-sdk-php/src/Acm/AcmClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* @method \GuzzleHttp\Promise\Promise describeCertificateAsync(array $args = [])
* @method \Aws\Result exportCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise exportCertificateAsync(array $args = [])
* @method \Aws\Result getAccountConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountConfigurationAsync(array $args = [])
* @method \Aws\Result getCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCertificateAsync(array $args = [])
* @method \Aws\Result importCertificate(array $args = [])
Expand All @@ -22,6 +24,8 @@
* @method \GuzzleHttp\Promise\Promise listCertificatesAsync(array $args = [])
* @method \Aws\Result listTagsForCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForCertificateAsync(array $args = [])
* @method \Aws\Result putAccountConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putAccountConfigurationAsync(array $args = [])
* @method \Aws\Result removeTagsFromCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise removeTagsFromCertificateAsync(array $args = [])
* @method \Aws\Result renewCertificate(array $args = [])
Expand Down
4 changes: 4 additions & 0 deletions vendor/aws/aws-sdk-php/src/Arn/ArnParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Aws\Arn;

use Aws\Arn\S3\AccessPointArn as S3AccessPointArn;
use Aws\Arn\ObjectLambdaAccessPointArn;
use Aws\Arn\S3\OutpostsBucketArn;
use Aws\Arn\S3\RegionalBucketArn;
use Aws\Arn\S3\OutpostsAccessPointArn;
Expand Down Expand Up @@ -35,6 +36,9 @@ public static function isArn($string)
public static function parse($string)
{
$data = Arn::parse($string);
if ($data['service'] === 's3-object-lambda') {
return new ObjectLambdaAccessPointArn($string);
}
$resource = self::explodeResourceComponent($data['resource']);
if ($resource[0] === 'outpost') {
if (isset($resource[2]) && $resource[2] === 'bucket') {
Expand Down
35 changes: 35 additions & 0 deletions vendor/aws/aws-sdk-php/src/Arn/ObjectLambdaAccessPointArn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
namespace Aws\Arn;

/**
* This class represents an S3 Object bucket ARN, which is in the
* following format:
*
* @internal
*/
class ObjectLambdaAccessPointArn extends AccessPointArn
{
/**
* Parses a string into an associative array of components that represent
* a ObjectLambdaAccessPointArn
*
* @param $string
* @return array
*/
public static function parse($string)
{
$data = parent::parse($string);
return parent::parseResourceTypeAndId($data);
}

/**
*
* @param array $data
*/
protected static function validate(array $data)
{
parent::validate($data);
self::validateRegion($data, 'S3 Object Lambda ARN');
self::validateAccountId($data, 'S3 Object Lambda ARN');
}
}
2 changes: 1 addition & 1 deletion vendor/aws/aws-sdk-php/src/Arn/ResourceTypeAndIdTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getResourceId()
return $this->data['resource_id'];
}

private static function parseResourceTypeAndId(array $data)
protected static function parseResourceTypeAndId(array $data)
{
$resourceData = preg_split("/[\/:]/", $data['resource'], 2);
$data['resource_type'] = isset($resourceData[0])
Expand Down
2 changes: 1 addition & 1 deletion vendor/aws/aws-sdk-php/src/Arn/S3/AccessPointArn.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AccessPointArn extends BaseAccessPointArn implements AccessPointArnInterfa
*
* @param array $data
*/
protected static function validate(array $data)
public static function validate(array $data)
{
parent::validate($data);
if ($data['service'] !== 's3') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private static function parseOutpostData(array $data)
*
* @param array $data
*/
protected static function validate(array $data)
public static function validate(array $data)
{
Arn::validate($data);

Expand Down
2 changes: 1 addition & 1 deletion vendor/aws/aws-sdk-php/src/Arn/S3/OutpostsBucketArn.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static function parseOutpostData(array $data)
*
* @param array $data
*/
protected static function validate(array $data)
public static function validate(array $data)
{
Arn::validate($data);

Expand Down
Loading

0 comments on commit 0dc95af

Please sign in to comment.