---
title: EMBED Payment iFrame
slug: embed-payment-iframe
createdAt: 2022-03-23T02:38:33.000Z
---

Depending on who's paying (merchant or patient) will determine which payment methods are available as well as the configurations of those payment methods.&#x20;

- Published Merchant Key = staff/merchant facing and will allow access to staff only payment methods such as cash
- Published Patient Key = consumer/patient facing and will allow access to patient only payment methods such as PayPal&#x20;

From your frontend code, take the order id and order key from the create order response, and embed the payment page. The public key will dictate whether the merchant facing or consumer/patient.

This iFrame has been optimized for 500px wide but is responsive.

- Include (for Prod):

:::BlockQuote
\<**script** src="https\://pay.featherpay.io/featherpaymerchant.js">\</**script**>
:::

- Include (for Staging):

:::BlockQuote
\<**script** src="https\://gfp-pay.acdev.io/featherpaymerchant.js">\</**script**>
:::

- Create UI div in your page:

:::BlockQuote
\<**div** id="featherpay">\</**div**>
:::



```javascript
var config =
{
    orderId: 'orderId', // Received after creating an order
    orderKey: 'orderKey', // Received after creating an order
    publicKey: 'publicKey', // FeatherPay to provide per-store
    selector: document.querySelector('#featherpay'),
    onCancel: function () {},
    onReady: function () {},
    onComplete: function (order) 
    {
        console.log(order.id, order.status, order.state);
    }
};

var fp = new FeatherPay(config);
// Passing in a selector will auto embed for you, otherwise you can embed like this
var target = document.querySelector('#featherpay');
fp.embed(target);

```



