Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/239454

Change subject: Update Pay with Amazon SDK to dev-master
......................................................................

Update Pay with Amazon SDK to dev-master

^1.0 was getting us something with old IPN fields in it.

Change-Id: Ic6d9ae725e95e56deeb0931ebcfb3b858c3aefcc
---
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Client.php
R amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ClientInterface.php
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/HttpCurl.php
A amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/HttpCurlInterface.php
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
A amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandlerInterface.php
A amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Regions.php
A amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseInterface.php
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseParser.php
M amzn/login-and-pay-with-amazon-sdk-php/README.md
M composer/ClassLoader.php
A composer/LICENSE
M composer/installed.json
13 files changed, 445 insertions(+), 250 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig/vendor 
refs/changes/54/239454/1

diff --git a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Client.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Client.php
index 5ae3b36..aefc5b4 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Client.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Client.php
@@ -9,7 +9,8 @@
 
 require_once 'ResponseParser.php';
 require_once 'HttpCurl.php';
-require_once 'Interface.php';
+require_once 'ClientInterface.php';
+require_once 'Regions.php';
 
 class Client implements ClientInterface
 {
@@ -45,27 +46,9 @@
 
     // Final URL to where the API parameters POST done, based off the 
config['region'] and respective $mwsServiceUrls
     private $mwsServiceUrl = null;
-
-    private $mwsServiceUrls = array('eu' => 'mws-eu.amazonservices.com',
-                                   'na' => 'mws.amazonservices.com',
-                                   'jp' => 'mws.amazonservices.jp');
-
-    // Production profile end points to get the user information
-    private $liveProfileEndpoint = array('uk' => 'https://api.amazon.co.uk',
-                                        'us' => 'https://api.amazon.com',
-                                        'de' => 'https://api.amazon.de',
-                                        'jp' => 'https://api.amazon.co.jp');
-
-    // Sandbox profile end points to get the user information
-    private $sandboxProfileEndpoint = array('uk' => 
'https://api.sandbox.amazon.co.uk',
-                                           'us' => 
'https://api.sandbox.amazon.com',
-                                           'de' => 
'https://api.sandbox.amazon.de',
-                                           'jp' => 
'https://api.sandbox.amazon.co.jp');
-
-    private $regionMappings = array('de' => 'eu',
-                                   'uk' => 'eu',
-                                   'us' => 'na',
-                                   'jp' => 'jp');
+    private $mwsServiceUrls;
+    private $profileEndpointUrls;
+    private $regionMappings;
 
     // Boolean variable to check if the API call was a success
     public $success = false;
@@ -77,6 +60,7 @@
 
     public function __construct($config = null)
     {
+       $this->getRegionUrls();
         if (!is_null($config)) {
 
             if (is_array($config)) {
@@ -93,6 +77,16 @@
         } else {
            throw new \Exception('$config cannot be null.');
        }
+    }
+    
+    /* Get the Region specific properties from the Regions class.*/
+    
+    private function getRegionUrls()
+    {
+       $regionObject = new Regions();
+       $this->mwsServiceUrls = $regionObject->mwsServiceUrls;
+       $this->regionMappings = $regionObject->regionMappings;
+       $this->profileEndpointUrls = $regionObject->profileEndpointUrls;
     }
 
     /* checkIfFileExists -  check if the JSON file exists in the path provided 
*/
@@ -125,6 +119,7 @@
     private function checkConfigKeys($config)
     {
         $config = array_change_key_case($config, CASE_LOWER);
+       $config = $this->trimArray($config);
 
         foreach ($config as $key => $value) {
             if (array_key_exists($key, $this->config)) {
@@ -200,17 +195,17 @@
 
     public function setProxy($proxy)
     {
-        if (!empty($proxy['proxy_user_host']))
-           $this->config['proxy_user_host'] = $proxy['proxy_user_host'];
+       if (!empty($proxy['proxy_user_host']))
+           $this->config['proxy_host'] = $proxy['proxy_user_host'];
 
         if (!empty($proxy['proxy_user_port']))
-            $this->config['proxy_user_port'] = $proxy['proxy_user_port'];
+            $this->config['proxy_port'] = $proxy['proxy_user_port'];
 
         if (!empty($proxy['proxy_user_name']))
-            $this->config['proxy_user_name'] = $proxy['proxy_user_name'];
+            $this->config['proxy_username'] = $proxy['proxy_user_name'];
 
         if (!empty($proxy['proxy_user_password']))
-            $this->config['proxy_user_password'] = 
$proxy['proxy_user_password'];
+            $this->config['proxy_password'] = $proxy['proxy_user_password'];
     }
 
     /* Setter for $mwsServiceUrl
@@ -243,6 +238,20 @@
     {
        return trim($this->parameters);
     }
+    
+    /* Trim the input Array key values */
+    
+    private function trimArray($array)
+    {
+       foreach ($array as $key => $value)
+       {
+           if(!is_array($value) && $key!=='proxy_password')
+           {
+               $array[$key] = trim($value);
+           }
+       }
+       return $array;
+    }
 
     /* GetUserInfo convenience function - Returns user's profile information 
from Amazon using the access token returned by the Button widget.
      *
@@ -263,7 +272,7 @@
         $accessToken = urldecode($accessToken);
         $url        = $this->profileEndpoint . 
'/auth/o2/tokeninfo?access_token=' . urlEncode($accessToken);
 
-        $httpCurlRequest = new HttpCurl();
+        $httpCurlRequest = new HttpCurl($this->config);
 
         $response = $httpCurlRequest->httpGet($url);
         $data    = json_decode($response);
@@ -275,7 +284,7 @@
 
         // Exchange the access token for user profile
         $url             = $this->profileEndpoint . '/user/profile';
-        $httpCurlRequest = new HttpCurl();
+        $httpCurlRequest = new HttpCurl($this->config);
 
         $httpCurlRequest->setAccessToken($accessToken);
         $httpCurlRequest->setHttpHeader(true);
@@ -286,18 +295,17 @@
     }
 
     /* setParametersAndPost - sets the parameters array with non empty values 
from the requestParameters array sent to API calls.
-     * If Provider Credit or Provider Credit Reversal details are present
-     * setProviderCreditDetails or setProviderCreditReversalDetails is called 
to set the values.
+     * If Provider Credit Details is present, values are set by 
setProviderCreditDetails
+     * If Provider Credit Reversal Details is present, values are set by 
setProviderCreditDetails
      */
 
-    private function setParametersAndPost($parameters, $fieldMappings, 
$requestParameters)
+    protected function setParametersAndPost($parameters, $fieldMappings, 
$requestParameters)
     {
        /* For loop to take all the non empty parameters in the 
$requestParameters and add it into the $parameters array,
         * if the keys are matched from $requestParameters array with the 
$fieldMappings array
         */
         foreach ($requestParameters as $param => $value) {
 
-           // Provider Credit is an array of arrays for example, if the input 
$value was an array don't trim it as trim needs parameter to be string
            if(!is_array($value)) {
                $value = trim($value);
            }
@@ -705,7 +713,7 @@
      * @param requestParameters['amazon_authorization_id'] - [String]
      * @param requestParameters['capture_amount'] - [String]
      * @param requestParameters['currency_code'] - [String]
-     * @param requestParameters[capture_reference_id'] - [String]
+     * @param requestParameters['capture_reference_id'] - [String]
      * @optional requestParameters['provider_credit_details'] - [array 
(array())]
      * @optional requestParameters['seller_capture_note'] - [String]
      * @optional requestParameters['soft_descriptor'] - [String]
@@ -1010,8 +1018,8 @@
      *
      * @param requestParameters['merchant_id'] - [String]
      * @param requestParameters['amazon_billing_agreement_id'] - [String]
-     * @param AuthorizationReferenceId [String]
-     * @param AuthorizationAmount [String]
+     * @param requestParameters['authorization_reference_id'] [String]
+     * @param requestParameters['authorization_amount'] [String]
      * @param requestParameters['currency_code'] - [String]
      * @optional requestParameters['seller_authorization_note'] [String]
      * @optional requestParameters['transaction_timeout'] - Defaults to 1440 
minutes
@@ -1090,7 +1098,13 @@
      * 3. Authorize (with Capture) / AuthorizeOnBillingAgreeemnt (with Capture)
      *
      * @param requestParameters['merchant_id'] - [String]
+     *
      * @param requestParameters['amazon_reference_id'] - [String] : Order 
Reference ID /Billing Agreement ID
+     * If requestParameters['amazon_reference_id'] is empty then the following 
is required,
+     * @param requestParameters['amazon_order_reference_id'] - [String] : 
Order Reference ID
+     * or,
+     * @param requestParameters['amazon_billing_agreement_id'] - [String] : 
Billing Agreement ID
+     * 
      * @param $requestParameters['charge_amount'] - [String] : Amount value to 
be captured
      * @param requestParameters['currency_code'] - [String] : Currency Code 
for the Amount
      * @param requestParameters['authorization_reference_id'] - [String]- Any 
unique string that needs to be passed
@@ -1103,12 +1117,20 @@
     public function charge($requestParameters = array()) {
 
        $requestParameters = array_change_key_case($requestParameters, 
CASE_LOWER);
+       $requestParameters= $this->trimArray($requestParameters);
 
        $setParameters = $authorizeParameters = $confirmParameters = 
$requestParameters;
 
         $chargeType = '';
-
-        if (!empty($requestParameters['amazon_reference_id'])) {
+       
+       if (!empty($requestParameters['amazon_order_reference_id']))
+       {
+           $chargeType = 'OrderReference';
+           
+       } elseif(!empty($requestParameters['amazon_billing_agreement_id'])) {
+           $chargeType = 'BillingAgreement';
+           
+       } elseif (!empty($requestParameters['amazon_reference_id'])) {
             switch 
(substr(strtoupper($requestParameters['amazon_reference_id']), 0, 1)) {
                 case 'P':
                 case 'S':
@@ -1128,7 +1150,7 @@
                     throw new \Exception('Invalid Amazon Reference ID');
             }
         } else {
-            throw new \Exception('key amazon_reference_id is null and is a 
required parameter');
+            throw new \Exception('key amazon_order_reference_id or 
amazon_billing_agreement_id is null and is a required parameter');
         }
 
        // Set the other parameters if the values are present
@@ -1143,7 +1165,7 @@
         $setParameters['seller_billing_agreement_id'] = 
!empty($requestParameters['charge_order_id']) ? 
$requestParameters['charge_order_id'] : '';
         $authorizeParameters['seller_order_id'] = 
!empty($requestParameters['charge_order_id']) ? 
$requestParameters['charge_order_id'] : '';
 
-        $authorizeParameters['capture_now'] = 'true';
+        $authorizeParameters['capture_now'] = 
!empty($requestParameters['capture_now']) ? $requestParameters['capture_now'] : 
false;
 
        $response = $this->makeChargeCalls($chargeType, $setParameters, 
$confirmParameters, $authorizeParameters);
        return $response;
@@ -1154,36 +1176,71 @@
     private function makeChargeCalls($chargeType, $setParameters, 
$confirmParameters, $authorizeParameters)
     {
        switch ($chargeType) {
-            case 'OrderReference':
-                $response = $this->setOrderReferenceDetails($setParameters);
-                if ($this->success) {
+            
+           case 'OrderReference':
+               
+               // Get the Order Reference details and feed the response object 
to the ResponseParser
+                $responseObj = $this->getOrderReferenceDetails($setParameters);
+               
+               // Call the function getOrderReferenceDetailsStatus in 
ResponseParser.php providing it the XML response
+                // $oroStatus is an array containing the State of the Order 
Reference ID
+                $oroStatus = 
$responseObj->getOrderReferenceDetailsStatus($responseObj->toXml());
+               
+               if ($oroStatus['State'] === 'Draft') {
+                   $response = $this->setOrderReferenceDetails($setParameters);
+                   if ($this->success) {
                     $this->confirmOrderReference($confirmParameters);
-                }
-                if ($this->success) {
+                   }
+               }
+               
+                $responseObj = $this->getOrderReferenceDetails($setParameters);
+               
+               // Check the Order Reference Status again before making the 
Authorization.
+                $oroStatus = 
$responseObj->getOrderReferenceDetailsStatus($responseObj->toXml());
+               
+               if ($oroStatus['State'] === 'Open') {
+                   if ($this->success) {
                     $response = $this->Authorize($authorizeParameters);
-                }
-                return $response;
-            case 'BillingAgreement':
-                // Get the Billing Agreement details and feed the response 
object to the ResponseParser
-                $responseObj = 
$this->getBillingAgreementDetails($setParameters);
-                // Call the function GetBillingAgreementDetailsStatus in 
ResponseParser.php providing it the XML response
-                // $baStatus is an aray containing the State of the Billing 
Agreement
+                   }
+               }
+               if ($oroStatus['State'] != 'Open' && $oroStatus['State'] != 
'Draft') {
+                   throw new \Exception('The Order Reference is in the ' . 
$oroStatus['State'] . " State. It should be in the Draft or Open State");
+               }
+                
+               return $response;
+            
+           case 'BillingAgreement':
+                
+               // Get the Billing Agreement details and feed the response 
object to the ResponseParser
+                
+               $responseObj = 
$this->getBillingAgreementDetails($setParameters);
+                
+               // Call the function getBillingAgreementDetailsStatus in 
ResponseParser.php providing it the XML response
+                // $baStatus is an array containing the State of the Billing 
Agreement
                 $baStatus = 
$responseObj->getBillingAgreementDetailsStatus($responseObj->toXml());
-                if ($baStatus['State'] != 'Open') {
-                    $response = 
$this->SetBillingAgreementDetails($setParameters);
+                
+               if ($baStatus['State'] === 'Draft') {
+                    $response = 
$this->setBillingAgreementDetails($setParameters);
                     if ($this->success) {
-                        $response = 
$this->ConfirmBillingAgreement($confirmParameters);
+                        $response = 
$this->confirmBillingAgreement($confirmParameters);
                     }
                 }
-                // Check the Billing Agreement status again before making the 
Authorization.
+                
+               // Check the Billing Agreement status again before making the 
Authorization.
                 $responseObj = 
$this->getBillingAgreementDetails($setParameters);
-                $baStatus = 
$responseObj->GetBillingAgreementDetailsStatus($responseObj->toXml());
+                $baStatus = 
$responseObj->getBillingAgreementDetailsStatus($responseObj->toXml());
+               
                 if ($this->success && $baStatus['State'] === 'Open') {
-                    $response = 
$this->AuthorizeOnBillingAgreement($authorizeParameters);
+                    $response = 
$this->authorizeOnBillingAgreement($authorizeParameters);
                 }
+               
+               if($baStatus['State'] != 'Open' && $baStatus['State'] != 
'Draft') {
+                   throw new \Exception('The Billing Agreement is in the ' . 
$baStatus['State'] . " State. It should be in the Draft or Open State");
+               }
+               
             return $response;
-        }
-    }
+           }
+       }
 
     /* GetProviderCreditDetails API Call - Get the details of the Provider 
Credit.
      *
@@ -1492,14 +1549,14 @@
 
     private function profileEndpointUrl()
     {
+       $profileEnvt = strtolower($this->config['sandbox']) ? "api.sandbox" : 
"api";
+       
         if (!empty($this->config['region'])) {
             $region = strtolower($this->config['region']);
 
-           if (array_key_exists($region, $this->sandboxProfileEndpoint) && 
$this->config['sandbox'] ) {
-                $this->profileEndpoint = 
$this->sandboxProfileEndpoint[$region];
-           } elseif (array_key_exists($region, $this->liveProfileEndpoint)) {
-               $this->profileEndpoint = $this->liveProfileEndpoint[$region];
-           } else{
+           if (array_key_exists($region, $this->regionMappings) ) {
+                $this->profileEndpoint = 'https://' . $profileEnvt . '.' . 
$this->profileEndpointUrls[$region];
+           }else{
                throw new \Exception($region . ' is not a valid region');
            }
        } else {
diff --git a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Interface.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ClientInterface.php
similarity index 86%
rename from amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Interface.php
rename to 
amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ClientInterface.php
index 36415ad..53af1ca 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Interface.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ClientInterface.php
@@ -167,8 +167,8 @@
      * @param requestParameters['amazon_authorization_id'] - [String]
      * @param requestParameters['capture_amount'] - [String]
      * @param requestParameters['currency_code'] - [String]
-     * @param requestParameters[capture_reference_id'] - [String]
-     * @param requestParameters['provider_credit_details'] - [array (array())]
+     * @param requestParameters['capture_reference_id'] - [String]
+     * @optional requestParameters['provider_credit_details'] - [array 
(array())]
      * @optional requestParameters['seller_capture_note'] - [String]
      * @optional requestParameters['soft_descriptor'] - [String]
      * @optional requestParameters['mws_auth_token'] - [String]
@@ -194,7 +194,7 @@
      * @param requestParameters['refund_reference_id'] - [String]
      * @param requestParameters['refund_amount'] - [String]
      * @param requestParameters['currency_code'] - [String]
-     * @param requestParameters['provider_credit_reversal_details'] - 
[array(array())]
+     * @optional requestParameters['provider_credit_reversal_details'] - 
[array(array())]
      * @optional requestParameters['seller_refund_note'] [String]
      * @optional requestParameters['soft_descriptor'] - [String]
      * @optional requestParameters['mws_auth_token'] - [String]
@@ -295,8 +295,8 @@
      *
      * @param requestParameters['merchant_id'] - [String]
      * @param requestParameters['amazon_billing_agreement_id'] - [String]
-     * @param AuthorizationReferenceId [String]
-     * @param AuthorizationAmount [String]
+     * @param requestParameters['authorization_reference_id'] [String]
+     * @param requestParameters['authorization_amount'] [String]
      * @param requestParameters['currency_code'] - [String]
      * @optional requestParameters['seller_authorization_note'] [String]
      * @optional requestParameters['transaction_timeout'] - Defaults to 1440 
minutes
@@ -331,11 +331,17 @@
      * 3. Authorize (with Capture) / AuthorizeOnBillingAgreeemnt (with Capture)
      *
      * @param requestParameters['merchant_id'] - [String]
+     *
      * @param requestParameters['amazon_reference_id'] - [String] : Order 
Reference ID /Billing Agreement ID
+     * If requestParameters['amazon_reference_id'] is empty then the following 
is required,
+     * @param requestParameters['amazon_order_reference_id'] - [String] : 
Order Reference ID
+     * or,
+     * @param requestParameters['amazon_billing_agreement_id'] - [String] : 
Billing Agreement ID
+     * 
      * @param $requestParameters['charge_amount'] - [String] : Amount value to 
be captured
-     * @param requestParameters['charge_currency_code'] - [String] : Currency 
Code for the Amount
+     * @param requestParameters['currency_code'] - [String] : Currency Code 
for the Amount
      * @param requestParameters['authorization_reference_id'] - [String]- Any 
unique string that needs to be passed
-     * @optional requestParameters['charge_note'] - [String] : seller note 
sent to the buyer
+     * @optional requestParameters['charge_note'] - [String] : Seller Note 
sent to the buyer
      * @optional requestParameters['transaction_timeout'] - [String] : 
Defaults to 1440 minutes
      * @optional requestParameters['charge_order_id'] - [String] : Custom 
Order ID provided
      * @optional requestParameters['mws_auth_token'] - [String]
@@ -373,101 +379,4 @@
      */
     
     public function reverseProviderCredit($requestParameters = array());
-}
-
-/* Interface for IpnHandler.php */
-
-interface IpnHandlerInterface
-{
-   /* Takes headers and body of the IPN message as input in the constructor
-    * verifies that the IPN is from the right resource and has the valid data
-    */
-   
-    public function __construct($headers, $body, $ipnConfig = null);
-    
-    /* returnMessage() - JSON decode the raw [Message] portion of the IPN */
-    
-    public function returnMessage();
-
-    /* toJson() - Converts IPN [Message] field to JSON
-     *
-     * Has child elements
-     * ['NotificationData'] [XML] - API call XML notification data
-     * @param remainingFields - consists of remaining IPN array fields that 
are merged
-     * Type - Notification
-     * MessageId -  ID of the Notification
-     * Topic ARN - Topic of the IPN
-     * @return response in JSON format
-     */
-    
-    public function toJson();
-
-    /* toArray() - Converts IPN [Message] field to associative array
-     * @return response in array format
-     */
-    
-    public function toArray();
-}
-
-/* Interface for HttpCurl.php */
-
-interface HttpCurlInterface
-{
-    /* Takes user configuration array as input
-     * Takes configuration for API call or IPN config
-     */
-    
-    public function __construct($config = null);
-    
-    /* Set Http header for Access token for the GetUserInfo call */
-    
-    public function setHttpHeader();
-    
-    /* Setter for  Access token to get the user info */
-    
-    public function setAccessToken($accesstoken);
-    
-    /* POST using curl for the following situations
-     * 1. API calls
-     * 2. IPN certificate retrieval
-     * 3. Get User Info
-     */
-    
-    public function httpPost($url, $userAgent = null, $parameters = null);
-    
-    /* GET using curl for the following situations
-     * 1. IPN certificate retrieval
-     * 3. Get User Info
-     */
-    
-    public function httpGet($url, $userAgent = null);
-}
-
-/* Interface for ResponseParser.php */
-
-interface ResponseInterface
-{
-    /* Takes response from the API call */
-    
-    public function __construct($response = null);
-    
-    /* Returns the XML portion of the response */
-    
-    public function toXml();
-    
-    /* toJson  - converts XML into Json
-     * @param $response [XML]
-     */
-    
-    public function toJson();
-    
-    /* toArray  - converts XML into associative array
-     * @param $this->_response [XML]
-     */
-    
-    public function toArray();
-    
-    /* Get the status of the BillingAgreement */
-    
-    public function getBillingAgreementDetailsStatus($response);
 }
diff --git a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/HttpCurl.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/HttpCurl.php
index 1d607e0..e45a72b 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/HttpCurl.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/HttpCurl.php
@@ -5,7 +5,7 @@
  * Handles Curl POST function for all requests
  */
 
-require_once 'Interface.php';
+require_once 'HttpCurlInterface.php';
 
 class HttpCurl implements HttpCurlInterface
 {
diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/HttpCurlInterface.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/HttpCurlInterface.php
new file mode 100644
index 0000000..81755ba
--- /dev/null
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/HttpCurlInterface.php
@@ -0,0 +1,36 @@
+<?php
+namespace PayWithAmazon;
+
+/* Interface for HttpCurl.php */
+
+interface HttpCurlInterface
+{
+    /* Takes user configuration array as input
+     * Takes configuration for API call or IPN config
+     */
+    
+    public function __construct($config = null);
+    
+    /* Set Http header for Access token for the GetUserInfo call */
+    
+    public function setHttpHeader();
+    
+    /* Setter for  Access token to get the user info */
+    
+    public function setAccessToken($accesstoken);
+    
+    /* POST using curl for the following situations
+     * 1. API calls
+     * 2. IPN certificate retrieval
+     * 3. Get User Info
+     */
+    
+    public function httpPost($url, $userAgent = null, $parameters = null);
+    
+    /* GET using curl for the following situations
+     * 1. IPN certificate retrieval
+     * 3. Get User Info
+     */
+    
+    public function httpGet($url, $userAgent = null);
+}
diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
index 9d91ab2..2514af1 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
@@ -7,7 +7,7 @@
  */
 
 require_once 'HttpCurl.php';
-require_once 'Interface.php';
+require_once 'IpnHandlerInterface.php';
 class IpnHandler implements IpnHandlerInterface
 {
 
@@ -61,6 +61,7 @@
     private function checkConfigKeys($ipnConfig)
     {
         $ipnConfig = array_change_key_case($ipnConfig, CASE_LOWER);
+       $ipnConfig = $this->trimArray($ipnConfig);
 
         foreach ($ipnConfig as $key => $value) {
             if (array_key_exists($key, $this->ipnConfig)) {
@@ -98,7 +99,17 @@
         }
     }
 
-
+    /* Trim the input Array key values */
+    
+    private function trimArray($array)
+    {
+       foreach ($array as $key => $value)
+       {
+           $array[$key] = trim($value);
+       }
+       return $array;
+    }
+    
     private function validateHeaders()
     {
         // Quickly check that this is a sns message
@@ -397,10 +408,8 @@
         $remainingFields = array(
                             'NotificationReferenceId' 
=>$ipnMessage['NotificationReferenceId'],
                             'NotificationType' 
=>$ipnMessage['NotificationType'],
-                            'IsSample' =>$ipnMessage['IsSample'],
                             'SellerId' =>$ipnMessage['SellerId'],
-                            'ReleaseEnvironment' 
=>$ipnMessage['ReleaseEnvironment'],
-                            'Version' =>$ipnMessage['Version']);
+                            'ReleaseEnvironment' 
=>$ipnMessage['ReleaseEnvironment'] );
 
         return $remainingFields;
     }
diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandlerInterface.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandlerInterface.php
new file mode 100644
index 0000000..c876b30
--- /dev/null
+++ 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandlerInterface.php
@@ -0,0 +1,36 @@
+<?php
+namespace PayWithAmazon;
+
+/* Interface for IpnHandler.php */
+
+interface IpnHandlerInterface
+{
+   /* Takes headers and body of the IPN message as input in the constructor
+    * verifies that the IPN is from the right resource and has the valid data
+    */
+   
+    public function __construct($headers, $body, $ipnConfig = null);
+    
+    /* returnMessage() - JSON decode the raw [Message] portion of the IPN */
+    
+    public function returnMessage();
+
+    /* toJson() - Converts IPN [Message] field to JSON
+     *
+     * Has child elements
+     * ['NotificationData'] [XML] - API call XML notification data
+     * @param remainingFields - consists of remaining IPN array fields that 
are merged
+     * Type - Notification
+     * MessageId -  ID of the Notification
+     * Topic ARN - Topic of the IPN
+     * @return response in JSON format
+     */
+    
+    public function toJson();
+
+    /* toArray() - Converts IPN [Message] field to associative array
+     * @return response in array format
+     */
+    
+    public function toArray();
+}
diff --git a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Regions.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Regions.php
new file mode 100644
index 0000000..8c2b436
--- /dev/null
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/Regions.php
@@ -0,0 +1,23 @@
+<?php
+namespace PayWithAmazon;
+
+/* Class Regions
+ * Defines all Region specific properties
+ */
+
+class Regions
+{
+    public $mwsServiceUrls = array('eu' => 'mws-eu.amazonservices.com',
+                                  'na' => 'mws.amazonservices.com',
+                                  'jp' => 'mws.amazonservices.jp');
+    
+    public $profileEndpointUrls = array('uk' => 'amazon.co.uk',
+                                       'us' => 'amazon.com',
+                                       'de' => 'amazon.de',
+                                       'jp' => 'amazon.co.jp');
+    
+    public $regionMappings = array('de' => 'eu',
+                                  'uk' => 'eu',
+                                  'us' => 'na',
+                                  'jp' => 'jp');
+}
\ No newline at end of file
diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseInterface.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseInterface.php
new file mode 100644
index 0000000..1fbb874
--- /dev/null
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseInterface.php
@@ -0,0 +1,31 @@
+<?php
+namespace PayWithAmazon;
+
+/* Interface for ResponseParser.php */
+
+interface ResponseInterface
+{
+    /* Takes response from the API call */
+    
+    public function __construct($response = null);
+    
+    /* Returns the XML portion of the response */
+    
+    public function toXml();
+    
+    /* toJson  - converts XML into Json
+     * @param $response [XML]
+     */
+    
+    public function toJson();
+    
+    /* toArray  - converts XML into associative array
+     * @param $this->_response [XML]
+     */
+    
+    public function toArray();
+    
+    /* Get the status of the BillingAgreement */
+    
+    public function getBillingAgreementDetailsStatus($response);
+}
diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseParser.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseParser.php
index b7432ca..9120b53 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseParser.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ResponseParser.php
@@ -5,7 +5,7 @@
  * Methods provided to convert the Response from the POST to XML, Array or JSON
  */
 
-require_once 'Interface.php';
+require_once 'ResponseInterface.php';
 
 class ResponseParser implements ResponseInterface
 {
@@ -64,6 +64,23 @@
         return $response;
     }
     
+    /* Get the status of the Order Reference ID */
+    
+    public function getOrderReferenceDetailsStatus($response)
+    {
+       $data= new \SimpleXMLElement($response);
+        $namespaces = $data->getNamespaces(true);
+        foreach($namespaces as $key=>$value){
+            $namespace = $value;
+        }
+        $data->registerXPathNamespace('GetORO', $namespace);
+        foreach ($data->xpath('//GetORO:OrderReferenceStatus') as $value) {
+            $oroStatus = json_decode(json_encode((array)$value), TRUE);
+        }
+        
+        return $oroStatus ;
+    }
+    
     /* Get the status of the BillingAgreement */
     
     public function getBillingAgreementDetailsStatus($response)
diff --git a/amzn/login-and-pay-with-amazon-sdk-php/README.md 
b/amzn/login-and-pay-with-amazon-sdk-php/README.md
index fbc76c0..fc80114 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/README.md
+++ b/amzn/login-and-pay-with-amazon-sdk-php/README.md
@@ -3,8 +3,17 @@
 
 ## Requirements
 
+* Login and Pay With Amazon account - [Register 
here](https://payments.amazon.com/signup)
 * PHP 5.3 or higher
 * Curl 7.18 or higher
+
+## Documentation
+
+* The Integration steps can be found 
[here](https://payments.amazon.com/documentation)
+
+## Sample
+
+* View the sample integration demo 
[here](https://amzn.github.io/login-and-pay-with-amazon-sdk-samples/)
 
 ## Quick Start
 
@@ -14,6 +23,34 @@
 1. Associative array
 2. Path to the JSON file containing configuration information.
 
+## Installing using Composer
+```
+composer create-project amzn/login-and-pay-with-amazon-sdk-php --prefer-dist
+```
+## Directory Tree
+```
+.
+├── composer.json - Configuration for composer
+├── LICENSE.txt
+├── NOTICE.txt
+├── PayWithAmazon
+│   ├── Client.php - Main class with the API calls
+│   ├── ClientInterface.php - Shows the public function definitions in 
Client.php
+│   ├── HttpCurl.php -  Client class uses this file to execute the GET/POST
+│   ├── HttpCurlInterface.php - Shows the public function definitions in 
HttpCurl.php
+│   ├── IpnHandler.php - Class handles verification of the IPN
+│   ├── IpnHandlerInterface.php - Shows the public function definitions in 
IpnHandler.php
+│   ├── Regions.php -  Defines the regions that is supported
+│   ├── ResponseInterface.php - Shows the public function definitions in 
ResponseParser.php
+│   └── ResponseParser.php -  Parses the API call response
+├── README.md
+└── UnitTests
+    ├── ClientTest.php
+    ├── config.json
+    ├── coverage.txt
+    ├── IpnHandlerTest.php
+    └── Signature.php
+```
 ##Parameters List
 
 ####Mandatory Parameters
@@ -44,11 +81,11 @@
 
 Setting configuration while instantiating the Client object
 ```php
-<?php namespace PayWithAmazon;
+<?php
+namespace PayWithAmazon;
 
-require_once 'Client.php'
-// Your Login and Pay with Amazon keys are
-// available in your Seller Central account
+require_once 'Client.php';
+// Your Login and Pay with Amazon keys are available in your Seller Central 
account
 
 // PHP Associative array
 $config = array('merchant_id' => 'YOUR_MERCHANT_ID',
@@ -57,17 +94,18 @@
                 'client_id'   => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
                 'region'      => 'REGION');
 
-// JSON file path            
+// JSON file path
 $config = 'PATH_TO_JSON_FILE';
 
-//Instantiate the client class with the config type
+// Instantiate the client class with the config type
 $client = new Client($config);
 ```
 ### Testing in Sandbox Mode
 
 The sandbox parameter is defaulted to false if not specified:
 ```php
-<?php namespace PayWithAmazon;
+<?php
+namespace PayWithAmazon;
 
 $config = array('merchant_id'   => 'YOUR_MERCHANT_ID',
                 'access_key'    => 'YOUR_ACCESS_KEY',
@@ -78,7 +116,7 @@
 
 $client = new Client($config);
 
-//Also you can set the sandbox variable in the config() array of the Client 
class by 
+// Also you can set the sandbox variable in the config() array of the Client 
class by
 
 $client->setSandbox(true);
 ```
@@ -86,10 +124,10 @@
 Proxy parameters can be set after Instantiating the Client Object with the 
following setter
 ```php
 $proxy =  array();
-$proxy['proxy_user_host'] // hostname for the proxy
-$proxy['proxy_user_port'] // hostname for the proxy
-$proxy['proxy_user_name'] // if your proxy requires a username
-$proxy['proxy_user_password'] // if your proxy requires a password
+$proxy['proxy_user_host'] // Hostname for the proxy
+$proxy['proxy_user_port'] // Hostname for the proxy
+$proxy['proxy_user_name'] // If your proxy requires a username
+$proxy['proxy_user_password'] // If your proxy requires a password
 
 $client->setProxy($proxy);
 ```
@@ -99,23 +137,25 @@
 Below is an example on how to make the GetOrderReferenceDetails API call:
 
 ```php
-<?php namespace PayWithAmazon;
+<?php
+namespace PayWithAmazon;
 
 $requestParameters = array();
 
 // AMAZON_ORDER_REFERENCE_ID is obtained from the Pay with Amazon 
Address/Wallet widgets
 // ACCESS_TOKEN is obtained from the GET parameter from the URL.
 
-//Required Parameter
+// Required Parameter
 $requestParameters['amazon_order_reference_id'] = 'AMAZON_ORDER_REFERENCE_ID';
 
-//Optional Parameter
+// Optional Parameter
 $requestParameters['address_consent_token']     = 'ACCESS_TOKEN';
 $requestParameters['mws_auth_token']            = 'MWS_AUTH_TOKEN';
 
 $response = $client->getOrderReferenceDetails($requestParameters);
 
 ```
+See the [API 
Response](https://github.com/amzn/login-and-pay-with-amazon-sdk-php#api-response)
 section for information on parsing the API response.
 
 ### IPN Handling
 
@@ -126,59 +166,80 @@
 Add the below code into any file and set the URL to the file location in 
Merchant/Integrator URL by accessing Integration Settings page in the Settings 
tab.
 
 ```php
-<?php namespace PayWithAmazon;
+<?php
+namespace PayWithAmazon;
 
 require_once 'IpnHandler.php';
 
-//get the IPN headers and Message body
+// Get the IPN headers and Message body
 $headers    = getallheaders();
 $body       = file_get_contents('php://input');
 
-//create an  object($ipnHandler) of the IpnHandler class 
+// Create an object($ipnHandler) of the IpnHandler class
 $ipnHandler = new IpnHandler($headers, $body);
 
 ```
+See the [IPN 
Response](https://github.com/amzn/login-and-pay-with-amazon-sdk-php#ipn-response)
 section for information on parsing the IPN response.
+
 ### Convenience Methods
 
 #####Charge Method
 
-charge method combines the following API calls 
+The charge method combines the following API calls:
 
 **Standard Payments / Recurring Payments**
 
 1. SetOrderReferenceDetails / SetBillingAgreementDetails
 2. ConfirmOrderReference / ConfirmBillingAgreement
-3. Authorize (With capture) / AuthorizeOnBillingAgreement (With capture)
+3. Authorize / AuthorizeOnBillingAgreement
 
-For Recurring payments the first `charge` call will make the 
SetBillingAgreementDetails, ConfirmBillingAgreement, 
AuthorizeOnBillingAgreement API calls.
-Subsequent call to `charge` method for the same Billing Agreement ID will make 
the call only to AuthorizeOnBillingAgreement (With capture).
+For **Standard payments** the first `charge` call will make the 
SetOrderReferenceDetails, ConfirmOrderReference, Authorize API calls.
+Subsequent call to `charge` method for the same Order Reference ID will make 
the call only to Authorize.
 
-| Parameter                  | Variable Name               | Mandatory | 
Values                                                                          
                         |
-|----------------------------|-----------------------------|-----------|-----------------------------------------------------------------------------------------------------------|
-| Amazon Reference ID       | `amazon_reference_id`       | yes       | 
OrderReference ID (`starts with P01 or S01`) or <br>Billing Agreement ID 
(`starts with B01 or C01`)       |
-| Merchant ID               | `merchant_id`               | no        | value 
taken from config array in Client.php                                           
                   |
-| Charge Amount             | `charge_amount`             | yes       | Amount 
that needs to be captured.<br>Maps to API call variables `amount` , 
`authorization_amount`         |
-| Currency code             | `currency_code`             | no        | if no 
value is provided, value is taken from the config array in Client.php           
                    |
-| Authorization Reference ID | `authorization_reference_id`| yes       | 
Unique string to be passed                                                      
                         |
-| Transaction Timeout       | `transaction_timeout`       | no        | 
Timeout for Authorization - Defaults to 1440 minutes                            
                          |
-| Charge Note               | `charge_note`               | no        | Note 
that is sent to the buyer. <br>Maps to API call variables `seller_note` , 
`seller_authorization_note`|
-| Charge Order ID           | `charge_order_id`           | no        | custom 
order ID provided <br>Maps to API call variables `seller_order_id` , 
`seller_billing_agreement_id` |
-| Store Name                | `store_name`                | no        | Name 
of the store                                                                    
                     |
-| 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                 
                      |
+For **Recurring payments** the first `charge` call will make the 
SetBillingAgreementDetails, ConfirmBillingAgreement, 
AuthorizeOnBillingAgreement API calls.
+Subsequent call to `charge` method for the same Billing Agreement ID will make 
the call only to AuthorizeOnBillingAgreement.
+
+> **Capture Now** can be set to `true` for digital goods . For Physical goods 
it's highly recommended to set the Capture Now to `false`
+and the amount captured by making the `capture` API call after the shipment is 
complete.
+
+
+| Parameter                  | Variable Name                | Mandatory | 
Values                                                                          
                         |
+|----------------------------|------------------------------|-----------|-----------------------------------------------------------------------------------------------------------|
+| Amazon Reference ID       | `amazon_reference_id`        | yes       | 
OrderReference ID (`starts with P01 or S01`) or <br>Billing Agreement ID 
(`starts with B01 or C01`)       |
+| Amazon OrderReference ID   | `amazon_order_reference_id`  | no        | 
OrderReference ID (`starts with P01 or S01`) if no Amazon Reference ID is 
provided                        |
+| Amazon Billing Agreement ID| `amazon_billing_agreement_id`| no        | 
Billing Agreement ID (`starts with B01 or C01`) if no Amazon Reference ID is 
provided                     |
+| Merchant ID               | `merchant_id`                | no        | Value 
taken from config array in Client.php                                           
                    |
+| Charge Amount             | `charge_amount`              | yes       | 
Amount that needs to be captured.<br>Maps to API call variables `amount` , 
`authorization_amount`         |
+| Currency code             | `currency_code`              | no        | If no 
value is provided, value is taken from the config array in Client.php           
                    |
+| Authorization Reference ID | `authorization_reference_id` | yes       | 
Unique string to be passed                                                      
                         |
+| Transaction Timeout       | `transaction_timeout`        | no        | 
Timeout for Authorization - Defaults to 1440 minutes                            
                          |
+| Capture Now               | `capture_now`                | no        | Will 
capture the payment automatically when set to `true`. Defaults to `false`       
                                                                                
     |
+| Charge Note               | `charge_note`                | no        | Note 
that is sent to the buyer. <br>Maps to API call variables `seller_note` , 
`seller_authorization_note`|
+| Charge Order ID           | `charge_order_id`            | no        | 
Custom order ID provided <br>Maps to API call variables `seller_order_id` , 
`seller_billing_agreement_id` |
+| Store Name                | `store_name`                 | no        | Name 
of the store                                                                    
                     |
+| 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                 
                      |
 
 ```php
-//create an array that will contain the parameters for the charge API call
+// Create an array that will contain the parameters for the charge API call
 $requestParameters = array();
 
-//Adding the parameters values to the respective keys in the array
+// Adding the parameters values to the respective keys in the array
 $requestParameters['amazon_reference_id'] = 'AMAZON_REFERENCE_ID';
+
+// Or
+// If $requestParameters['amazon_reference_id'] is not provided,
+// either one of the following ID input is needed
+$requestParameters['amazon_order_reference_id']   = 
'AMAZON_ORDER_REFERENCE_ID';
+$requestParameters['amazon_billing_agreement_id'] = 
'AMAZON_BILLING_AGREEMENT_ID';
+
 $requestParameters['seller_id'] = null;
 $requestParameters['charge_amount'] = '100.50';
 $requestParameters['currency_code'] = 'USD';
 $requestParameters['authorization_reference_id'] = 'UNIQUE STRING';
 $requestParameters['transaction_timeout'] = 0;
+$requestParameters['capture_now'] = false; //`true` for Digital goods
 $requestParameters['charge_note'] = 'Example item note';
 $requestParameters['charge_order_id'] = '1234-Example-Order';
 $requestParameters['store_name'] = 'Example Store';
@@ -186,13 +247,15 @@
 $requestParameters['custom_information'] = 'Any_Custom_String';
 $requestParameters['mws_auth_token'] = null;
 
-//get the Authorization response from the charge method
+// Get the Authorization response from the charge method
 $response = $client->charge($requestParameters);
 ```
+See the [API 
Response](https://github.com/amzn/login-and-pay-with-amazon-sdk-php#api-response)
 section for information on parsing the API response.
+
 #####Obtain profile information (getUserInfo method)
-1. obtains the user's profile information from Amazon using the access token 
returned by the Button widget. 
-2. An access token is granted by the authorization server when a user logs in 
to a site. 
-3. An access token is specific to a client, a user, and an access scope. A 
client must use an access token to retrieve customer profile data. 
+1. obtains the user's profile information from Amazon using the access token 
returned by the Button widget.
+2. An access token is granted by the authorization server when a user logs in 
to a site.
+3. An access token is specific to a client, a user, and an access scope. A 
client must use an access token to retrieve customer profile data.
 
 | Parameter           | Variable Name         | Mandatory | Values             
                                                                     |
 
|---------------------|-----------------------|-----------|------------------------------------------------------------------------------------------|
@@ -203,25 +266,25 @@
 ```php
 <?php namespace PayWithAmazon;
 
-//config array parameters that need to be instantiated
+// config array parameters that need to be instantiated
 $config = array('client_id' => 'YOUR_LWA_CLIENT_ID',
                 'region'    => 'REGION' );
 
 $client = new Client($config);
 
-//Client ID can also be set using the setter function setClientId($client_id)
+// Client ID can also be set using the setter function setClientId($client_id)
 $client->setClientId(‘YOUR_LWA_CLIENT_ID’);
 
-//Get the Access Token from the URL
+// Get the Access Token from the URL
 $access_token = 'ACCESS_TOKEN';
-//calling the function getUserInfo with the access token parameter returns 
object
+// Calling the function getUserInfo with the access token parameter returns 
object
 $userInfo = $client->getUserInfo($access_token);
 
-//Buyer name
+// Buyer name
 $userInfo['name'];
-//Buyer Email
+// Buyer Email
 $userInfo['email'];
-//Buyer User Id
+// Buyer User Id
 $userInfo['user_id'];
 ```
 ### Response Parsing
@@ -234,16 +297,16 @@
 
 #####API Response
 ```php
-//Returns an object($response) of the class ResponseParser.php
+// Returns an object($response) of the class ResponseParser.php
 $response = $client->getOrderReferenceDetails($requestParameters);
 
-//XML response
+// XML response
 $response->toXml();
 
-//Associative array response
+// Associative array response
 $response->toArray();
 
-//JSON response
+// JSON response
 $response->toJson();
 ```
 
@@ -251,12 +314,12 @@
 ```php
 $ipnHandler = new IpnHandler($headers, $body);
 
-//Raw message response
+// Raw message response
 $ipnHandler->returnMessage();
 
-//Associative array response
+// Associative array response
 $ipnHandler->toArray();
 
-//JSON response
+// JSON response
 $ipnHandler->toJson();
-```
\ No newline at end of file
+```
diff --git a/composer/ClassLoader.php b/composer/ClassLoader.php
index 4e05d3b..5e1469e 100644
--- a/composer/ClassLoader.php
+++ b/composer/ClassLoader.php
@@ -351,7 +351,7 @@
             foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
                 if (0 === strpos($class, $prefix)) {
                     foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
-                        if (is_file($file = $dir . DIRECTORY_SEPARATOR . 
substr($logicalPathPsr4, $length))) {
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . 
substr($logicalPathPsr4, $length))) {
                             return $file;
                         }
                     }
@@ -361,7 +361,7 @@
 
         // PSR-4 fallback dirs
         foreach ($this->fallbackDirsPsr4 as $dir) {
-            if (is_file($file = $dir . DIRECTORY_SEPARATOR . 
$logicalPathPsr4)) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . 
$logicalPathPsr4)) {
                 return $file;
             }
         }
@@ -380,7 +380,7 @@
             foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
                 if (0 === strpos($class, $prefix)) {
                     foreach ($dirs as $dir) {
-                        if (is_file($file = $dir . DIRECTORY_SEPARATOR . 
$logicalPathPsr0)) {
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . 
$logicalPathPsr0)) {
                             return $file;
                         }
                     }
@@ -390,7 +390,7 @@
 
         // PSR-0 fallback dirs
         foreach ($this->fallbackDirsPsr0 as $dir) {
-            if (is_file($file = $dir . DIRECTORY_SEPARATOR . 
$logicalPathPsr0)) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . 
$logicalPathPsr0)) {
                 return $file;
             }
         }
diff --git a/composer/LICENSE b/composer/LICENSE
new file mode 100644
index 0000000..c8d57af
--- /dev/null
+++ b/composer/LICENSE
@@ -0,0 +1,21 @@
+
+Copyright (c) 2015 Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/composer/installed.json b/composer/installed.json
index 2585c75..9f8f84b 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -219,32 +219,25 @@
     },
     {
         "name": "amzn/login-and-pay-with-amazon-sdk-php",
-        "version": "v1.0.0",
-        "version_normalized": "1.0.0.0",
+        "version": "dev-master",
+        "version_normalized": "9999999-dev",
         "source": {
             "type": "git",
-            "url": 
"https://github.com/amzn/login-and-pay-with-amazon-sdk-php.git";,
-            "reference": "3bf17e802dc6913aa97f1afdaf26a08480f670d0"
-        },
-        "dist": {
-            "type": "zip",
-            "url": 
"https://api.github.com/repos/amzn/login-and-pay-with-amazon-sdk-php/zipball/3bf17e802dc6913aa97f1afdaf26a08480f670d0";,
-            "reference": "3bf17e802dc6913aa97f1afdaf26a08480f670d0",
-            "shasum": ""
+            "url": 
"https://github.com/ejegg/login-and-pay-with-amazon-sdk-php";,
+            "reference": "24b31581d85c232a3b0f5038c2894d565c831392"
         },
         "require": {
             "ext-curl": "*",
             "php": ">=5.3.0"
         },
-        "time": "2015-04-16 21:14:01",
+        "time": "2015-08-24 21:26:11",
         "type": "library",
-        "installation-source": "dist",
+        "installation-source": "source",
         "autoload": {
             "psr-4": {
                 "PayWithAmazon\\": "PayWithAmazon/"
             }
         },
-        "notification-url": "https://packagist.org/downloads/";,
         "license": [
             "Apache OSL-2"
         ],

-- 
To view, visit https://gerrit.wikimedia.org/r/239454
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6d9ae725e95e56deeb0931ebcfb3b858c3aefcc
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig/vendor
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to