Skip to content

Instantly share code, notes, and snippets.

@adrianhopebailie
Last active June 14, 2017 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianhopebailie/90c0214fe314a374f539379000cad9dc to your computer and use it in GitHub Desktop.
Save adrianhopebailie/90c0214fe314a374f539379000cad9dc to your computer and use it in GitHub Desktop.

ILP-Kit - Web Payment App

The W3C Web Payments working group have published a specification for web-based payment apps, web applications that can handle Payment Requests from other web applications.

The Editor's Draft (latest version) of the specification for the Payment Handler API is at https://w3c.github.io/payment-handler/

Thus far only Google have implemented this specification in the latest version of Chrome Canary for Android. Other browsers are expected to follow.

There is a rudimentary example of a web-based payment app here: https://github.com/madmath/payment-request-show/tree/master/bobpay/public/pay

What does this mean?

An ILP-Kit user can register their own ILP-Kit (or an ILP-Kit on which they hold an account) as a payment handler in their browser. When this user visits any website that uses the Payment Request API and accepts payments via Interledger as the payment method they will be prompted to pay from their own ILP-Kit.

If they choose to pay using their ILP-Kit a new window will open where they can approve the payment and it will be sent using their ILP-Kit and the fulfillment will passed back to original calling website.

Stories

1 - Register

As an ILP-Kit user I want to register my ILP-Kit as a payment app in my browser.

  • Check user is logged in
  • Check for Payment Handler API support
  • Register payment handler

2 - Accept Payments

As an ILP-Kit user I want to host a pay URL that users can visit to make payments to me.

  • If ILP-Kit URL is http://ilpkit.example.com then host a payment page by default at http://ilpkit.example.com/pay/ that is for the admin and another at http://ilpkit.example.com/pay/{user} for each user with an account on the kit.
  • Simple form to enter amount, message and button to initiate payment
  • If Payment Request API is available and can make payment using Interledger then call API when button is clicked
  • If not ???
  • Accept query string parameters to pre-populate amount and message
http://ilpkit.example.com/pay/bob?amount=10&memo=dinner

3 - Make payment

As a user with an Interledger capable payment app installed I want to visit another user's pay URL and pay them

  • Visit pay URL and click "Pay"
  • Interledger capable payment app (ILP-Kit of user) presented as option and selected
  • Payment app uses SPSP URL to get Payee details and perform quote
  • Prompt user to confirm payment and then execute
  • Return tx id to pay URL webpage in API response
  • Pay URL webpage get status of tx and displays to user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment