PAYMENTHUB · DEVELOPER PLATFORM / PRELIMINARY v0.9

Build with PaymentHub.

One orchestration architecture. Merchant integration, payment lifecycle, billing, security, SDKs and production readiness. Preview guides distinguish implemented contracts from planned capabilities.

Implemented diagnostic client · deployment verification required

Quick start

Start in the merchant console. Sign in, select your own merchant account and open PaymentHub Connect. Check commercial access and provider capabilities independently.

Use the SDK with the HTTPS readiness URL supplied by your administrator. A successful HTTP response does not prove that a merchant can accept LIVE payments. Read the explicit state, checks and blockers.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Architecture target

Core architecture

PaymentHub owns the orchestration policy, merchant lifecycle, routing rules and normalized operational records. PayOptimum provides the management interface. Angel 2.0 supervises operations.

Provider adapters execute authorized financial operations. Card capture and tokenization remain in provider-hosted fields. Stripe tokens are not assumed portable to another processor. Existing subscriptions must continue during migration.

Existing connection flow · provider approval required

Connect and merchant onboarding

Open PaymentHub Connect from the merchant console and authorize a provider. Never share credentials in the browser, email or logs. OAuth consent belongs to the merchant. The server must bind the returned account to the authenticated owner.

Refresh capabilities before routing. Card payments and payouts are distinct provider capabilities; an enabled flag is not bank settlement evidence. PayPal and native PayFlow merchant collection integration are not yet verified.

// Existing authenticated Base44 integration. Pass the app's authenticated SDK client.
export async function readMerchantFinance(base44,merchantId) {
  const {data}=await base44.functions.invoke('payflowStripeFinance',{scope:'merchant',merchant_id:merchantId||undefined});
  if(data?.state!=='ok'||data.scope!=='merchant'||data.environment!=='live')
    return {state:data?.state||'unavailable',report:null};
  return {state:'ok',report:data};
}
export async function readCommercialAccess(base44) {
  const {data}=await base44.functions.invoke('payflowConnectCheckout',{action:'entitlements'});
  if(data?.state!=='ok') throw new Error('ACCESS_UNVERIFIED');
  return data.products;
}
export async function readConnection(base44) {
  const {data}=await base44.functions.invoke('payflowStripeConnectLive',{action:'sync'});
  if(data?.state!=='ok') return {state:data?.state||'unavailable'};
  return {state:'ok',cards:data.card_payments_active===true&&data.charges_enabled===true,payouts:data.payouts_enabled===true};
}

Integration requirements

Authentication and API keys

Authenticate merchants server-side and derive their identity from the session rather than request parameters. Scope API keys to the merchant and environment, rotate and revoke them, and store secrets in server-side secret management.

Do not send platform keys to customers. The preview readiness SDK requires no provider secret. A public merchant API key issuance and authorization contract is not yet released.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Source preview 0.1.0

SDKs and installation

Node.js 20+ uses native fetch; TypeScript definitions accompany the ECMAScript module. Python 3.10+ uses the standard library. Download the actual source files below.

No npm or PyPI registry release is claimed. Current methods are read-only. Payment creation, refunds and payouts are not exposed by these clients.

/** PaymentHub SDK v0.1.0 — read-only readiness client. */
export class PaymentHub {
  constructor({endpoint, fetcher=globalThis.fetch, timeout=10000}={}) {
    const url=new URL(endpoint);
    if(url.protocol!=='https:' || url.username || url.password) throw new TypeError('HTTPS endpoint required');
    this.endpoint=url.href; this.fetcher=fetcher; this.timeout=timeout;
  }
  async readiness() {
    const r=await this.fetcher(this.endpoint,{headers:{Accept:'application/json'},signal:AbortSignal.timeout(this.timeout),redirect:'error'});
    const data=await r.json();
    if(!data || typeof data.state!=='string') throw new Error('Invalid PaymentHub response');
    if(!r.ok) throw Object.assign(new Error('PaymentHub readiness unavailable'),{status:r.status,state:data.state});
    return data;
  }
}

Migration target · no new LIVE certification

Checkout and hosted card fields

Build an order on your server, calculate currency and amount from trusted catalogue data and bind the order to the merchant. Hosted card fields collect card data directly for the chosen provider. Do not transmit PAN or CVC through PaymentHub servers.

Complete required customer authentication such as 3-D Secure. A browser return is not evidence of payment. Only verified provider confirmation may mark the order paid.

Design contract · not a public API

Payment lifecycle

Model created, awaiting customer action, processing, succeeded, failed and cancelled states. Record capture, refund and dispute events separately. Use a server-generated transaction identifier and retain the provider reference.

Store amounts in integer minor units and currency as ISO code. Keep provider status distinct from internal order state. Never present simulated amounts as live revenue.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Architecture target

Intelligent routing and recovery

Filter providers by merchant authorization, payment method, currency and environment before choosing a circuit. Prefer verified availability and permitted cost policy. Do not route Stripe tokens to an incompatible processor.

On timeout or unknown outcome, reconcile the original attempt before trying another provider. Use idempotency per merchant and order; do not retry a potentially successful charge on another circuit.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Existing commercial policy · migration in progress

Billing and subscriptions

Eligible merchants receive a 14-day trial with commercial access, subject to provider approval. Billing begins after the trial with customer consent. Unpaid or expired access blocks new charge creation, not historical records or existing funds.

Current subscription evidence is sourced from the existing Stripe platform billing integration. The PaymentHub access module evaluates the policy; independent billing migration is not complete.

// Existing authenticated Base44 integration. Pass the app's authenticated SDK client.
export async function readMerchantFinance(base44,merchantId) {
  const {data}=await base44.functions.invoke('payflowStripeFinance',{scope:'merchant',merchant_id:merchantId||undefined});
  if(data?.state!=='ok'||data.scope!=='merchant'||data.environment!=='live')
    return {state:data?.state||'unavailable',report:null};
  return {state:'ok',report:data};
}
export async function readCommercialAccess(base44) {
  const {data}=await base44.functions.invoke('payflowConnectCheckout',{action:'entitlements'});
  if(data?.state!=='ok') throw new Error('ACCESS_UNVERIFIED');
  return data.products;
}
export async function readConnection(base44) {
  const {data}=await base44.functions.invoke('payflowStripeConnectLive',{action:'sync'});
  if(data?.state!=='ok') return {state:data?.state||'unavailable'};
  return {state:'ok',cards:data.card_payments_active===true&&data.charges_enabled===true,payouts:data.payouts_enabled===true};
}

Integration target

Customers and CRM

Associate customer identifiers with the owning merchant. Never use email alone as an authorization boundary. Keep CRM records separate from card tokens and financial records.

HubSpot synchronization must be consent-aware, scoped and idempotent. Do not export secrets, card data or another merchant’s customers.

Design contract · no public write endpoint

Refunds and disputes

Verify transaction ownership and captured amount. Calculate refundable remainder after previous refunds. Send an idempotent request to the original provider; never refund more than the captured amount.

Reconcile provider confirmation and disputes. Keep a complete audit trail. Do not treat a pending refund as settled.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Provider reporting only · execution not certified

Payouts and settlements

The provider governs payout destination, timing and eligibility. PaymentHub aims to reconcile provider payouts against bank settlement without holding merchant funds.

