News:

AbanteCart v1.4.2 is released.

Main Menu

Amazon Login and Pay

Started by flyn, November 24, 2014, 11:56:24 AM

Previous topic - Next topic

flyn

I asked this awhile back I believe but I will ask here. Is there a way to get this to work with the cart system?

They provide code snippet like below. I just have to change and put our account info in there. I want to test this at least.

What file should I edit to test this on the cart and where in the file should I place this?

Thank You

<head>
  <script type='text/javascript'>
    window.onAmazonLoginReady = function() {
      amazon.Login.setClientId('YOUR_CLIENT_ID_HERE');
    };
  </script>
  <script type='text/javascript'
src='https://static-na.payments-amazon.com/OffAmazonPayments/us/js/Widgets.js?sellerId=YOUR_SELLER_ID_HERE'>
  </script>
</head>

<!-- Place this where you would like the Payment Button to appear -->
<div id="AmazonPayButton"></div>
<script type="text/javascript">
  var authRequest;
  OffAmazonPayments.Button("AmazonPayButton", "YOUR_SELLER_ID_HERE", {
    type:  "PwA",
    color: "Gold",
    size:  "medium",
    useAmazonAddressBook: true,
    authorization: function() {
      var loginOptions = {scope: 'profile payments:widget'};
      authRequest = amazon.Login.authorize(loginOptions, "YOUR_REDIRECT_URL_HERE");
    },
    onError: function(error) {
      // Write your custom error handling
    }
  });
</script>
                 


Forum Rules Code of conduct
AbanteCart.com 2010 -