Skip to main content
The Orchestra Payments Library displays payment buttons and handles the payment UI. It supports card entry, Apple Pay, Google Pay, PayPal, bank payments, and UPI.
Available on npm as bluetime-ewallet.

Installation

npm install bluetime-ewallet

Data Flow

Payments Library Data Flow
  1. Your server creates a session via the Orchestra API
  2. You pass the session token to the client-side library
  3. The library returns available payment methods for this device/browser
  4. You specify which buttons to display and where
  5. Customer clicks a button and completes payment in a popup
  6. Results are returned to your callback
  7. Your server validates the results with Orchestra

Quick Start

1. Initialize the Engine

import * as eWallet from 'bluetime-ewallet';

const engine = new eWallet.Engine(sessionToken);
The sessionToken comes from your backend via POST /EWalletOperations.

2. Check Available Payment Methods

const available = await engine.checkAvailability();
// Returns: ["CardPay", "GooglePay", "PayPal", ...]

3. Display Buttons

Add container elements to your HTML:
<div id="card-button"></div>
<div id="gpay-button"></div>
<div id="paypal-button"></div>
Render buttons for available methods:
const buttons = [
  { name: 'CardPay', domEntitySelector: '#card-button' },
  { name: 'GooglePay', domEntitySelector: '#gpay-button' },
  { name: 'PayPal', domEntitySelector: '#paypal-button' }
].filter(btn => available.includes(btn.name));

engine.payBy(buttons, handleResult, undefined);

4. Handle Results

function handleResult(result) {
  if (!result) {
    console.log('Payment cancelled');
    return;
  }

  // Send token to your backend for validation
  fetch('/api/validate-payment', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ token: result.token })
  });
}

Payment Methods

ValueDescriptionAvailability
"CardPay"Credit/debit card formAll browsers
"GooglePay"Google PayChrome, Android
"ApplePay"Apple PaySafari, iOS, macOS
"PayPal"PayPal checkoutAll browsers
"BankPay"Bank transfer (Open Banking, ACH)All browsers
"UPI"Unified Payments InterfaceAll browsers

What’s Next