RotaProxy charges through two providers: PayPal for wallet and card payments, NOWPayments for Bitcoin and USDT (TRC-20). Payment methods without keys are shown as unavailable at checkout.
1. Add keys
Copy .env.example to .env and fill in:
PAYPAL_ENV=sandbox
PAYPAL_CLIENT_ID=...
PAYPAL_CLIENT_SECRET=
PAYPAL_WEBHOOK_ID=
NOWPAYMENTS_API_KEY=
NOWPAYMENTS_IPN_SECRET=
NOWPAYMENTS_USDT_CURRENCY=usdttrc20
PUBLIC_BASE_URL=https://your-domain.com
Restart the server after editing .env. Never commit real keys.
2. PayPal setup
- Open the PayPal Developer Dashboard, go to Apps & Credentials, and create an app (first in the test environment with
PAYPAL_ENV=sandbox, later in live). - Copy the Client ID and Secret into
.env. Test-environment cards and wallet work immediately. - Register a webhook: Apps & Credentials → your app → Webhooks → Add Webhook with URL:
https://your-domain.com/api/webhooks/paypal, subscribed toPAYMENT.CAPTURE.COMPLETED. - Copy the Webhook ID into
PAYPAL_WEBHOOK_ID— signature verification fails closed without it.
How it works: the checkout page loads PayPal-hosted buttons and card fields, our server creates the order (POST /v2/checkout/orders), the buyer approves in PayPal’s UI, and our server captures (POST /v2/checkout/orders/{id}/capture). The webhook fulfills any capture the browser missed.
Live cards need approval. PayPal’s Advanced Credit & Debit Card Payments work in the test environment by default, but live card fields require your business account to be approved for the product. Until then, live buyers can still pay with the PayPal wallet button.
3. NOWPayments setup
- Create an account, set your payout wallet, and copy the API key into
NOWPAYMENTS_API_KEY. - In Payment Settings, generate the IPN secret and copy it into
NOWPAYMENTS_IPN_SECRET. - No dashboard callback URL is needed — the site sends
ipn_callback_url(/api/webhooks/nowpayments) with every payment.
How it works: our server creates a payment (POST /v1/payment, pay_currency btc or usdttrc20), shows you the live address and exact amount, polls the payment status, and fulfills on finished/confirmed. The IPN callback is a second fulfillment path with HMAC-SHA512 signature verification.
4. Local testing vs webhooks
- Localhost is fine for the full PayPal test flow (popup approval + server capture) and for crypto status polling.
- Webhooks cannot reach localhost. Deploy (or tunnel) with a public
PUBLIC_BASE_URLto test the webhook path end to end.
5. Go-live checklist
- PayPal app switched to Live credentials,
PAYPAL_ENV=live. - Live webhook registered and
PAYPAL_WEBHOOK_IDupdated. - Card fields approved on the live business account (or wallet-only launch).
- NOWPayments production key + IPN secret in place, payout wallet verified.
- One real small purchase per method, then refund it from each dashboard.
-
.envbacked up securely, never committed.