For the complete documentation index, see llms.txt. This page is also available as Markdown.

Inline Display Method for 3D Secure

The inline view framework allows merchants to receive the UI elements from Songbird and inject the elements directly into their page to appear as if their website has rendered the content. This view framework provides you with the most control over the UI , but also requires you to do the most amount of work.

Configuration for Inline

To use the inline option, the framework must be set to “inline” when running the configure() method.

Example

Cardinal.configure({ 

  payment: { 

    framework: 'inline' 

  } 

}); 

Setup Events

With the inline view framework, we need to subscribe to a passive event, ui.inline.setup, for injecting the actual content into the merchant's website. This event will receive four arguments:

  • Html Template - This is the element that needs to be injected.

  • Inline Data Object - An object that describes the current UI experience and how the merchant should render it.

  • Resolve function - A function to call when you have successfully injected the html template.

  • Reject function - A function to call when you have encountered an error and are unable to inject the html template.

The merchant is required to inform Songbird when they have successfully injected the content into the page, or have failed to do so. Songbird will not move forward with the transaction until either the resolve or reject functions have been called. Be sure to have good error handling in this event handler or you could cause the consumer to be stuck if you don't properly call either resolve or reject.

The inline data object will contain information related to the current transaction and allow you to intelligently render for specific payment types, and different variations of each payment type. Additionally, this object will include the height and width of the html template to allow you to adapt the element receiving the html template accordingly.

Its important to know that html templates injected into the page will be cross-domain iframe. This means that if the injected html template is moved after Songbird has started the cross domain rendering, the content within the iframe will be whipped away by the browser. There is nothing Songbird or CardinalCommerce can do about this behavior, it is built into the browsers themselves.

Once the html template has been injected, moving the elements around the DOM will cause the content to be deleted by the browser. For more on this, refer to this SO article.

Implementation Example

Using the above implementation, you can specify the location of the pop-up by setting the relevant HTML element’s ID to “my-visbile-wrapper".

Example

When Continue.continue() is called, the pop-up will display within the above div element.

Last updated

Was this helpful?