When you create a payment page, it will give you code like this example.
<a href="https://www.coinbase.com/checkouts/2b30a03995ec62f15bdc54e8428caa87" target="_blank" rel="noreferrer noopener">Donate Bitcoins</a>
Any bitcoin sent using the sample page will be donated to the charity depicted.
The page generator is the easiest way to get started:
The only required paramaters are a name and price. Once a page is generated, you’ll be given a sample link to copy and paste into your website. You are of course welcome to modify the link in any way, such as changing the text or using a button as the link target.
Payment pages are very similar to payment buttons and are stored in the same way underneath by Coinbase. This means you can use the Checkouts API to also generate payment pages.
Once you get a
code parameter returned from the API you can use it to contruct a link to a payment page with the following format:
If you’d like to change the custom attribute after a page is created, you can do so by including
custom=YOUR_CUSTOM_PARAM on the end of the URL. This will be included to order’s
This will update the generated order and get passed through in the callback to your site. This is a good way to use the same page but pass through a different custom parameter on each order.
The URL parameter can also be abbreviated as
c=1234 if you’d like to keep it shorter.
When a user leaves your site to visit a payment page, it’s often useful to redirect them back to a specific url. You can customize three types of redirect URLs:
|Success URL||Users will be redirected to this url after successfully completing an order or payment. You may want to provide the user with an updated account status on this page, or an indication that their payment was successful.|
|Cancellation URL||Users will be redirected to this url if we are unable to confirm their payment or they click cancel.|
|Info URL||Users will be redirected to this url if they want to learn more about how to pay with bitcoin on your website.|
All redirect urls are optional. If a redirect URL is left blank, Coinbase will redirect the user to your general website url (usually your homepage) or failing that, the Coinbase homepage.
You can set redirect URL’s from the merchant settings page.
When redirecting to a success or cancel page, we will also include URL params. These can be useful to help determine the user or order in question via the
custom param if you want to customize the page.
However, it’s important to note that you should never mark an order as paid in your records based on a redirect url. This url can be easily guessed by malicious users. Only notifications should be used to update your records.