Separate available, pending, paid and failed states. Do not combine currencies or claim bank receipt solely from a provider payout status.

// Existing authenticated Base44 integration. Pass the app's authenticated SDK client.
export async function readMerchantFinance(base44,merchantId) {
  const {data}=await base44.functions.invoke('payflowStripeFinance',{scope:'merchant',merchant_id:merchantId||undefined});
  if(data?.state!=='ok'||data.scope!=='merchant'||data.environment!=='live')
    return {state:data?.state||'unavailable',report:null};
  return {state:'ok',report:data};
}
export async function readCommercialAccess(base44) {
  const {data}=await base44.functions.invoke('payflowConnectCheckout',{action:'entitlements'});
  if(data?.state!=='ok') throw new Error('ACCESS_UNVERIFIED');
  return data.products;
}
export async function readConnection(base44) {
  const {data}=await base44.functions.invoke('payflowStripeConnectLive',{action:'sync'});
  if(data?.state!=='ok') return {state:data?.state||'unavailable'};
  return {state:'ok',cards:data.card_payments_active===true&&data.charges_enabled===true,payouts:data.payouts_enabled===true};
}

Architecture target

Ledger and reconciliation

Normalize events by merchant, provider, reference, currency and timestamp. Maintain append-only audit records and reconcile gross payment, fees, refunds and net settlement separately.

Do not mix platform subscription revenue with merchant sales. Commission and tax treatment require an approved commercial and accounting policy.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Engineering requirements

Webhooks and idempotency

Verify the provider signature against the raw request body and timestamp before parsing. Store event IDs durably to prevent replay. Acknowledge only after durable acceptance; process asynchronously with retry and dead-letter handling.

Do not invent a PaymentHub webhook signing contract: provider-specific verification remains required until the unified public event contract is released.

Diagnostic SDK contract

Errors and troubleshooting

The SDK rejects non-HTTPS endpoints, redirect responses and malformed state payloads. Node reports HTTP error status and server state for unsuccessful responses. Python surfaces HTTP errors from its standard library.

Readiness can be unavailable even when the application is reachable. For provider failures, record non-sensitive correlation identifiers and investigate authorization, connectivity and configuration separately.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Required controls

Security and compliance

Keep LIVE and TEST isolated. Enforce least privilege, merchant isolation, secure transport, log redaction, signed webhooks and idempotency. Never store raw card data.

Hosted fields reduce card-data exposure but do not by themselves establish PCI compliance. Complete the applicable provider, contractual and regulatory requirements before production activation.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Verification procedure

Testing and sandbox

Use provider test credentials in isolated environments. Test authorization failures, expired trials, successful and declined payments, 3-D Secure, duplicate events, unknown outcomes and merchant isolation.

Do not substitute TEST results for LIVE evidence. Confirm a real authorized payment, signed event and settlement before declaring a route verified.

import test from 'node:test';
import assert from 'node:assert/strict';
import {selectProvider,refundableAmount,authorizeMerchant,canCreateCharge,reconcile} from './orchestration.mjs';
test('unknown attempt prevents failover',()=>assert.equal(selectProvider({attempt:{state:'unknown'}}).state,'reconcile_first'));
test('reject unauthorized merchant provider',()=>assert.equal(selectProvider({providers:[{merchantId:'other'}],merchantId:'mine'}).state,'no_eligible_provider'));
test('refund limit includes pending refunds',()=>assert.throws(()=>refundableAmount({captured:100,refunded:20,pendingRefunds:30,requested:51})));
test('merchant scope',()=>assert.throws(()=>authorizeMerchant({merchantId:'a',environment:'live'},{merchantId:'b',environment:'live'})));
test('commercial eligibility alone cannot charge',()=>assert.equal(canCreateCharge({access:true,capabilities:{charges:false},webhookVerified:true}),false));
test('reconciliation',()=>assert.equal(reconcile({gross:100,fees:3,refunds:20,net:77}).balanced,true));

LIVE activation conditional

Production checklist

Verify merchant approval, provider credentials, card and payout capabilities, signed webhooks, commercial access, isolation and reconciliation. Test rollback without interrupting existing subscriptions.

Do not enable a route based on a marketing label or HTTP 200. Record evidence for each circuit and distinguish card authorization, capture and bank settlement.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Integration roadmap

Aurora, Xero and AI builders

Aurora Classic and Pro V7 should use the PaymentHub orchestration layer as migration progresses. Existing checkout routes remain supported until replacements are validated.

Xero receives reconciled accounting records; HubSpot receives scoped CRM records. Angel 2.0 monitors and proposes actions within permissions. AI builders must use documented interfaces rather than invent endpoints.

Preview contract

API reference and versioning

The readiness function accepts GET and returns JSON with state, availability, checks and blockers. Supply the deployment-specific HTTPS URL; no stable public PaymentHub base URL is asserted here.

The authenticated internal Connect and billing interfaces are not public SDK contracts. Public payment, customer, refund, payout and ledger endpoints remain unreleased. Pin SDK versions and review migration notes before upgrades.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Executable source preview · diagnostics only

PaymentHub CLI

Install Node.js 20 or later. Download paymenthub-cli.mjs, paymenthub.mjs and examples/advanced.mjs into the same directory structure. The CLI supports health, readiness, idempotency and currency totals, with JSON output and nonzero exit codes on error. No npm registry release or write commands are available.

node paymenthub-cli.mjs --help
node paymenthub-cli.mjs --version
node paymenthub-cli.mjs health "$PAYMENTHUB_READINESS_URL"
node paymenthub-cli.mjs readiness "$PAYMENTHUB_READINESS_URL"

Executable local reference · persistence required

Idempotency and retry safety

Generate a key scoped to merchant, environment, operation and reference. A stable key alone does not prevent duplicate charges: persist the key, request fingerprint and outcome atomically on the server.

node paymenthub-cli.mjs idempotency merchant-example test checkout order-001

Executable local reference

Currency and minor-unit precision

Use integer minor units and separate currencies. The CLI returns exact integer totals as strings. Never sum different currencies without an approved exchange-rate policy.

node paymenthub-cli.mjs totals '[{"currency":"CHF","amount_minor":50},{"currency":"EUR","amount_minor":1900}]'

Executable local reference · server authentication required

Merchant isolation

Derive merchant identity from authenticated server context. Reject resources in a different tenant or environment. The example is a pure function, not a replacement for server authorization.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Executable local reference

Timeout and recovery

An uncertain payment must be reconciled before another attempt. Never fail over blindly.

import {decideNextAttempt} from './examples/advanced.mjs';
console.log(decideNextAttempt('unknown'));

Existing authenticated Stripe integration · not native PaymentHub public API

Merchant finance — internal reference

Use the authenticated Base44 SDK. Server grants and provider mappings must be verified. This reads recent Stripe merchant reports only, not the platform account or complete PaymentHub ledger.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Existing internal interfaces · verification required

Commercial access and provider capabilities

Commercial eligibility is independent of processor approval. Connection sync may update metadata, but does not initiate payments.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Executable local tests · not production certification

Local test suite

Run the reference policy and CLI tests. They do not prove live provider connectivity, server tenant isolation or actual financial execution.

