Giter Club home page Giter Club logo

merchant-sample-java's Introduction

Token Merchant Checkout Sample: Java

This sample code shows how to enable the Token Merchant Checkout experience on a simple web server. You can learn more about the Quick Checkout flow and relevant APIs at the Merchant Quick Checkout documentation.

To build this code, you need Java Development Kit (JDK) version 8 or later.

To build, ./gradlew shadowJar.

To run, java -jar app/build/libs/app-*.jar

This starts up a server.

The first time you run the server, it creates a new Member (Token user account). It saves the Member's private keys in the keys directory. In subsequent runs, the server uses this ID these keys to log the Member in.

The server operates in Token's Sandbox environment. This testing environment lets you try out UI and payment flows without moving real money.

The server shows a web page at localhost:3000. The page has a checkout button. Clicking the button starts the Token merchant payment flow. The server handles endorsed payments by redeeming tokens.

Test by going to localhost:3000. You can't get far until you create a customer member as described at the Merchant Quick Checkout documentation.

This code uses a publicly-known developer key (the devKey line in the initializeSDK method). This normally works, but don't be surprised if it's sometimes rate-limited or disabled. If your organization will do more Token development and doesn't already have a developer key, contact Token to get one.

Troubleshooting

If anything goes wrong, try to clear your browser's cache before retest.

merchant-sample-java's People

Contributors

lahosken avatar ab666 avatar vkcr avatar yuhan-token avatar grekinsky avatar mariano54 avatar colin-token avatar grace09thompson avatar

Watchers

James Cloos 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.