Download the PHP package amzn/amazon-pay-sdk-php without Composer

On this page you can find all versions of the php package amzn/amazon-pay-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?
amzn/amazon-pay-sdk-php
Rate from 1 - 5
Rated 5.00 based on 1 reviews

Informations about the package amazon-pay-sdk-php

Amazon Pay SDK (PHP)

Amazon Pay API Integration

Requirements

Support for PHP 5.3 and 5.4 is being deprecated. The SDK will work in these older environments, but future versions may not. We encourage merchants to move to a newer version of PHP at their earliest convenience.

Documentation

Integration steps can be found below:

Sample

Quick Start

The client takes in parameters in the following format:

  1. Associative array
  2. Path to the JSON file containing configuration information.

Installing using Composer

Directory Tree

Parameters List

Mandatory Parameters

Parameter variable name Values
Merchant Id merchant_id Default : null
Access Key access_key Default : null
Secret Key secret_key Default : null
Region region Default : null
Other: us,de,uk,jp

Optional Parameters

Parameter Variable name Values
Currency Code currency_code Default : null
Other: USD,EUR,GBP,JPY
Environment sandbox Default : false
Other: true
Platform ID platform_id Default : null
CA Bundle File cabundle_file Default : null
Application Name application_name Default : null
Application Version application_version Default : null
Proxy Host proxy_host Default : null
Proxy Port proxy_port Default : -1
Proxy Username proxy_username Default : null
Proxy Password proxy_password Default : null
LWA Client ID client_id Default : null
Handle Throttle handle_throttle Default : true
Other: false

Setting Configuration

Your Amazon Pay keys are available in your Seller Central account

Setting configuration while instantiating the Client object

Testing in Sandbox Mode

The sandbox parameter is defaulted to false if not specified:

Setting Proxy values

Proxy parameters can be set after Instantiating the Client Object with the following setter

Making an API Call

Below is an example on how to make the GetOrderReferenceDetails API call:

See the API Response section for information on parsing the API response.

Below is an example on how to make the GetMerchantAccountStatus API call:

See the API Response section for information on parsing the API response.

Below is an example on how to make the ListOrderReference API call:

See the API Response section for information on parsing the API response.

Below is an example on how to make the ListOrderReferenceByNextToken API call:

See the API Response section for information on parsing the API response.

IPN Handling

  1. To receive IPN's successfully you will need an valid SSL on your domain.
  2. You can set up your Notification endpoints by either (a) using the Seller Central Integration Settings page Settings tab, or (b) by using the SetMerchantNotificationConfiguration API call.
  3. IpnHandler.php class handles verification of the source and the data of the IPN

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.

See the IPN Response section for information on parsing the IPN response.

Setting notification endpoints using SetMerchantNotificationConfiguration API

Convenience Methods

Charge Method

The charge method combines the following API calls:

Standard Payments / Recurring Payments

  1. SetOrderReferenceDetails / SetBillingAgreementDetails
  2. ConfirmOrderReference / ConfirmBillingAgreement
  3. Authorize / AuthorizeOnBillingAgreement

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.

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
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.
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.
Maps to API call variables seller_note , seller_authorization_note
Charge Order ID charge_order_id no Custom order ID provided
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
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

See the 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.
Parameter Variable Name Mandatory Values
Access Token access_token yes Retrieved as GET parameter from the URL
Region region yes Default :null
Other:us,de,uk,jp
Value is set in config['region'] array
LWA Client ID client_id yes Default: null
Value should be set in config array

Response Parsing

Responses are provided in 3 formats

  1. XML/Raw response
  2. Associative array
  3. JSON format

API Response

IPN Response

Logging

SDK logging of sanitized requests and responses can work with any PSR-3 compliant logger such as Monolog.

API Response


All versions of amazon-pay-sdk-php with dependencies

PHP Build Version
Package Version
Requires ext-curl Version *
php Version >=5.5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amzn/amazon-pay-sdk-php contains the following files

Loading the files please wait ....