node --test examples/*.test.mjs

Developer guide · see capability limits

All PaymentHub products

Aurora Classic and Aurora Pro V7 use the native PayFlow integration target; Stripe Adapter V4 is a separate merchant connection. PayOptimum platform subscriptions are not merchant payment revenue. Visit /products to explore the published catalogue.

Developer guide · see capability limits

About the APIs

The public source SDK reads readiness evidence. Internal authenticated Base44 interfaces and provider-specific APIs are not interchangeable with a released native PaymentHub write API.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Developer guide · see capability limits

PaymentHub glossary

Merchant: business accepting payments. Authorization: provider approval of a payment. Capture: collection of authorized funds. Settlement: reconciliation of funds received. Payout: provider transfer to an authorized destination. Idempotency: repeated requests produce at most one intended effect when enforced durably.

Developer guide · see capability limits

Create a merchant account

Sign in to PayOptimum, open the merchant console at /payflow/paymenthub/connected-accounts, and complete provider authorization. Commercial access does not establish processing approval.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Quickstart solutions

Download the SDK and CLI sources. Configure PAYMENTHUB_READINESS_URL with the administrator-supplied HTTPS endpoint. Run health and readiness before integrating financial operations.

node paymenthub-cli.mjs --help
node paymenthub-cli.mjs --version
node paymenthub-cli.mjs health "$PAYMENTHUB_READINESS_URL"
node paymenthub-cli.mjs readiness "$PAYMENTHUB_READINESS_URL"

Developer guide · see capability limits

Development environment

Use Node.js 20+ or Python 3.10+, keep TEST credentials separate, and run local tests. No registry installation is claimed.

node --test examples/*.test.mjs

Developer guide · see capability limits

Develop with AI agents

Use the readiness tool example and scoped read-only access. Require explicit authorization for external actions; never expose provider secrets or card data.

import {handleReadiness} from './examples/mcp-readiness.mjs';
console.log(await handleReadiness({}, {endpoint:process.env.PAYMENTHUB_READINESS_URL}));

Developer guide · see capability limits

Use PaymentHub without code

Explore the existing Aurora builder and PayOptimum merchant console. Only enable checkout and payment links after the corresponding provider route is verified; local draft forms are not payment services.

Developer guide · see capability limits

Migrate to PaymentHub

Inventory existing customers, subscriptions, provider references and currencies. Reconcile balances and preserve consent. Test parallel read-only reporting, then switch only certified routes with rollback. Never copy PAN or assume provider tokens are portable.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Use case overview

Choose between online checkout, recurring billing, in-person collection and invoicing. Each requires distinct provider capabilities and evidence; not all are available today.

Developer guide · see capability limits

Accept simple startup payments

Prepare an order on the server using trusted catalogue values and integer minor units. Use hosted checkout only with a verified provider route. Confirm payment from a signed event and server-side status, never from a browser redirect.

// Local validation only — does not initiate a payment.
function validateAmount(minor, currency) {
  if (!Number.isSafeInteger(minor) || minor <= 0 || !/^[A-Z]{3}$/.test(currency)) throw new Error("Invalid amount");
  return { amount_minor: minor, currency };
}

Developer guide · see capability limits

Sell SaaS subscriptions

Separate platform subscriptions from merchant subscriptions. Define the billing interval, currency, trial consent and cancellation policy. Verify recurring mandate and renewal evidence before declaring recurring merchant billing operational.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Accept in-person payments

Planned integration: certified terminal or provider-supported in-person SDK, location assignment and device registration. No PaymentHub terminal SDK, reader or in-person payment endpoint is currently certified.

Developer guide · see capability limits

Send invoices and collect payments

Build an invoice from trusted line items, currency and approved tax rules. Deliver a provider-verified payment link only when available. Reconcile confirmed payment to the invoice, then issue a receipt and sync approved accounting records.

node paymenthub-cli.mjs totals '[{"currency":"CHF","amount_minor":50},{"currency":"EUR","amount_minor":1900}]'

Developer guide · see capability limits

Developer overview

Use the readiness SDK first. Separate PayOptimum platform billing, native PaymentHub and Stripe Adapter V4.

node paymenthub-cli.mjs --help
node paymenthub-cli.mjs --version
node paymenthub-cli.mjs health "$PAYMENTHUB_READINESS_URL"
node paymenthub-cli.mjs readiness "$PAYMENTHUB_READINESS_URL"

Developer guide · see capability limits

Changelog

Record SDK releases, contract changes, commit IDs and migration requirements. Current source SDK: 0.1.0; documentation: preliminary v0.9.

node paymenthub-cli.mjs --help
node paymenthub-cli.mjs --version
node paymenthub-cli.mjs health "$PAYMENTHUB_READINESS_URL"
node paymenthub-cli.mjs readiness "$PAYMENTHUB_READINESS_URL"

Developer guide · see capability limits

Upgrade your integration

Pin source versions; run contract and regression tests before replacing a working integration.

node --test examples/*.test.mjs

Developer guide · see capability limits

API versioning

Public financial API versioning is not released. Do not assume provider API versions are PaymentHub versions.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Developer guide · see capability limits

SDKs

Node.js, TypeScript definitions and Python source are available; registry publication is not established.

/** PaymentHub SDK v0.1.0 — read-only readiness client. */
export class PaymentHub {
  constructor({endpoint, fetcher=globalThis.fetch, timeout=10000}={}) {
    const url=new URL(endpoint);
    if(url.protocol!=='https:' || url.username || url.password) throw new TypeError('HTTPS endpoint required');
    this.endpoint=url.href; this.fetcher=fetcher; this.timeout=timeout;
  }
  async readiness() {
    const r=await this.fetcher(this.endpoint,{headers:{Accept:'application/json'},signal:AbortSignal.timeout(this.timeout),redirect:'error'});
    const data=await r.json();
    if(!data || typeof data.state!=='string') throw new Error('Invalid PaymentHub response');
    if(!r.ok) throw Object.assign(new Error('PaymentHub readiness unavailable'),{status:r.status,state:data.state});
    return data;
  }
}

Developer guide · see capability limits

API

Use the administrator-supplied HTTPS readiness endpoint. Financial write contracts remain unreleased.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Developer guide · see capability limits

Events

Verify provider-specific signatures on raw bytes; persist event IDs before acknowledgment. Unified event schema is proposed.

node paymenthub-cli.mjs idempotency merchant-example test checkout order-001

Developer guide · see capability limits

Testing

Run local tests and independent provider TEST scenarios.

