pay.yourstore.com, instead of secure.payviox.com. Your customers see your domain in the address bar, and the payment page works the same way.
Why use a custom domain
Some internet providers ship security filters that block domain names they don’t know well, for example the filters built into some home routers, or DNS filtering at the provider. These filters can blocksecure.payviox.com. The customer then sees an error page or a page that never loads, and can’t pay. Nothing reaches Payviox, so the payment session just expires.
These filters block by name. A checkout served from your own domain, which the customer already reached to shop with you, gets through.
secure.payviox.com keeps working after you add a custom domain. You choose, integration by integration, which address you send your customers to.What changes, and what doesn’t
api.payviox.com. Those are server to server, and the filters don’t affect them.
The rest works as before: the customer’s IP address reaches Payviox unchanged (the ip parameter of POST /session and the fraud checks keep working), and the domain serves both test (pk_test_/sk_test_) and live sessions.
Before you start
You need:- A domain you own, and access to its DNS settings (at your registrar or DNS provider).
- A subdomain you don’t use for anything else, for example
pay.yourstore.comorcheckout.yourstore.com. Payviox serves the whole subdomain, so pick one that has no website, email or other DNS record on it. Deeper subdomains such aspay.shop.yourstore.comwork too. - The Manage settings permission on your Payviox business. Team members without it can see the domain and its status, but can’t add or remove it.
Set up your domain
Open the Checkout Domain settings
Enter your subdomain
pay.yourstore.com, then click Connect domain.The dashboard rejects:- a root domain (
yourstore.com): use a subdomain; - a domain that contains
payviox; - a domain already connected to another Payviox business.
https://, a path or a trailing dot are ignored.Add the CNAME record at your DNS provider
pay.yourstore.com). Use whichever form your provider asks for. If your provider shows a preview, it should read pay.yourstore.com pointing to the .pages.dev target, not ….pages.dev.yourstore.com (some providers need a trailing dot after the target to prevent this).A CNAME can’t coexist with other records on the same name: delete any A, AAAA, TXT or MX record on your subdomain first.If your domain has CAA records, they must allow the certificate authorities that issue the certificate (letsencrypt.org and pki.goog). Without a CAA record, there’s nothing to do.Wait for the Active status
https://pay.yourstore.com/sdk.js in your browser: it returns the JavaScript SDK. Then create a test session and open https://pay.yourstore.com/{session_id}: the payment page loads on your domain.Domain statuses
Use your domain
Once the status is Active, the tab shows ready-to-copy snippets with your own domain. In the examples below, replacepay.yourstore.com with your subdomain.
Without the SDK: redirect or iframe
If you send customers to the payment page yourself (HTTP redirect, payment link, or iframe), use thecheckout_url returned by POST /session. Once your domain is active, it already points to your subdomain:
checkout_url, you have nothing to change: new sessions go to your subdomain as soon as the domain is Active. If you build the URL yourself from session_id, switch to checkout_url, or replace the host:
https://api.payviox.com.
message listener accepts. The payment page now sends its iframe events from your subdomain:
www.yourstore.com) to be whitelisted in your dashboard settings, as with secure.payviox.com. Your checkout subdomain itself doesn’t need to be whitelisted.With the SDK: checkoutUrl
Pass your subdomain as checkoutUrl when you create the SDK instance. The SDK then opens the payment page on your domain, sends its own API calls through https://pay.yourstore.com/api, and accepts iframe events from your domain.
The recommended integration doesn’t change: your backend creates the session with your secret key, and the browser opens it with openSession().
openIframe(), createSession() and getPaymentsMethods() use your domain the same way. With the npm package:
checkoutUrl must start with https://; otherwise the constructor throws checkoutUrl must be an https URL. Only the origin is used: a path or a trailing slash is ignored. Without checkoutUrl, the SDK behaves as before (api.payviox.com and secure.payviox.com). See the Payviox class reference.
Content Security Policy
If your site sends aContent-Security-Policy header, allow your subdomain in the directives you use. Keep secure.payviox.com (and sdk.payviox.com) too, so you can switch back at any time:
Server side, webhooks and subscriptions
- Server-side calls with your secret key (
sk_) stay onhttps://api.payviox.com:POST /session,GET /payment/{session_id}, subscriptions, balance. Don’t send them to your subdomain. - Webhooks don’t change: same URL, same events, same HMAC-SHA256 signature.
- Payment links (emails, fallbacks): send the
checkout_urlfrom the session response. If you build links yourself, replacesecure.payviox.comwith your subdomain there too, ideally from a single setting so you can switch back in one place. - Subscriptions: while your domain is active, the customer’s self-service
management_url(in webhooks and the subscriptions API) points to your subdomain:https://pay.yourstore.com/subscription/.... Always use the URL Payviox gives you rather than rewriting its host. The same link also works onsecure.payviox.com.
Switch back, remove or change your domain
To switch back tosecure.payviox.com while keeping the domain connected, change your integration: remove checkoutUrl from the SDK, or stop using your subdomain in the URLs you build. Both addresses keep working, so nothing breaks for customers already on your subdomain. checkout_url keeps pointing to your subdomain as long as the domain is active.
To remove the domain, click Remove domain in the Checkout Domain tab and confirm. Your subdomain stops serving the checkout immediately:
- switch your integration first, and wait for open payment sessions to finish or expire;
- links on your subdomain that you already sent break, including subscription
management_urllinks sent by email. Newcheckout_urlandmanagement_urlvalues go back tosecure.payviox.com.
Limits
- Subdomains only: root domains (
yourstore.com) aren’t supported. - One domain per business.
- A domain belongs to one business: the same subdomain can’t be connected to two Payviox businesses.
- The subdomain must be dedicated to the Payviox checkout: Payviox serves every path on it.
Troubleshooting
Stuck on Waiting for DNS
Stuck on Waiting for DNS
- Check the message under the record: “No CNAME record found” means the record doesn’t exist yet or hasn’t propagated; “points to X instead of Y” means the target is wrong.
- Make sure the record type is CNAME (not A or TXT), and the target is exactly the value shown in the dashboard.
- Some providers add your domain to the name automatically: if you typed
pay.yourstore.comas the name, the record may have becomepay.yourstore.com.yourstore.com. Trypayalone. - On Cloudflare, a Proxied record hides the CNAME: set it to DNS only.
- Check the record from a terminal:
dig +short CNAME pay.yourstore.comshould print the target. - After 72 hours, background checks stop: click Check now once the record is fixed.
Cloudflare error 1014 on my subdomain
Cloudflare error 1014 on my subdomain
Status is Error
Status is Error
letsencrypt.org and pki.goog. Then click Check now."Custom checkout domains are not available yet on this platform"
"Custom checkout domains are not available yet on this platform"
The SDK still opens secure.payviox.com
The SDK still opens secure.payviox.com
- Check that you pass
{ checkoutUrl: 'https://pay.yourstore.com' }as the second argument ofnew Payviox(). - An old copy of the SDK ignores
checkoutUrl. Loadhttps://pay.yourstore.com/sdk.js, or update@payviox/sdk.
Iframe events are ignored
Iframe events are ignored
message listener still checks event.origin against https://secure.payviox.com. Change it to your subdomain, or use the SDK with checkoutUrl, which handles it for you.Related
Choose your integration method
Payviox class
checkoutUrl