Author Topic: Amazon Login and Pay  (Read 3142 times)

Offline flyn

  • Full Member
  • ***
  • Posts: 142
  • Karma: +8/-0
    • View Profile
Amazon Login and Pay
« on: November 24, 2014, 11:56:24 AM »
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>
                 

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4251
  • Karma: +278/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

 

Powered by SMFPacks Social Login Mod