Git Product home page Git Product logo

paymenthighway-applepay-web-demo's Introduction

Integrate Apple Pay to a React App

This is a simple React app example to demonstrate how to integrate Apple Pay to a React App using Payment Highway.

The demo by default use the Apple Pay JS API.

Changing the env variable REACT_APP_PAYMENT_REQUEST_API the Payment Request API are used instead.

Configure Your Enviroment

  1. Register your Mechant ID in your Apple Developer account
  2. Create a Payment Processing Certificate
    • Request a Certificate Signing Request (CSR) from [email protected] for Apple Pay on your site or app.
    • Sign the CSR in your Apple Developer account and send the Apple Pay Payment Processing Certificate to us.
  3. Create Merchant Identity Certificate
  4. Register and verify your domain
    • Download Merchant Identity Domain Association to be incorporated in your web site
  5. Payment Highway must be configured accordingly
  6. Make an Apple Pay debit request to us to charge the card in the Payment Data received from Apple.

for more info Apple Pay documentation

Configuration

For the client configuration add a file .env in the root of the project with the following variables:

REACT_APP_MERCHANT_ID='Your merchant id'
REACT_APP_MERCHANT_DISPLAY='Your merchant display'
REACT_APP_API_URL='https://your.api.base.url'
REACT_APP_PAYMENT_REQUEST_API=no

Getting Started

Install dependencies:

$ yarn install

Deploy app to S3 bucket

$ yarn deploy-s3

Demo mode

Adding the variable REACT_APP_DEMO_STEPS=yes in the .env file the ShoppingCartStepByStep.js is used for demo purpose.

Open the file ShoppingCartStepByStep.js and follow the instructions:

  • Step 1: Show the Apple Pay Button
  • Step 2: Perform Apple Pay Payment

AWS Lambdas

In the repository paymenthighway-merchant-backend-demo you can find the server implementation for the demo.


References

Payment Highway API documentation

Getting Started with Apple Pay

Apple Pay on the web

Apple Pay JS API

Payment Request API (W3C)

Introducing the Payment Request API for Apple Pay

paymenthighway-applepay-web-demo's People

Contributors

stepiro avatar

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.