Iframe the Hosted Gateway
Instead of redirecting to the Hosted Gateway, it is also possible to display it in an iframe.
Important Note: If you are going to display invoices within an iframe, DO NOT include a the parameter
"redirect_url" when creating the invoice.
Insert an iframe with the following syntax into your checkout page.
<iframe src="https://gateway.gocoin.com/invoices/:id" style="width: 640px; height: 600px; border: none; box-shadow: 1px 1px 3px #333;" allowtransparency="true" frameborder="0"></iframe>
The GoCoin Gateway enables your page to perform an action when a payment is received. The Gateway publishes the following events via postMessage:
|Event||Trigger||Invoice status||Indended Action|
|invoice_expired||15 minute payment window expires.||unpaid||Redirect your customer back to the shopping cart and ask them if they still want to pay, or to contact support if they paid and the transaction was delayed.|
|invoice_underpaid||A payment is received but does not cover the invoice balance.||underpaid||Do nothing, the page instructs the customer to pay the remainder.|
|invoice_paid||Payment was received and the balance was met or exceeded||paid||Redirect your user to a thank you page, or alert them that their order is being processed.|
Best practice on "invoice_paid" (invoice.status is 'paid') is to redirect your user to a 'success' or 'thank you' page, and process their order after the invoice state changes to
Note: The invoice is not considered valid until it has reached 2 confirmations on the Blockchain, which is the invoice state
"ready_to_ship". Our webhook system sends this event, but the Gateway does not, as it will take 10-20 minutes for 2 confirmations to occur.
Add the following JS to the page containing the iframe:
^^ You can edit each of the case blocks to perform whichever actions you prefer.
- How do we know if a transaction is complete?
- Can I use GoCoin if I am not an incorporated business? If so, when prompted for proof of incorporation, what should I submit?
- I just submitted my KYC docs. How long does it take to be approved?
- How long does it take to receive two confirmations?
- Where should I send my suggestions for adding altcoins?
- View all (11 more)