Amazon payment gateway
I am doing one project,
For this, my client asked the amazon payment gateway,
So now I started looking into amazon payment gateway,
This is the first time I watch amazon payment gateway,
I have registered with amazon payment gateway,
Please tell me the PHP CODE snippet for Amazon payment gateway,
thanks
a source to share
Amazon has different payment products. Checkout by Amazon is their regular product, but it works best for products that you send by mail. SimplePay is probably best for electronic products and services that I discovered too late. Make sure you subscribe to the correct thing. :)
Here's the PHP code for the Pay Now button for a single item using the POST form:
// Key from Amazon
$merchant_id = 'your_id';
$aws_access_key_id = 'your_access_key';
$aws_secret_access_key = 'your_secret_access_key';
// Set up cart
$form['aws_access_key_id'] = $aws_access_key_id;
$form['currency_code'] = 'USD';
$form['item_merchant_id_1'] = $merchant_id;
$form['item_price_1'] = $price;
$form['item_quantity_1'] = $quantity;
$form['item_sku_1'] = $sku;
$form['item_title_1'] = $item_name;
ksort($form);
// Encode order as string and calculate signature
$order = '';
foreach ($form as $key => $value) {
$order .= $key . "=" . rawurlencode($value) . "&";
}
$form['merchant_signature'] = base64_encode(hash_hmac('sha1', $order, $aws_secret_access_key, true));
// Return string with Amazon javascript and HTML form
// Assumes you already have jQuery loaded elsewhere on page
// URL link to live site, not sandbox!
$amazon_order_html =
'<script type="text/javascript" src="https://images-na.ssl-images-amazon.com/images/G/01/cba/js/widget/widget.js"></script>
<form method="post" action="https://payments.amazon.com/checkout/' . $merchant_id . '">';
foreach ( $form as $key => $value ) {
$amazon_order_html .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />';
}
$amazon_order_html .= '<input alt="Checkout with Amazon Payments" src="https://payments.amazon.com/gp/cba/button?ie=UTF8&color=orange&background=white&cartOwnerId=' . $merchant_id . '&size=large" type="image"></form>';
return $amazon_order_html;
a source to share
For easy payment, when creating an account, the user will be given access to a sandbox where you will find the "Seller ID" at this URL: https://sandbox.simplepay.hu/admin/partner/account/id(partnerid)
a source to share