@xapps-platform/payment-hosted-client
v0.1.6
Published
Browser-safe hosted payment client for gateway payment page flows
Readme
@xapps-platform/payment-hosted-client
Browser-safe hosted payment client for gateway payment flows.
Install
npm install @xapps-platform/payment-hosted-clientWhen to use it
Use this package in browser payment pages or embedded checkout flows that need to talk to the gateway hosted payment endpoints without pulling in provider adapters or backend-only logic.
Status:
- prepared for public distribution as the external browser payment integration surface
This package wraps the gateway hosted payment endpoints:
GET /v1/gateway-payment/sessionPOST /v1/gateway-payment/completePOST /v1/gateway-payment/client-settle
Contract notes:
- hosted method negotiation is canonical
session.accepts[](do not read legacy metadata aliases) completeSessionmay returnflow=client_collectwithclient_settle_url; client-settle can use that explicit URL- hosted
uifields are presentation-only and never authority for settlement/signing
It is intentionally protocol/UI-focused and excludes:
- provider adapter logic
- provider credentials/secrets
- provider credential bundle refs
- signing or policy authority behavior
Usage
import { createHostedPaymentClient } from "@xapps-platform/payment-hosted-client";
const client = createHostedPaymentClient();
const session = await client.getSession({ paymentSessionId: "pay_123" });
const result = await client.completeSession({ paymentSessionId: "pay_123" });Related packages
@xapps-platform/server-sdkfor backend-side gateway orchestrationxapps-platform/xapps-phpfor PHP backend integrations@xapps/payment-providersfor provider-adapter implementations
Verify locally
npm run build --workspace packages/payment-hosted-client
npm run smoke --workspace packages/payment-hosted-client