paymentUrl pointing to a hosted payment page. You can share this URL directly with your customer or embed it in your application as an iframe.
Standalone usage
Share thepaymentUrl with your customer via link, email, or redirect. When the customer completes the payment:
- If you provided a
successRedirectUrl, the customer is redirected there - If you provided a
failureRedirectUrl, the customer is redirected there on failure - If no redirect URLs are set, the portal displays a confirmation message
Embedding the payment portal
You can embed the payment page directly in your application for a seamless checkout experience.Prerequisites
Addplatform.paygentic.io to your Content Security Policy frame-src directive:
Implementation
SESSION_ID with the session ID from the paymentUrl returned by the API. The paymentUrl is in the format https://platform.paygentic.io/portal/pay/{sessionId}.
Handling payment events
When embedded in an iframe, the portal sendspostMessage events instead of redirecting. Listen for these events to update your UI:
| Event type | When triggered |
|---|---|
payment_success | Payment completed successfully |
payment_error | Payment failed or was cancelled |
How redirects work: When the portal is loaded as a standalone page, it uses
successRedirectUrl and failureRedirectUrl for navigation. When embedded in an iframe, it sends postMessage events instead. The portal detects the context automatically.Understanding sandbox attributes
Understanding sandbox attributes
The
sandbox attribute is required for security. Each value serves a specific purpose:allow-scripts— Portal JavaScript functionalityallow-same-origin— Communication between the portal and your siteallow-forms— Payment form submissionallow-popups— 3D Secure authentication popups
Next steps
- Payments — Create payments via the API
- Customer Lifecycle — Subscription portal and customer management
- Create Payment API Reference — Full endpoint documentation