Meta provides a Software Development Kit (SDK) for JavaScript to help you integrate Meta payment experiences into your online store more easily. If you are using a Payment Processor, Payment Gateway or Commerce Platform for processing your transactions, you may have to reach out to them to obtain details about how to incorporate Meta payment experiences into your existing integration. For more information, see Overview of Meta Pay Integration.
Follow the decision graph to determine your integration pattern:
Before proceeding with this section, make sure you have read through Determine your integration pattern
To install the Meta payments Javascript SDK, we highly recommend that you add its base code between the opening and closing head tags on every page where you intend to display Meta Pay button. The SDK is available at:
https://static.xx.fbcdn.net/payments_sdk/v1/metapay_sdk.js
Example integration:
<head> ... <script src="https://static.xx.fbcdn.net/payments_sdk/v1/metapay_sdk.js"></script> ... </head>
Please set the HTTP response headers within your server's configuration file as detailed below:
Content-Security-Policy: default-src ‘self’ static.xx.fbcdn.net graph.facebook.com;
Before proceeding with this section, make sure you have read through Determine your integration pattern
The following is the reference for the JavaScript SDK for Meta payments.