Skip to content

Documentation & Samples to support polyright payment with Payment Terminal from URI Scheme.

License

Notifications You must be signed in to change notification settings

polyright/PaymentTerminal-URI-Scheme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polyright payment - URI Scheme Integration

The polyright PaymentTerminal application allows payments on any polyright system through the polyright platform. The application is available for desktop, tablet and smartphone.

Getting Started

Prerequisites

  • RFID or NFC reader
  • Internet connection
  • Compatible platforms:
    • Windows 10.0.17763 (1809)
    • Android 5.0
    • iOS 14 (coming soon)

Installation

  1. Install application from App Store
  2. Launch application
  3. Activate Payment Terminal
  4. Ready!

Integration

URI Scheme is supported by Payment Terminal to allow simplified integration of polyright payment from other applications and websites. For full integration and best user experience, use the REST API and CardReader SDK provided by polyright.

Supported URI Schemes

URI Scheme Description
pay://transaction Start a new transaction
pay://transaction/validate Validate the current transaction
pay://transaction/cancel Cancel the current transaction
Parameters
Parameters Description
amount Amount with point as decimal separator
purpose Transaction description for the end user
externalId Your transaction ID. This must be unique
paymentMode Enabled payment modes. Remains empty to enable all supported payment modes.
Supported modes:
  • Epurse: polyright electronic wallet
  • Twint: Swiss mobile payment mode
validationCallback URI Scheme called to validate transaction when person was found. This allows you to apply a discount before processing the transaction by Payment Terminal.
The properties of the person are added as Query String of the URI Scheme
successCallback URI Scheme called when the transaction was successfully processed
cancelCallback URI Scheme called when the transaction was cancelled
errorCallback URI Scheme called when an error occurred while processing the transaction

Sequence diagrams





Callbacks

Callbacks are used by the payment terminal to send the result back of operations to calling application. It can be done through URI Scheme of an application or a URL of a web page. Results are passed as Query String in the URI.

Allowing callbacks in an application

Examples

  • Start a payment transaction with any payment mode (Polyright card or TWINT):
    pay://transaction?amount=-4.25&successCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?success&cancelCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?cancel&errorCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?error
  • Start a payment transaction with TWINT:
    pay://transaction?amount=-4.25&paymentMode=Twint&successCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?success&cancelCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?cancel&errorCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?error
  • Start a payment transaction with TWINT which data has to be validated:
    pay://transaction?amount=-4.25&paymentMode=Twint&validationCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?validation&successCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?success&cancelCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?cancel&errorCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?error
  • Validate current transaction defining a new amount (discount):
    pay://transaction/validate?amount=-3.15&paymentMode=Twint&successCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?success&cancelCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?cancel&errorCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?error
  • Cancel current transaction:
    pay://transaction/cancel?successCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?success&cancelCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?cancel&errorCallback=https://polyright.github.io/PaymentTerminal-URI-Scheme/samples/html/basic.html?error

Samples

HTML

This simple web page shows how to start a transaction and receive the result from the callback URL

FAQ

Why the application does not launch from Google Chrome?

This is a bug in Google Chrome, try:

  1. Close Google Chrome application and system tray
  2. Open %LOCALAPPDATA%\Google\Chrome\User Data\Profile 1\Preferences file
  3. Search excluded_schemes section
  4. Add "pay":false
  5. Save and launch sample
  6. Done!

About

Documentation & Samples to support polyright payment with Payment Terminal from URI Scheme.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •