Code Monkey home page Code Monkey logo

web-payments-example's Introduction

Web Payments Example

Demo for Payment Request API and Apple Pay for the Web https://lab.tridnguyen.com/web-payments-example/.

To see Payment Request API, use Chrome on Android version 53 or later.

To see Apple Payfor the Web in action, use Safari on iOS 10 or macOS Sierra (please note that you'd need to have Apple Pay enabled on your phone, and "Allow Payments on Mac" enabled for desktop use).

Set up Apple Pay merchant account

If you'd like to have your own instance of this running, follow the steps below:

  1. Create an Apple Developer Account (at https://developer.apple.com)

  2. Create a Merchant ID (see Configuring Your Environment)

    To generate the Payment Processing Certificate on your own, run the following steps

    openssl ecparam -out private.key -name prime256v1 -genkey
    openssl req -new -sha256 -key private.key -nodes -out request.csr
  3. In the "Apple Pay on the Web" section, "Add Domain" under "Merchant Domains" and follow the instruction to verify your domain ownership

  4. Under "Apple Pay Merchant Identity", click on "Create Certificate".

  5. In order to create the Certificate Signing Request(CSR), run the following command (make sure you have openssl installed).

    openssl req -sha256 -nodes -newkey rsa:2048 -keyout applepaytls.key -out applepaytls.csr
  6. Upload the applepaytls.csr file to the File Upload in the Apple Developer portal.

  7. Store the applepaytls.key file to the server/resources directory.

  8. With the merchant_id.cer file received from Apple, run the following command to generate a .pem file.

    openssl x509 -inform der -in merchant_id.cer -out applepaytls.pem
  9. Store the applepaytls.pem file to the server/resources directory.

  10. Start the application

    npm start

web-payments-example's People

Contributors

tnguyen14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

web-payments-example's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Payments possibilities

Hi, I looked at your examples. And on mobile phone it is pretty impressive.

I have some questions about apple pay.
Is that possible to request "only" payment and send later the payment request ? I would like to charge my users depending of a time of consumption of my service but be sure that users will pay.

Another point how can I modify the return URL ? Is that possible to let access of the "final" page until a payment is active ?

Many thanks for that previsions and for your formidable works.

forever start server/index.js && forever logs -f 0

Hi, thanks for your project,

Please kindly help, what's wrong ?

[email protected] start /var/www/html/apple-pay-web-example
forever start server/index.js && forever logs -f 0

sh: forever: команда не найдена
npm ERR! [email protected] start: forever start server/index.js && forever logs -f 0
npm ERR! sh "-c" "forever start server/index.js && forever logs -f 0" failed with 127
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the apple-pay-web-example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! forever start server/index.js && forever logs -f 0
npm ERR! You can get their info via:
npm ERR! npm owner ls apple-pay-web-example
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-042stab116.2
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! cwd /var/www/html/apple-pay-web-example
npm ERR! node -v v0.10.4
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/www/html/apple-pay-web-example/npm-debug.log
npm ERR! not ok code 0

Not able to run

Hi,

I am trying to run this project on Azure site. I have followed the instructions from ReadMe.Md file and deployed the code to azure. I also ran the 'npm start' commend on the same directory where the code is deployed in azure through DebugConsole. but it is showing errors.

Also, when i am clicking on the "Apple Pay" button (below sunglass), the action sheet is showing up for 3-4 seconds and getting minimized in 3-4 seconds without any reason. Action sheet is showing Processing icon but now moving further.

Is there a need to change the env file? what all other changes i need to do in which files? Can you share some sample values?

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.