node --test examples/*.test.mjs

Developer guide · see capability limits

PaymentHub CLI

Download the CLI source and run its diagnostic and local utility commands.

node paymenthub-cli.mjs --help
node paymenthub-cli.mjs --version
node paymenthub-cli.mjs health "$PAYMENTHUB_READINESS_URL"
node paymenthub-cli.mjs readiness "$PAYMENTHUB_READINESS_URL"

Developer guide · see capability limits

PaymentHub Dashboard

Open the authenticated merchant console; provider reports are scoped and incomplete.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Projects

Proposed project registry: merchant ownership, environment and deployment metadata.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Go live

Require signed event, provider approval, reconciliation and operator approval.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Developer guide · see capability limits

Workbench

Proposed API request workspace; start with read-only diagnostics.

node paymenthub-cli.mjs --help
node paymenthub-cli.mjs --version
node paymenthub-cli.mjs health "$PAYMENTHUB_READINESS_URL"
node paymenthub-cli.mjs readiness "$PAYMENTHUB_READINESS_URL"

Developer guide · see capability limits

Developer Dashboard

Proposed overview of credentials, usage, events and deployments.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Developer guide · see capability limits

Visual Studio Code

Use the downloadable CLI in the integrated terminal; no published extension yet.

node paymenthub-cli.mjs --help
node paymenthub-cli.mjs --version
node paymenthub-cli.mjs health "$PAYMENTHUB_READINESS_URL"
node paymenthub-cli.mjs readiness "$PAYMENTHUB_READINESS_URL"

Developer guide · see capability limits

Terraform

Provider and infrastructure-as-code integration are planned; no PaymentHub Terraform provider is released.

Developer guide · see capability limits

Community / Discord

Community channel and moderation policy are planned; no official Discord server is asserted.

Developer guide · see capability limits

Workflows

Design durable workflows with explicit approval and per-merchant scopes.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Batch processing

Validate each item, isolate tenants, persist per-item idempotency and report partial failures.

node paymenthub-cli.mjs idempotency merchant-example test checkout order-001

Developer guide · see capability limits

Health alerts

Read explicit readiness evidence and alert on missing checks.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Developer guide · see capability limits

File uploads

Proposed upload service: allowlisted types, size limits, malware scanning and private storage.

Developer guide · see capability limits

Agent plugins

Expose allowlisted tools with authenticated server permissions; financial actions require separate approval.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Model Context Protocol (MCP)

Proposed read-only MCP tool for readiness; never expose raw provider credentials.

import {handleReadiness} from './examples/mcp-readiness.mjs';
console.log(await handleReadiness({}, {endpoint:process.env.PAYMENTHUB_READINESS_URL}));

Developer guide · see capability limits

Agent skills

Provide versioned integration instructions, examples and test commands.

node --test examples/*.test.mjs

Developer guide · see capability limits

PaymentHub directory

Proposed registry of verified tools and integrations; no marketplace listing is implied.

Developer guide · see capability limits

Overview

Extensions are a proposed application model with scoped access and isolated execution.

Developer guide · see capability limits

Create PaymentHub apps

Start from a local manifest and validate before any installation.

{
  "example_only": true,
  "id": "example.readiness",
  "version": "0.1.0",
  "environments": [
    "test"
  ],
  "permissions": [
    "readiness:read"
  ],
  "routes": [
    {
      "id": "overview",
      "path": "/overview"
    }
  ]
}

Developer guide · see capability limits

Create an app

Define identifier, version, requested scopes and supported environments.

{
  "example_only": true,
  "id": "example.readiness",
  "version": "0.1.0",
  "environments": [
    "test"
  ],
  "permissions": [
    "readiness:read"
  ],
  "routes": [
    {
      "id": "overview",
      "path": "/overview"
    }
  ]
}

Developer guide · see capability limits

How PaymentHub Apps work

Proposed installation and permission model; no app runtime has been released.

{
  "example_only": true,
  "id": "example.readiness",
  "version": "0.1.0",
  "environments": [
    "test"
  ],
  "permissions": [
    "readiness:read"
  ],
  "routes": [
    {
      "id": "overview",
      "path": "/overview"
    }
  ]
}

Developer guide · see capability limits

Common use cases

Readiness diagnostics, reconciliation and merchant reporting are initial candidates.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Application examples

Use source SDK and policy examples for local development.

node --test examples/*.test.mjs

Developer guide · see capability limits

Store secrets

Use server-side secret storage; never embed secrets in manifests or browser code.

Developer guide · see capability limits

API authentication methods

Bind each request to a server-verified session or future scoped credential.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Authorization flows

Use provider-approved OAuth, state binding, redirect allowlists and server-side token exchange.

Developer guide · see capability limits

Server-side logic

Validate amounts, permissions and idempotency before any provider call.

node paymenthub-cli.mjs idempotency merchant-example test checkout order-001

Developer guide · see capability limits

Listen to events

Use provider-specific signed webhooks and durable deduplication.

node paymenthub-cli.mjs idempotency merchant-example test checkout order-001

Developer guide · see capability limits

Manage modes

Separate test and live credentials, records and scopes.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Enable test environment

Use isolated provider TEST accounts and fixtures.

node --test examples/*.test.mjs

Developer guide · see capability limits

Local network access

Do not expose production services to local clients; use an explicitly authorized development environment.

Developer guide · see capability limits

App settings page

Proposed per-installation settings with server-side authorization and audit.

Developer guide · see capability limits

Design user interfaces

Reuse PayOptimum components; show pending and unavailable states explicitly.

Developer guide · see capability limits

User registration

Use existing authenticated merchant identity; application-specific enrollment remains planned.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Distribution options

Proposed private, invited and public distribution channels.

Developer guide · see capability limits

Upload your application

Validate source, manifest, dependency lockfiles and artifact digest before review.

{
  "example_only": true,
  "id": "example.readiness",
  "version": "0.1.0",
  "environments": [
    "test"
  ],
  "permissions": [
    "readiness:read"
  ],
  "routes": [
    {
      "id": "overview",
      "path": "/overview"
    }
  ]
}

Developer guide · see capability limits

Versions

Use immutable release versions and retain rollback artifacts.

Developer guide · see capability limits

Test your application

Run tests, dependency review and tenant isolation checks.

node --test examples/*.test.mjs

Developer guide · see capability limits

Publish your application

Proposed review and approval process; no public extension publishing endpoint exists.

Developer guide · see capability limits

Promote your application

Use existing documentation share controls; do not claim marketplace approval.

Developer guide · see capability limits

Route descriptions

Declare stable route identifiers and validate destination permissions.

{
  "example_only": true,
  "id": "example.readiness",
  "version": "0.1.0",
  "environments": [
    "test"
  ],
  "permissions": [
    "readiness:read"
  ],
  "routes": [
    {
      "id": "overview",
      "path": "/overview"
    }
  ]
}

Developer guide · see capability limits

UI extension roles

Map explicit roles to least-privilege permissions.

{
  "example_only": true,
  "id": "example.readiness",
  "version": "0.1.0",
  "environments": [
    "test"
  ],
  "permissions": [
    "readiness:read"
  ],
  "routes": [
    {
      "id": "overview",
      "path": "/overview"
    }
  ]
}

Developer guide · see capability limits

Post-installation actions

Use auditable, idempotent setup steps; no automatic payment activation.

node paymenthub-cli.mjs idempotency merchant-example test checkout order-001

Developer guide · see capability limits

Application analytics

Separate installation telemetry from merchant financial reporting.

node paymenthub-cli.mjs totals '[{"currency":"CHF","amount_minor":50},{"currency":"EUR","amount_minor":1900}]'

Developer guide · see capability limits

Default tax settings for schedules

Require approved jurisdiction, tax treatment and effective date; no default tax rule is implied.

Developer guide · see capability limits

Embed third-party apps

Proposed isolated components with scoped tokens, origin restrictions and consent.

Developer guide · see capability limits

Migrate or create a Connect extension

Keep provider authorization independent; migrate only after regression testing.

node --test examples/*.test.mjs

Developer guide · see capability limits

Migrate a plugin

Inventory scopes and routes, preserve data ownership and validate rollback.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Application manifest

Download the illustrative manifest. It is not an installable platform contract.

{
  "example_only": true,
  "id": "example.readiness",
  "version": "0.1.0",
  "environments": [
    "test"
  ],
  "permissions": [
    "readiness:read"
  ],
  "routes": [
    {
      "id": "overview",
      "path": "/overview"
    }
  ]
}

Developer guide · see capability limits

Command-line interface

Read-only diagnostic and local utility CLI source is available.

node paymenthub-cli.mjs --help
node paymenthub-cli.mjs --version
node paymenthub-cli.mjs health "$PAYMENTHUB_READINESS_URL"
node paymenthub-cli.mjs readiness "$PAYMENTHUB_READINESS_URL"

Developer guide · see capability limits

Extension SDK

Planned; existing SDK is limited to readiness diagnostics.

/** PaymentHub SDK v0.1.0 — read-only readiness client. */
export class PaymentHub {
  constructor({endpoint, fetcher=globalThis.fetch, timeout=10000}={}) {
    const url=new URL(endpoint);
    if(url.protocol!=='https:' || url.username || url.password) throw new TypeError('HTTPS endpoint required');
    this.endpoint=url.href; this.fetcher=fetcher; this.timeout=timeout;
  }
  async readiness() {
    const r=await this.fetcher(this.endpoint,{headers:{Accept:'application/json'},signal:AbortSignal.timeout(this.timeout),redirect:'error'});
    const data=await r.json();
    if(!data || typeof data.state!=='string') throw new Error('Invalid PaymentHub response');
    if(!r.ok) throw Object.assign(new Error('PaymentHub readiness unavailable'),{status:r.status,state:data.state});
    return data;
  }
}

