Loading...
Loading...
Guide for integrating and building with the Stronghold Pay JS SDK and REST API for payment processing. Use when working with Stronghold Pay payment integration, accepting ACH/bank debit payments, linking bank accounts, creating charges/tips, generating PayLinks, or building checkout flows — in sandbox or live environments. Covers Stronghold.Pay.JS drop-in UI, REST API v2 endpoints, PayLink hosted payment pages, customer token management, and payment source handling.
npx skill4agent add padparadscho/skills js-stronghold-sdk┌─────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Frontend │────▶│ Your Backend │────▶│ Stronghold API │
│ (Pay.JS) │ │ (Secret Key) │ │ api.stronghold │
│ │ │ │ │ pay.com │
│ publishable │ │ SH-SECRET-KEY │ │ │
│ key only │ │ header │ │ │
└─────────────┘ └──────────────────┘ └──────────────────┘pk_sandbox_...pk_live_...sk_sandbox_...sk_live_...SH-SECRET-KEY<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://api.strongholdpay.com/v2/js"></script>
</head>const strongholdPay = Stronghold.Pay({
publishableKey: "pk_sandbox_...",
environment: "sandbox", // 'sandbox' or 'live'
integrationId: "integration_...",
});curl --request GET \
--url https://api.strongholdpay.com/v2/customers/{customer_id}/token \
--header 'SH-SECRET-KEY: sk_sandbox_...' \
--header 'Accept: application/json'{
"response_id": "resp_...",
"time": "2024-01-15T12:00:00Z",
"status_code": 200,
"result": {
"token": "<jwt>",
"expiry": "2024-01-16T00:00:00Z"
}
}// Link a bank account
strongholdPay.addPaymentSource(customerToken, {
onSuccess: (paymentSource) => {
/* save paymentSource.id */
},
onExit: () => {
/* user cancelled */
},
onError: (err) => {
/* handle error */
},
});
// Create a charge
strongholdPay.charge(customerToken, {
charge: {
amount: 4995, // $49.95 in cents
currency: "usd",
paymentSourceId: "payment_source_...",
externalId: "order_123", // optional
},
authorizeOnly: false,
onSuccess: (charge) => {
/* charge.id */
},
onExit: () => {},
onError: (err) => {},
});| Environment | Publishable Key | Secret Key | API Base |
|---|---|---|---|
| Sandbox | | | |
| Live | | | |
| Aggregator | Username | Password |
|---|---|---|
| Plaid | | |
| Yodlee | | |
customer_idaddPaymentSourcebank_link4995trueauthorized