2. Fetch identification form
The identification form is a standard HTML form (in an <iframe>) that must be displayed in the shop. seQura uses the form to ask the shopper for more information than was included in the original solicitation. The form is dynamic in several ways:
- seQura might ask shoppers for different information based on who they are and what is in their baskets.
- Depending on the shopper's response, the form might grow or shrink during the checkout.
For these reasons, the form is mandatory and cannot be cached.
To fetch the form, issue a GET
to the form_v2
resource of the order URL returned in the previous step. The resource accepts up to three configuration parameters, all of them optional
product
defaults toi1
. To get a form adapted to the "pp3" part-payment product useproduct=pp3
campaign
defaults to first active campaign, not needed for most products.ajax
defaults tofalse
. If the form will be delivered from the shop servers to the checkout page using AJAX useajax=true
Payment Methods API can be used to get the available products and campaigns.
Request Example (cURL)
$ curl -i -X GET -u $SQPASS -k \
-H 'Accept: text/html' \
https://sandbox.sequrapi.com/orders/1dc26b35-06f6-41d6-b6f5-d0eb6c66aad1/form_v2
Response Example
HTTP/1.1 200 OK
Cache-Control: max-age=0, private, must-revalidate
Content-Type: text/html; charset=utf-8
Date: Mon, 06 Feb 2017 17:33:41 GMT
ETag: "4eb32f668768650a9f66f9233a111406"
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Request-Id: 373cec11-9cff-4f0d-86c1-1fa69d7dd3d0
X-Runtime: 0.008903
X-XSS-Protection: 1; mode=block
Content-Length: 645
Connection: keep-alive
<iframe
id='sq-identification-i1'
name='sq-identification-i1'
class="sq-identification-iframe"
src="https://sandbox.sequrapi.com/orders/1dc26b35-06f6-41d6-b6f5-d0eb6c66aad1/pumbaa_form?debug=true&product_code=i1&secret=95ac28f9-60a5-458d-92c0-cd9e57269a89&uuid=1dc26b35-06f6-41d6-b6f5-d0eb6c66aad1"
frameborder="0"
style="display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:999999;">
</iframe>
<script type="text/javascript">
window.SequraFormElement = 'sq-identification-i1';
</script>
<script src='https://sandbox.sequrapi.com/assets/sequra_form-426feaf2ac0bc998c048bb3c6dff5348.js'></script>
Once you have the form you can load it on your site by using:
<script type="text/javascript">
(function(){
window.SequraFormInstance.show();
})();
</script>
In case you want some code to be executed when the form is closed, you can use:
<script type="text/javascript">
(function(){
var sequraCallbackFunction = function() {
//your code here....
}
window.SequraFormInstance.setCloseCallback(sequraCallbackFunction);
window.SequraFormInstance.show();
})();
</script>
About the form
The identification form may contain different fields depending on a number of factors: known data from step 1, content of the cart, time of day, etc. Typical fields are birthdate and mobile number.
Depending on the shopper's answers, further fields might be added to the form dynamically, e.g. to ask the shopper to enter a PIN code that was sent to their mobile.
Once seQura accepts the credit risk for this purchase, the shopper is redirected to a custom action in the shop, which you must create as part of the integration. (The URL of the custom action should be included in the data sent in the step 1)
The store may already have all the data needed and it may be tempting to send the information directly to the API, but the form is fully dynamic and it's a negotiation between seQura and the shopper that cannot be simulated by anyone else.
The form includes the shopper's personal information to make it clear for whom the shopper should provide additional information. If this data is displayed elsewhere in the page, it's perfectly fine to hide it before presenting the form to the shopper.
Form errors
Some errors the shopper may encounter while interacting with seQura through the form:
- Shopper too young: warns the shopper, removes the submit button
- Incorrect mobile phone number: warns the shopper
- Other reasons: tells the shopper to employ another payment method. For example, in the sandbox environment, the credit limit is 400 €. (There is no general limit in production; there, orders will be assessed on a case-by-case basis.)
Updated 5 days ago