Developer guide · see capability limits

Permissions

Proposed explicit read scopes; default deny and verify tenant ownership.

{
  "example_only": true,
  "id": "example.readiness",
  "version": "0.1.0",
  "environments": [
    "test"
  ],
  "permissions": [
    "readiness:read"
  ],
  "routes": [
    {
      "id": "overview",
      "path": "/overview"
    }
  ]
}

Developer guide · see capability limits

Viewports

Proposed responsive UI surfaces; no extension host is released.

Developer guide · see capability limits

Design patterns

Use consistent states, accessibility and explicit destructive-action confirmation.

Developer guide · see capability limits

Components

Reuse the existing PayOptimum design system; extension component library is planned.

Developer guide · see capability limits

Use PaymentHub applications

Application installation and runtime are planned.

Developer guide · see capability limits

Create extensions

Start with the example manifest and local validation.

{
  "example_only": true,
  "id": "example.readiness",
  "version": "0.1.0",
  "environments": [
    "test"
  ],
  "permissions": [
    "readiness:read"
  ],
  "routes": [
    {
      "id": "overview",
      "path": "/overview"
    }
  ]
}

Developer guide · see capability limits

Custom objects

Proposed tenant-scoped schemas with migrations, validation and access rules.

Developer guide · see capability limits

Security

Require least privilege, server-side authorization, PCI scope review and secret redaction.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Log history

Proposed durable audit history; do not confuse browser drafts with server audit records.

Developer guide · see capability limits

PaymentHub web crawler

No dedicated PaymentHub crawler is currently documented.

Developer guide · see capability limits

Privacy

Minimize personal data and define retention, access and deletion policies.

Developer guide · see capability limits

Partner ecosystem

Proposed directory for approved providers and integrations; no certification claim.

Developer guide · see capability limits

Partner certification

Require evidence of provider approval, security controls and successful integration tests.

