Skip to main content
This guide walks you through creating a sandbox account, setting up mock payment gateways, and making your first test charge. No external payment provider accounts required.
This quickstart uses Orchestra’s built-in mock payment gateways for immediate testing. When you’re ready for production, see Add a Payment Provider.

Setup

1

Create Orchestra Account

2

Generate API Key

Create an API key to authenticate your requests:
  1. Click your username in the top-right corner
  2. Select API Keys > Create
  3. Enter a Name for the key (e.g., “Development”)
  4. Ignore the User setting for now
  5. Click Save
  6. Copy the key immediately - you won’t see it again
Copy the key now - you won’t be able to view it again.
3

Create Mock Payment Gateway Accounts

Mock PSPs are test gateways that return predictable success or failure responses regardless of input. They let you test both code paths without external payment provider accounts. See the Mock Payment Gateways guide for details on limitations and capabilities.
Set up test gateways in the Portal:Success Gateway:
  1. Go to Resources > Payment Gateway Account > Create
  2. Name: test-success
  3. Gateway: NULLSuccess
  4. Click Save
Failure Gateway (for testing):
  • Name: test-failure
  • Gateway: NULLFailure

Choose Your Approach: Payments Library or REST API

Payments Library

Use when: Customers enter cards in your frontend. Pre-built UI, reduced PCI scope, supports digital wallets (Apple Pay, Google Pay).Demonstrates:
  • Session creation
  • Frontend integration with payment buttons
  • Result validation

REST API

Use when: You collect card details on your backend. Full control, mobile apps, recurring payments, custom flows.Demonstrates:
  • Basic charges
  • Tokenization for PCI scope reduction

1. Create eWallet Account

Create an eWallet Account in the Portal:
  1. Go to Resources > eWallet Accounts > Add Account
  2. Name it test-ewallet
  3. Select the eWallet Type to be “CardPay”
  4. Set Merchant Identifier to be [your_company_name].com.orchestrasolution
  5. Set Merchant Display Name to be your company name
  6. Disregard for now all other fields
  7. Click Save

2. Install Library

npm install bluetime-ewallet

3. Create Session (Backend)

curl --location 'https://api.orchestrasolutions.com/EWalletOperations' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "operation": "CHARGE",
  "PaymentGatewayAccountId": "test-success",
  "AllowedeWalletAccountIds": ["test-ewallet"],
  "mode": "TEST",
  "CurrencyCode": "USD",
  "CountryCode": "US",
  "Amount": "2.56",
  "AllowedBrands": ["VISA", "MASTERCARD"]
}'

4. Display Payment Button (Frontend)

<div id="card-button"></div>
import { BluetimeEWallet } from 'bluetime-ewallet';

// Initialize with JWT from backend
const engine = new BluetimeEWallet(jwt);
await engine.initialize();

// Check available payment methods
const available = await engine.checkAvailability();

// Display card payment button
engine.payBy(
  [{ name: 'CardPay', domEntitySelector: '#card-button' }],
  handleResult,
  undefined
);

function handleResult(result) {
  if (result.status === 'SUCCESS') {
    const [data] = engine.parseResultToken(result.token);
    console.log('Payment successful:', data);
    // Send result.token to backend for validation
  }
}
This is where credit card details are submitted on the frontend. The Payments Library handles card collection and tokenization, keeping sensitive data out of your backend code.

5. Validate Result (Backend) - Optional

Validate the result token received from Orchestra on the client side and passed to your server. This ensures the token wasn’t altered between the client and server.
curl --location 'https://api.orchestrasolutions.com/EWalletOperations/validate' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "token": "RESULT_TOKEN_FROM_FRONTEND"
}'

🎉 You’re In!

You just completed an Orchestra integration using the Payments Library with mock PSPs. These examples demonstrate Orchestra’s key capabilities without requiring external payment provider accounts.Ready for production? See Add a Payment Provider to configure real gateways. Your code stays the same - just swap the gateway account names.

What’s Next