Skip to main content

Payment.js library

Developers who want to handle payments off-platform or collect payment information themselves can use AppDirect's payment.js library to build their own payment method solutions. The library supports marketplaces on which AppDirect itself is the identity provider (IdP), as well as marketplaces that use external IdPs integrated with AppDirect.

This document describes how to use payment.js to create payment methods on the AppDirect platform. There are two ways to do so, depending on your authorization scenario:

  • Use a public developer key to obtain a token, and create a payment method using the token.
  • Use a user-scoped client token to create a payment method by sending payment method information to the platform directly.

The payment.js library is the first component of a larger AppDirect.js library, which will include checkout item and shopping cart JavaScript libraries as well. The complete AppDirect.js library will enable developers to implement a complete off-platform checkout experience.

Was this page helpful?