Guides
API ReferenceChangelog
Guides
API ReferenceChangelog
  1. Libraries
  • Getting Started
    • Overview
    • Test Data
    • Integrating Collect
    • Idempotent Requests
  • Payment
    • Payment Methods
    • Webhooks
    • Payment Methods
      • Direct Debit/Online Banking
      • Wallets
      • Cards
      • Crypto
  • Libraries
    • Collect.js
    • WooCommerce Plugin
  • Core Concepts
    • Collect Account Structure
    • Payment Flow
  • Terminal
    • Create Terminal Request
    • Overview
    • Get Terminal Request
    • Get Terminal Requests
    • Get Assigned Terminals
    • Get Assigned Terminal
  1. Libraries

Collect.js

Collect.js enables you to embed Collect's checkout into your web application, allowing your users to choose their preferred payment method and be redirected to its authorization process without needing to go into Collect's hosted checkout.
How to implement Collect.js
Collect.js is a library for implementing the Collect widget - the Collect widget is a safe and secure web drop-in module that provides a simple interface for users to select their preferred payment method during checkout.
Before getting started
Retrieve your Client Public API Keys.
Create a sandbox customer, so you can get connecting immediately.
Installing
Using npm:
Using yarn:
Using CDN:
Usage
For JS frameworks, import it and use;
For others, just use;
Collect Widget Options
NameTypeRequiredDefault ValueDescription
emailStringtrueEmail address.
firstNameStringtrueFirst name.
lastNameStringtrueLast name.
referenceNumbertrueUnique transaction reference
amountNumbertrueAmount to charge.
currencyStringfalseNGNProcessing currency
itemImageString(URL)falseURL for item image
publicKeyStringtrueThe Collect public api key.
logoString(URL)falseCollect's Logo
callbackUrlString(URL)false
onSuccessfalseAction to perform after widget is successful
onClosefalseAction to perform after widget is closed
onErrorfalseAction to perform on widget Error
beforeClosefasleAction to perform before widget close
Previous
Crypto
Next
WooCommerce Plugin
Built with