October 2017
Intermediate to advanced
370 pages
8h 57m
English
While AMP doesn't support the Payment Request API natively, it offers support through amp-iframe via a dedicated attribute: allowpaymentrequest. When this attribute is included, then the iframe is permitted to pop up the payment request UI that will allow the user to enter any personal, delivery, and credit information required.
To implement the checkout process, we'll add a checkout button using an amp-iframe that includes this attribute. The iframe source will then contain the JavaScript that actually triggers the payment request UI when the button is clicked. So, we'll add the button to our product page (/ch9/product.html) with the following amp-iframe:
<amp-iframe width="130" height="42" ...
Read now
Unlock full access