Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
App_Start
Content
Controllers
Properties
Scripts
Views
.gitignore
Global.asax
Global.asax.cs
README.md
Web.Debug.config
Web.Release.config
Web.config
merchant-sample-csharp.csproj
merchant-sample-csharp.sln
packages.config

README.md

Token Merchant Checkout Sample: C#

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.

Requirements

On Windows

There are no prerequisites for Windows.

On Linux and OSX

Install Mono from here.

Mono is an open source implementation of Microsoft's .NET Framework. It brings the .NET framework to non-Windows envrionments like Linux and OSX.

Build and Run

To build

nuget restore

msbuild

To run

xsp4 --address=localhost --port=3000

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.

You can’t perform that action at this time.