node --test examples/*.test.mjs

Developer guide · see capability limits

Online payments overview

Separate native PaymentHub, Stripe Adapter and platform billing. Verify merchant approval and provider capabilities.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Developer guide · see capability limits

Find your payment use case

Choose hosted checkout, links, embedded fields or recurring billing according to provider capabilities.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Create a checkout page

Aurora Classic and Pro V7 are native checkout integration targets. Use provider-hosted fields and server confirmation.

// Local validation only — does not initiate a payment.
function validateAmount(minor, currency) {
  if (!Number.isSafeInteger(minor) || minor <= 0 || !/^[A-Z]{3}$/.test(currency)) throw new Error("Invalid amount");
  return { amount_minor: minor, currency };
}

Developer guide · see capability limits

Build an in-app integration

Bind the provider session to an authenticated merchant and order; never trust browser payment status.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Managed Payments

Merchant-of-record services are not released; contractual liability and tax obligations require separate agreements.

Developer guide · see capability limits

Recurring payments

Require verified mandates and renewal outcomes; platform billing is not merchant billing.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Off-session payments

Require consent and provider-supported tokens; handle authentication-required results and unknown outcomes.

import {decideNextAttempt} from './examples/advanced.mjs';
console.log(decideNextAttempt('unknown'));

Developer guide · see capability limits

Migrate legacy integrations

Inventory references, reconcile data and test rollback before switching.

node --test examples/*.test.mjs

Developer guide · see capability limits

Terminal overview

No PaymentHub terminal service is certified.

Developer guide · see capability limits

How Terminal works

Proposed device registration, location, payment session and signed confirmation.

Developer guide · see capability limits

Terminal availability

Verify country, provider and device support; no availability list is asserted.

Developer guide · see capability limits

Readers

Only provider-certified devices may be used; no PaymentHub reader catalogue exists.

Developer guide · see capability limits

Terminal encryption

Keep card data and cryptographic keys inside certified provider devices.

Developer guide · see capability limits

Ready-made terminal apps

No PaymentHub terminal application is released.

Developer guide · see capability limits

Custom terminal integration

Use an authorized provider SDK and reconcile uncertain outcomes.

import {decideNextAttempt} from './examples/advanced.mjs';
console.log(decideNextAttempt('unknown'));

Developer guide · see capability limits

Add payment methods

Require authorization by merchant, method, currency and environment.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Developer guide · see capability limits

Manage payment methods

Use provider tokens, consent and tenant ownership; tokens are not assumed portable.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Accelerated checkout

No native accelerated checkout product is certified; Stripe Link is separate.

Developer guide · see capability limits

Payment analytics

Separate currencies and platform versus merchant revenue; identify incomplete pagination.

node paymenthub-cli.mjs totals '[{"currency":"CHF","amount_minor":50},{"currency":"EUR","amount_minor":1900}]'

Developer guide · see capability limits

Balances and settlement timing

Provider balances are not bank settlement evidence.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Payment compliance and security

Require signed events, least privilege and verified tenant isolation.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Payment currencies

Use integer minor units; never silently convert.

node paymenthub-cli.mjs totals '[{"currency":"CHF","amount_minor":50},{"currency":"EUR","amount_minor":1900}]'

Developer guide · see capability limits

Payment declines

Separate final decline and uncertain outcomes before retrying.

import {decideNextAttempt} from './examples/advanced.mjs';
console.log(decideNextAttempt('unknown'));

Developer guide · see capability limits

Disputes

Track provider case identifiers and deadlines; no public submission endpoint.

Developer guide · see capability limits

Settlements and transfers

Reconcile provider-authorized payouts; no native custody claim.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Receipts

Issue receipts only after confirmed capture, with merchant, amount, currency and provider reference.

Developer guide · see capability limits

Refunds and cancellations

Verify ownership and refundable remainder including pending refunds.

import {refundableAmount} from './examples/orchestration.mjs';
console.log(refundableAmount({captured:1000,refunded:100,pendingRefunds:200,requested:700}));

Developer guide · see capability limits

Hosted Elements and payment intents

Provider-hosted fields and provider-specific intents are distinct from native PaymentHub APIs.

// Local validation only — does not initiate a payment.
function validateAmount(minor, currency) {
  if (!Number.isSafeInteger(minor) || minor <= 0 || !/^[A-Z]{3}$/.test(currency)) throw new Error("Invalid amount");
  return { amount_minor: minor, currency };
}

Developer guide · see capability limits

Custom payment flows

Model order, authentication, processing and confirmation separately.

import {decideNextAttempt} from './examples/advanced.mjs';
console.log(decideNextAttempt('unknown'));

Developer guide · see capability limits

Flexible acquiring

Provider selection requires contractual eligibility and supported currency and method.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Developer guide · see capability limits

Multi-provider orchestration

Never fail over before reconciliation of uncertain attempts.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Developer guide · see capability limits

Company formation

No incorporation product offered.

Developer guide · see capability limits

Agentic commerce

Use scoped diagnostics and explicit authorization; no autonomous financial write tool.

import {handleReadiness} from './examples/mcp-readiness.mjs';
console.log(await handleReadiness({}, {endpoint:process.env.PAYMENTHUB_READINESS_URL}));

Developer guide · see capability limits

Financial connections

Bank connectivity requires consent and provider authorization; Xero integration remains subject to verification.

Developer guide · see capability limits

Climate contributions

No climate contribution product offered.

Developer guide · see capability limits

Billing overview

Separate platform subscriptions from merchant billing. Aurora V7 provides the intended presentation layer; real provider evidence remains mandatory.

Developer guide · see capability limits

How Billing APIs work

Public native billing write contracts are unreleased. Internal authenticated interfaces are not public APIs.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Billing customers

Scope customer records to merchant and environment, never by email alone.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Invoicing

Calculate invoice totals server-side, apply approved tax rules, and issue payment links only when verified.

import {invoiceTotals} from './examples/billing.mjs';
// Illustrative rate only; not a tax recommendation.
console.log(invoiceTotals([{quantity:2,unitMinor:1000}],'CHF',810));

Developer guide · see capability limits

Quotes

Define immutable line items, expiration, currency and acceptance; a quote is not an invoice or payment.

import {invoiceTotals} from './examples/billing.mjs';
// Illustrative rate only; not a tax recommendation.
console.log(invoiceTotals([{quantity:2,unitMinor:1000}],'CHF',810));

Developer guide · see capability limits

Subscriptions

Verify mandate, trial terms, cancellation and successful renewal; separate platform subscriptions.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Usage-based billing

Deduplicate usage events by merchant, meter, period and event ID; meter pricing is not released.

import {sumUsage} from './examples/billing.mjs';
const scope={merchantId:'example',meter:'requests',period:'2026-11'};
console.log(sumUsage([{...scope,id:'e1',units:5}],scope));

Developer guide · see capability limits

Test your Billing integration

Test invoice totals, retry safety, renewal, proration, cancellation and tax treatment independently.

node --test examples/*.test.mjs

Developer guide · see capability limits

Billing automations

Angel 2.0 can supervise approved workflows; financial changes require authorized server operations.

Developer guide · see capability limits

Billing scripts

Use local calculation examples, not unverified financial API calls.

import {invoiceTotals} from './examples/billing.mjs';
// Illustrative rate only; not a tax recommendation.
console.log(invoiceTotals([{quantity:2,unitMinor:1000}],'CHF',810));

Developer guide · see capability limits

Customer portal

Aurora V7 portal must use authenticated merchant/customer sessions and verified billing data.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Retention

Require transparent consent for cancellation alternatives; never prevent cancellation.

Developer guide · see capability limits

Revenue recovery

Track failed invoices and authentication requirements; avoid duplicate charges and unauthorized retries.

import {decideNextAttempt} from './examples/advanced.mjs';
console.log(decideNextAttempt('unknown'));

Developer guide · see capability limits

Tax overview

Tax depends on jurisdiction, supply type, registration and effective date; no automatic tax engine is certified.

Developer guide · see capability limits

Use PaymentHub Tax

Apply only approved tax rules and record the reason and version. Local examples are arithmetic only.

import {invoiceTotals} from './examples/billing.mjs';
// Illustrative rate only; not a tax recommendation.
console.log(invoiceTotals([{quantity:2,unitMinor:1000}],'CHF',810));

Developer guide · see capability limits

Tax rates

Use explicit basis-point rates from approved configuration; never infer jurisdiction from currency.

import {invoiceTotals} from './examples/billing.mjs';
// Illustrative rate only; not a tax recommendation.
console.log(invoiceTotals([{quantity:2,unitMinor:1000}],'CHF',810));

Developer guide · see capability limits

Manage tax compliance

Track registrations, thresholds and filing obligations with professional review. No automatic filing service is released.

Developer guide · see capability limits

Accounting overview

Separate platform revenue, merchant receipts, fees, refunds and settlements. Xero synchronization requires verified authorization.

Developer guide · see capability limits

Revenue recognition methodology

Recognition depends on performance obligations and approved accounting policies; receipt of cash is not necessarily recognized revenue.

Developer guide · see capability limits

Accounting getting started

Map currencies, merchant scope and chart of accounts before posting any journal.

Developer guide · see capability limits

Import accounting data

Validate source provenance, unique references and reconciliation before accepting imported records.

node paymenthub-cli.mjs idempotency merchant-example test checkout order-001

Developer guide · see capability limits

Accounting reports

Aggregate amounts separately by currency and reconcile against provider evidence.

node paymenthub-cli.mjs totals '[{"currency":"CHF","amount_minor":50},{"currency":"EUR","amount_minor":1900}]'

Developer guide · see capability limits

Accounting examples

Use local arithmetic to reconcile amounts; no journal is posted.

node paymenthub-cli.mjs totals '[{"currency":"CHF","amount_minor":50},{"currency":"EUR","amount_minor":1900}]'

Developer guide · see capability limits

Revenue recognition for platforms

Distinguish principal versus agent under the applicable accounting policy; merchant gross sales are not automatically platform revenue.

Developer guide · see capability limits

Risk overview

PaymentHub risk controls are a proposed independent policy layer; no certified fraud scoring engine is released.

Developer guide · see capability limits

How risk prevention works

Combine provider-reported decisions, merchant authorization and reviewed policy; do not invent risk scores.

Developer guide · see capability limits

Understand fraud

Document unauthorized transactions, account takeover, abuse and disputes; rely on verified evidence.

Developer guide · see capability limits

Risk factor recommendations

Evaluate provider signals, anomalous velocity and verified customer authentication; minimize personal data.

Developer guide · see capability limits

Risk controls and settings

Require versioned policies, access controls, audit and human review.

Developer guide · see capability limits

Transaction risk prevention

Block unverified merchant routes, reconcile unknown attempts and enforce idempotency.

import {decideNextAttempt} from './examples/advanced.mjs';
console.log(decideNextAttempt('unknown'));

Developer guide · see capability limits

Customer abuse prevention

Review repeated refunds and disputes without assuming misconduct; offer appeal and human review.

Developer guide · see capability limits

Account fraud prevention

Enforce session security, merchant ownership, provider approval and least privilege.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Multi-provider risk prevention

Normalize provider decisions without transferring incompatible credentials or bypassing declines.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Developer guide · see capability limits

Issuing authorization risk

No PaymentHub card issuing service is released.

Developer guide · see capability limits

Risk rules

Local policy examples are not a deployed risk engine.

import {readinessDecision} from './examples/risk-data.mjs';
// Missing evidence blocks eligibility; not a fraud score.
console.log(readinessDecision({}));

Developer guide · see capability limits

Risk analytics

Separate observed outcomes from estimated risk; avoid invented metrics.

Developer guide · see capability limits

Identity overview

KYC/KYB depends on authorized verification providers; no independent PaymentHub identity verification API is certified.

Developer guide · see capability limits

Verify identity documents

Use a provider-hosted flow; do not upload raw identity documents to an unverified endpoint.

Developer guide · see capability limits

Handle verification outcomes

Treat pending, failed and unavailable as not approved; require authoritative provider confirmation.

import {readinessDecision} from './examples/risk-data.mjs';
// Missing evidence blocks eligibility; not a fraud score.
console.log(readinessDecision({}));

Developer guide · see capability limits

Access verification results

Use scoped, audited access to minimum necessary results.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Review verification results

Restrict manual reviews to authorized operators and record decisions.

Developer guide · see capability limits

Verification flows

Bind verification to the merchant and provider; preserve explicit consent.

Developer guide · see capability limits

Verification checks

Document provider-supported checks and limitations; do not imply biometric capability.

Developer guide · see capability limits

Verification sessions

Use provider-issued session references, expiry and replay protection.

Developer guide · see capability limits

Before going live with Identity

Verify contracts, data retention, privacy, permissions and signed evidence.

Developer guide · see capability limits

Supported identity use cases

Merchant onboarding and account recovery are integration targets, subject to provider support.

Developer guide · see capability limits

Identity in brief

Explain why data is collected, by whom, and how it is protected.

Developer guide · see capability limits

Available data

Current authenticated Stripe reports are limited, provider-specific and merchant-scoped; native PaymentHub datasets are not certified.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Reports overview

Separate platform income, merchant collections, refunds, fees and payouts by currency.

node paymenthub-cli.mjs totals '[{"currency":"CHF","amount_minor":50},{"currency":"EUR","amount_minor":1900}]'

Developer guide · see capability limits

Select a report

Choose transaction, settlement, subscription or reconciliation reports according to available verified evidence.

Developer guide · see capability limits

Configure reports

Use explicit date range, timezone, currency, tenant and pagination; distinguish partial data.

Developer guide · see capability limits

Reports across accounts

Only aggregate accounts with explicit authorization; do not expose one merchant to another.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Reporting API

Existing authenticated Base44 finance functions are not a public native reporting API.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Marketing analytics

Use authorized campaign sources, consent and attribution windows; no native marketing analytics API is certified.

Developer guide · see capability limits

Query workspace

Proposed read-only query workspace. Enforce tenant restrictions server-side; no public SQL service is released.

Developer guide · see capability limits

Metrics API

Proposed metrics contract; report exact currency and period, provenance and completeness.

import {reportByCurrency} from './examples/risk-data.mjs';
const scope={merchantId:'example',environment:'test'};
console.log(reportByCurrency([{...scope,id:'fixture-1',currency:'CHF',amount_minor:50}],scope));

Developer guide · see capability limits

Access data via API

Use only released endpoints and verified internal interfaces; avoid undocumented financial APIs.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Analyze data with AI

Angel 2.0 may summarize authorized records; preserve source references and avoid inventing missing values.

import {handleReadiness} from './examples/mcp-readiness.mjs';
console.log(await handleReadiness({}, {endpoint:process.env.PAYMENTHUB_READINESS_URL}));

Developer guide · see capability limits

PaymentHub Signals

Proposed operational alerts based on explicit provider evidence, not inferred financial outcomes.

import { PaymentHub } from './paymenthub.mjs';
const hub = new PaymentHub({ endpoint: process.env.PAYMENTHUB_READINESS_URL });
const status = await hub.readiness();
console.log(status.state, status.verification_blockers);

Developer guide · see capability limits

Data Pipeline

Proposed incremental export with checkpoints, immutable event identifiers, scoped destinations and retries. No hosted pipeline is certified.

node paymenthub-cli.mjs idempotency merchant-example test checkout order-001

Developer guide · see capability limits

Import external data

Validate schema, merchant ownership, currency, unique event references and provenance before import.

import {reportByCurrency} from './examples/risk-data.mjs';
const scope={merchantId:'example',environment:'test'};
console.log(reportByCurrency([{...scope,id:'fixture-1',currency:'CHF',amount_minor:50}],scope));

Developer guide · see capability limits

Treasury overview

PaymentHub targets orchestration of provider-authorized financial services, not independent custody. No Treasury account service is certified.

Developer guide · see capability limits

Stablecoins

No stablecoin acceptance, custody or conversion service is released. Provider authorization, supported jurisdictions and compliance must be verified.

Developer guide · see capability limits

Stablecoins in Treasury

Proposed partner integration only; no wallet or balance is offered.

Developer guide · see capability limits

Treasury for agents

Agents may read authorized evidence; no autonomous transfer or financial account operation is released.

import {handleReadiness} from './examples/mcp-readiness.mjs';
console.log(await handleReadiness({}, {endpoint:process.env.PAYMENTHUB_READINESS_URL}));

Developer guide · see capability limits

Embedded financial services

Connect merchant accounts through authorized providers; keep commercial access and processing approval separate.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Developer resources

Use the diagnostic SDK and CLI; financial write contracts remain unreleased.

node paymenthub-cli.mjs --help
node paymenthub-cli.mjs --version
node paymenthub-cli.mjs health "$PAYMENTHUB_READINESS_URL"
node paymenthub-cli.mjs readiness "$PAYMENTHUB_READINESS_URL"

Developer guide · see capability limits

Fund your financial account

No PaymentHub deposit-taking service exists. Use only verified provider-issued funding instructions; reconcile actual receipt.

Developer guide · see capability limits

Hold funds

Provider-held balances are not PaymentHub deposits. No custody service is certified.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Convert funds

No FX execution service is released; preserve currency and obtain explicit provider quotes before conversion.

node paymenthub-cli.mjs totals '[{"currency":"CHF","amount_minor":50},{"currency":"EUR","amount_minor":1900}]'

Developer guide · see capability limits

Financial account statements

Provider statements require authorized access and independent reconciliation; no native account statement API is released.

import {reportByCurrency} from './examples/risk-data.mjs';
const scope={merchantId:'example',environment:'test'};
console.log(reportByCurrency([{...scope,id:'fixture-1',currency:'CHF',amount_minor:50}],scope));

Developer guide · see capability limits

Fee discounts

No rewards or discount programme is certified; apply only approved contractual fees.

Developer guide · see capability limits

Card spending cashback

No PaymentHub cashback programme or card issuance service is released.

Developer guide · see capability limits

Savings accounts

No savings account, interest or deposit product is offered.

Developer guide · see capability limits

Transfer funds

No native transfer execution endpoint is released. Authorized provider transfers require ownership, approval and reconciliation.

Developer guide · see capability limits

Global Payouts

Provider payout reporting is distinct from initiating international transfers.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Other ways to send funds

Bank transfers and alternative payout methods require independent provider authorization and jurisdictional support.

Developer guide · see capability limits

Create and manage cards

No PaymentHub card issuing service is released.

Developer guide · see capability limits

Direct debits

Require a verified mandate, provider support, consent and reconciliation; no native direct debit API is certified.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Capital and financing

No lending or capital advance product is offered. Any future partner referral must identify the authorized lender and applicable terms.

Developer guide · see capability limits

Stablecoin key concepts

Distinguish token issuer, reserve arrangements, blockchain network, custody provider, settlement finality, redemption and exchange-rate risk. A stablecoin is not automatically a bank deposit.

Developer guide · see capability limits

Stablecoin use cases

Potential uses include cross-border settlement and provider-hosted checkout. Each requires independent eligibility and compliance checks.

Developer guide · see capability limits

Supported assets and networks

No PaymentHub stablecoin asset or blockchain network is currently certified. Publish an explicit provider-confirmed allowlist before accepting funds.

Developer guide · see capability limits

Stablecoin ecosystem

Identify issuer, authorized provider, wallet operator and settlement counterparty; no partner relationship is implied.

Developer guide · see capability limits

Stablecoin payouts and cards

No stablecoin payout or card service is released. Provider-authorized conversion and payout evidence would be required.

Developer guide · see capability limits

Hold and manage stablecoins

No PaymentHub wallet, custody or deposit service is offered.

Developer guide · see capability limits

Accept stablecoin payments

Proposed provider-hosted checkout only. Verify asset, network, amount, order ownership, confirmation and settlement before marking paid.

Developer guide · see capability limits

Issue your own stablecoin

No issuance product is offered. Issuer obligations, reserve custody, redemption and applicable authorization must be independently established.

Developer guide · see capability limits

Stablecoins for platforms overview

Separate merchant authorization, provider balances and platform fees; no native stablecoin collection contract is released.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Crypto onramp overview

No PaymentHub crypto purchase or onramp service is released. Use only independently authorized providers.

Developer guide · see capability limits

Hosted crypto onramp

Proposed external provider-hosted session. Verify destination, consent, supported jurisdiction and signed status; never collect raw card data.

Developer guide · see capability limits

Embedded crypto onramp

Proposed provider SDK integration with scoped sessions and origin restrictions; no PaymentHub embedded SDK is available.

Developer guide · see capability limits

Embedded onramp components

Proposed UI components must disclose provider identity, applicable fees and transaction state. No component library is released.

Developer guide · see capability limits

How PaymentHub Connect works

PaymentHub coordinates merchant onboarding and authorized provider connections. PayOptimum platform billing, native PayFlow and Stripe Adapter V4 remain distinct.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Get started with Connect

Sign in to the merchant console, select an authorized merchant and inspect provider readiness. Do not create charges before approval.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Design your Connect integration

Choose an approved provider and documented responsibility model for onboarding, payment processing, disputes, settlement and fees. No independent custody is certified.

Developer guide · see capability limits

Connect integration fundamentals

Use server-side tenant identity, scoped credentials, durable idempotency and signed provider events.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Account capabilities and information requirements

Collect only necessary onboarding information through approved providers. Verify charges, payouts and outstanding requirements independently.

import {readCommercialAccess,readConnection} from './examples/merchant-console.mjs';
console.log(await readCommercialAccess(base44));
console.log(await readConnection(base44));

Developer guide · see capability limits

Configure connected account dashboards

Restrict all financial reports to server-authorized merchant accounts. Distinguish incomplete provider data from unavailable data.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Onboard connected accounts

Use provider-approved authorization and bind the returned account to the authenticated merchant. Pending or missing evidence never grants access.

import {readinessDecision} from './examples/risk-data.mjs';
// Missing evidence blocks eligibility; not a fraud score.
console.log(readinessDecision({}));

Developer guide · see capability limits

Manage your Connect platform

Maintain merchant grants, provider mappings, capability history, support and audit evidence. Platform administrators must not bypass tenant controls.

import {assertMerchant} from './examples/advanced.mjs';
assertMerchant({merchantId:'m1',environment:'test'}, {merchantId:'m1',environment:'test'});

Developer guide · see capability limits

Accept connected account payments

Require active merchant authorization, approved processor and verified checkout route. Use hosted card collection and reconcile signed provider confirmation.

// PaymentHub reference policy — pure functions; no provider calls.
export function selectProvider({providers,merchantId,currency,method,environment,attempt}) {
  if (attempt && ['processing','unknown','succeeded'].includes(attempt.state))
    return {state:'reconcile_first'};
  const eligible=providers.filter(p=>p.merchantId===merchantId&&p.environment===environment&&p.authorized===true&&p.available===true&&p.currencies.includes(currency)&&p.methods.includes(method));
  eligible.sort((a,b)=>a.priority-b.priority);
  return eligible.length ? {state:'selected',provider:eligible[0].id} : {state:'no_eligible_provider'};
}
export function refundableAmount({captured,refunded,pendingRefunds,requested}) {
  if (![captured,refunded,pendingRefunds,requested].every(Number.isSafeInteger) || Math.min(captured,refunded,pendingRefunds)<0 || requested<=0 || requested>captured-refunded-pendingRefunds) throw new Error('INVALID_REFUND_AMOUNT');
  return requested;
}
export function authorizeMerchant(session,resource) {
  if (!session?.merchantId || session.merchantId!==resource.merchantId || session.environment!==resource.environment) throw new Error('FORBIDDEN');
  return resource;
}
export function canCreateCharge({access,capabilities,webhookVerified}) {
  return access===true&&capabilities?.charges===true&&webhookVerified===true;
}
export function reconcile({gross,fees,refunds,net}) {
  if (![gross,fees,refunds,net].every(Number.isSafeInteger)) throw new Error('INVALID_MINOR_UNITS');
  return {balanced:gross-fees-refunds===net,expected:gross-fees-refunds,reported:net};
}

Developer guide · see capability limits

Payouts to connected accounts

Read verified provider payout records; no native payout execution endpoint is released. Bank settlement requires independent evidence.

import {readMerchantFinance} from './examples/merchant-console.mjs';
const result = await readMerchantFinance(base44);
console.log(result.state);

Developer guide · see capability limits

Treasury for platforms

Provider-authorized financial accounts are a roadmap item; no independent PaymentHub custody or account service is certified.

Developer guide · see capability limits

Issuing for platforms

No PaymentHub issuing service or card creation API is released.

Developer guide · see capability limits

Capital for platforms

No PaymentHub lending product is offered; future financing requires authorized partners and transparent terms.

Developer guide · see capability limits

Managed support

Angel 2.0 is intended to assist merchants within authenticated scope. Financial actions require authorized services; support integration is not a certified managed provider service.