Sign in to OurPay, open the organization menu, and choose Go to Sandbox. OurPay opens the matching organization at sandbox.ourpay.dev without another signup or organization setup. If your email has not been verified, complete the email-code verification first. Sandbox has its own sessions, provider credentials, access tokens, products, customers, checkouts, and ledger records. The initial switch copies your identity and organization membership; it does not copy live payment data or credentials. Create test products and API tokens in this dashboard. Production tokens cannot access sandbox, and sandbox tokens cannot access production. Use Switch to live to return to your live dashboard.

Test PayPal payments

PayPal sandbox uses accounts from the PayPal Developer Dashboard. The deployment REST application must belong to a sandbox Business account. Complete checkout with a different sandbox Personal account acting as the buyer. OurPay selects the deployment’s PayPal sandbox application automatically. For PayPal wallet payments, approve with a sandbox Personal account. Embedded card fields appear only when that sandbox application is eligible for Advanced Card Payments; use test cards from the PayPal Developer Dashboard. Sandbox eligibility does not grant capabilities to your live Business account.
1

Create a product

Create a low-value one-time product or subscription in the sandbox OurPay organization.
2

Enable PayPal

Open Settings → Payment providers and enable PayPal. Sandbox mode does not require a complete invoice-issuer address, but adding the same legal details you expect in production catches document problems earlier.
3

Open a checkout

Create a Checkout Link or Checkout Session, enter a customer email and billing country, and select Pay securely with PayPal.
4

Approve as the buyer

Sign in with the sandbox Personal account on PayPal, approve, and return to OurPay.
5

Verify the result

Confirm the PayPal capture and then verify the OurPay Payment, Order, invoice, receipt, customer, and Seller Payable entries. The confirmation page alone is not sufficient evidence.

Subscription prerequisite

One-time payments require Orders v2 but not payment-method vaulting. Paid subscriptions, free trials, and renewals require all of the following in the sandbox deployment:
  • OURPAY_PAYPAL_VAULTING_ENABLED=true
  • The receiving sandbox Business account’s PayPal merchant ID
  • Save-payment-method/Vault capability on the PayPal REST application
When those capabilities are absent, OurPay intentionally rejects subscription checkout with PayPalCheckoutUnsupported instead of creating a subscription it cannot renew. Test a paid first cycle, a free trial setup token, an automatic renewal, a failed renewal, and a cancellation. A successful one-time capture does not prove subscription vaulting works.

Test USDC and domestic payments

Sandbox USDC uses native test tokens on Base Sepolia and Polygon Amoy. Fund a separate test wallet with test USDC and the corresponding gas token. Mainnet transactions and tokens are rejected in sandbox. Live mode continues to use its configured mainnets and receiving wallets. Sandbox UPI and bank transfer checkout provides Simulate success and Simulate failure controls. These create test results through OurPay’s normal order flow without contacting a bank or moving money. They do not generate a real UPI payment request. Live UPI and bank transfers use the live organization’s payment configuration.

API and SDK

Use https://api.sandbox.ourpay.dev as the API base URL. The repository SDKs select it with the sandbox environment option. For an older installed SDK, pass this explicit base URL until you upgrade.
Use OurPay’s hosted sandbox for development and the production API for live payments.

Failure cases to exercise

  • Buyer cancels on PayPal and returns to checkout
  • PayPal declines or reverses approval
  • The browser closes after approval but before the return redirect
  • Duplicate delivery of the same webhook event ID
  • Pending, denied, refunded, and reversed captures
  • Full and partial refunds
  • Lost and won disputes
  • Subscription checkout with vaulting disabled
  • A currency unsupported by PayPal or mismatched with the seller ledger
The order-approved webhook should allow server-side completion even if the buyer closes the browser. Duplicate webhook delivery must not create a second payment, order transition, invoice, or ledger entry.

Email limitation

Customer-facing sandbox emails are delivered only to recipients who are members of the sandbox organization. Add test recipients under Settings → Members. Sub-addressing aliases such as you+checkout@example.com are accepted when the underlying address is a member.

Going live

Sandbox and live PayPal credentials are different. Before switching:
  1. Add the organization’s complete legal invoice name and address.
  2. Configure the live Business REST app, merchant ID, and webhook ID.
  3. Obtain the PayPal capabilities and approvals required for the actual collection model.
  4. Repeat the full flow with a legitimate low-value live product.
Never paste live secrets into source code, documentation, browser-visible environment variables, or support messages.