How it works...

In order to display an attractive popup on the client side, we need to create a QWeb template. In step 1, we created the QWeb template no_credit_info. This is made with simple bootstrap contents. Note that it just contains static HTML content. In the next step, we added the template file to the app manifest.

After designing the template, you need to pass the template XML reference to the iap.charge() method. This can be passed through the optional credit_template parameter. In step 3, we passed a template reference to the charge method. After passing the template, if the InsufficientCreditError is raised, then the template will be passed along with the error message to the customer. On the client side, if an error message is received with the template body, then this custom template will be displayed in a popup instead of the default popup.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset