Step 2: Configure

This section covers SDK setup requirements, such as setting up config files and Amazon MWS endpoints.

Procedure

Complete the following steps to configure your website for Amazon Pay and Login with Amazon:

  1. Make sure that you have followed the setup steps in Adding allowed JavaScript origins or allowed return URLs.
  2. Set up Sandbox MWS endpoints and other URLs.

Best practice recommendation: All API calls should be submitted to the Sandbox for test purposes before being moved live to your production systems.

The table below shows the Sandbox-Endpoints. For a list of production endpoints, see Taking your integration live.

Payments API endpoint
https://mws-eu.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01
Login API URL
https://api.sandbox.amazon.de
Profile API URL
https://api.sandbox.amazon.de/user/profile
Payments API endpoint
https://mws-eu.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01
Login API URL
https://api.sandbox.amazon.co.uk
Profile API URL
https://api.sandbox.amazon.co.uk/user/profile

You can set up your Notification endpoints in Seller Central on the Settings > Integration Settings page.

Requirements for PHP are:
  • PHP 5.3 or higher
  • Curl 7.18 or higher
Find more information on setup in the Amazon Pay PHP SDK (https://github.com/amzn/amazon-pay-sdk-php). Here is an example of how to set the configuration while instantiating the Client object. Note that the Sandbox parameter defaults to false if not specified.

<?php namespace PayWithAmazon;

$config = array(
	'merchant_id'   => 'YOUR_MERCHANT_ID',
	'access_key'   => 'YOUR_ACCESS_KEY',
	'secret_key'   => 'YOUR_SECRET_KEY',
	'client_id'   => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
  	'region'   => 'REGION', // set to DE for German integrations
	'sandbox'   => true
);

$client = new Client($config);

// Also you can set the sandbox variable in the config() array of the Client class by
$client->setSandbox(true);
Requirements for Python are:
  • Python 3.2 or higher
  • pyOpenSSL 0.11 or higher
  • Requests 2.6.0 or higher
Find more information on setup in the Amazon Pay Python SDK (https://github.com/amzn/amazon-pay-sdk-python).

See also