Coder Social home page Coder Social logo

paywithamazon's Introduction

Mozu Pay with Amazon Application using Arc.js

Version 1.0.0 - Hosted Workflow

The Pay with Amazon Application by Mozu uses the Arc.js framework to create custom actions that enable the use of the Amazon Payments service on the Mozu platform. This app uses the Amazon Marketplace Web Service (MWS) API to connect Mozu with Amazon.

Note: The code in this repository is provided for reference purposes only. If you are a Mozu customer and want to enable Pay with Amazon functionality on your storefront, you can simply install the Pay with Amazon Application by Mozu from the Mozu App Marketplace and integrate the required theme changes.

Amazon Security Requirements

This application is implemented using a hosted workflow that protects a merchant from having to share their AWS Secret Key. Amazon requires that merchants never share their Secret Key, and provides the MWS Authorization Token as an alternative method for third-party application developers to access a client’s MWS account. The merchant-flow branch of this repo shows an alternative implementation that in-house application developers can use.

Requirements for Developing with Arc.js

In order to work with Arc.js, you'll need to have:

  • A Developer Account at mozu.com
  • Arc.js enabled on your Mozu tenant. (Contact your sales or professional services representative for more information.)
  • NodeJS
  • The following global NPM packages installed
    • yo
    • grunt-cli
    • generator-mozu-app You can install all of the required NPM packages at once by running the following command in your Terminal (OS X) or Command Prompt (Windows):
    npm i -g yo grunt-cli generator-mozu-app

Clone and Upload the App

  1. First, clone this repository to a folder on your development machine:

    $ git clone https://github.com/Mozu/PayWithAmazon.git
    
    Cloning into './PayWithAmazon'...
    done.
  2. Log in to the Mozu Developer Center and create a new app. Call it "PayWithAmazon". Make a note of its Application Key.

  3. Now you're prepared to generate your upload configuration! Have on hand:

    • The application key for the app you just created
    • Your Developer Center login Got those? OK, in your PayWithAmazon directory you cloned from Git, run:
    $ yo mozu-app --config

    You will be prompted to enter all the necessary information.

  4. Once that is complete, you should be able to run npm install:

    $ npm install

    to download the necessary dependencies.

  5. You're ready to sync! Run grunt:

    $ grunt

    to upload the actions to Developer Center. Or, if you want grunt to detect when you change files and upload continuously as you work, run:

    $ grunt watch

Install the App

Now that you've uploaded the code to your PayWithAmazon app, it's ready to install in your sandbox!

  1. In Mozu Dev Center, go to Develop > Applications and double-click the app.
  2. On the app details page, click Install.
  3. Select your sandbox in the dialog that appears and click OK.

If the install process fails at this point, check with Mozu Support to make sure that the Arc.js framework is enabled for your sandbox.

Configure Your Pay with Amazon Settings in Mozu Admin

In the sandbox where you installed the app, go to Settings > Payment & Checkout.

You should see a new option for PayWithAmazon. Enable the checkbox to view the Amazon configuration settings. Pay with Amazon requires the following default settings for the app to work:

  • SellerId
  • Client Id
  • Application Id
  • MWS Auth Token
  • AWS Region
  • Order Processing

These settings are defined in the following file in your application: assets/src/domains/platform.applications/embedded.platform.applications.install.js

You can modify this file to add additional settings.

Merge Theme Changes

Installing and configuring the Pay with Amazon app enables you to accept payments via Amazon Payments. However, you still must enable Pay with Amazon functionality on your storefront so that customers can use it. Go to the PayWithAmazon-Theme repository and follow the instructions in the readme to merge Pay with Amazon functionality with your Mozu theme.

Payment Code Actions

The following are the actions for which embedded.commerce.payments.action.performPaymentInteraction is invoked:

  • CreatePayment
  • AuthorizePayment
  • CapturePayment
  • CreditPayment
  • DeclinePayment
  • Rollback
  • VoidPayment

After the payment interaction has been processed, one of the following states can be passed back to the system:

  • Authorized
  • Captured
  • Declined
  • Failed (set this state to terminate payment flow)
  • Voided
  • Credited
  • New
  • RolledBack

paywithamazon's People

Contributors

sanjaymandadi avatar rakesh-dontula avatar cmmacleod avatar matthew-dyer avatar kibo-sonalsatpute avatar

Stargazers

Angela Molock avatar

Watchers

 avatar Vital Vinahradau avatar Anup Kesavan avatar James Cloos avatar Paul.Theron avatar  avatar Travis Johnson avatar  avatar Aaron Jones avatar Jonathan Roeder avatar  avatar  avatar Ferry Chahaya (Volusion) avatar  avatar Bob Hewett avatar kevin sproles avatar  avatar Sumit Thomas avatar  avatar Scott avatar Brian Bonnet avatar Sergio Torres avatar Ethan Thacker avatar  avatar  avatar Kevin Brown avatar  avatar Travis Patrick avatar  avatar Angela Molock avatar Elena avatar  avatar  avatar  avatar  avatar Sandesh Doddamane avatar  avatar

Forkers

gaurav2728

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.