Paytabs provides you with a collection of API endpoints which used to process all payments, regardless of if they are through either your own payment pages, the managed payment pages, or if you are using the hosted payment pages.
This article is dedicated to the clarification of the Framed (framed) parameter. "framed" is one of the optional parameters of the request, which allows you to host the payment page in an embed frame within your site page itself.
For more information please check our How to not redirect my customers to an external payment page? (iFrame/Embedded Mode)solution article.
Note that ApplePay payment method does not operate in iFrame modes
In this article, you will be going to know:
Specifications
Framed
The Parameter Tag/Name framed JSON Example Data Type BOOLEAN Required ❌Validation Rules - true or false
Framed Return Top
The Parameter Tag/Name framed_return_top JSON Example Data Type BOOLEAN Required ❌Validation Rules - true or false
Framed Return Parent
The Parameter Tag/Name framed_return_parent JSON Example Data Type BOOLEAN Required ❌Validation Rules - true or false
Usage Workflow
Along with the required parameters mentioned in our Step 3 - PT2 API Endpoints | Initiating the payment solution article, you may need to set the "framed" as shown below:
Sample Request Payload
Sample Response Payload
The Expected Parameter Behaviors
To enable the framed mood, you need at least use the framed property. The other properties (framed_return_top, framed_return_parent) are optional to control the reload/redirect behavior. To preview the payment page within your page instead of redirecting to the payment page.
Now you can use the redirect_url within the HTML iframe tag to embed the payment link in your site as shown below:
<iframe src="https://sec******.paytabs.com/payment/page/599******0AC4EB3D4B8B5948324" width="" height=""></iframe>
- Passing a true framed_return_top
- Passing a true framed_return_parent
- Using redirect URL from none farmed request
Passing a true framed_return_top
Indicates whether to reload the whole page on redirections or just reload the current frame
Passing a true framed_return_parent
Indicates whether to reload the main base (could be div or another iFrame tag) that contained the payment page framed element.Using redirect URL from none farmed request
If you tried a redirect_url that belongs to none-framed transactions, the server would display this error "paytabs.com refused to connect", as shown below: