Description of the item is never actually displayed to the end use via Coinbase API

1.9k views Asked by At

I am trying to create a simple payment system for bitcoins using coinbase API and this lovely script I found on github

Everything works smoothly, but I would like to be able to take the users delivery address as well.

I am using the following to create a payment button:

$response = $coinbase->createButton("This is an item", "$amount", "BTC", "Trackcode",     array(
"description" => "Item Description here"
    ));
echo $response->embedHtml;

I noticed that the description of the item is never actually displayed to the end user.

"description" => "Item Description here"

I am thinking this may be used as a reference for the merchant once a transaction has taken place. If this is true, I could take advantage of this by having the users delivery address parsed in to the "item description". This should then be displayed to me in my merchant account over at coinbase.

I know I could quite easily test this myself by making a transaction, but my "wallet" is empty at the moment.

Does anyone with any experience with coinbase know if this is true?

3

There are 3 answers

2
nahtnam On

Have you tried using their api library? https://github.com/coinbase/coinbase-php It has a nice documentation and is almost error free. It should be fairly simple if you use this api. Here is the sample provided for payment buttons in the github doc.

$response = $coinbase->createButton("Your Order #1234", "42.95", "EUR", "my custom tracking code for this order", array(
            "description" => "1 widget at €42.95"
        ));
echo $response->button->code;
// '93865b9cae83706ae59220c013bc0afd'
echo $response->embedHtml;
// '<div class=\"coinbase-button\" data-code=\"93865b9cae83706ae59220c013bc0afd\"></div><script src=\"https://coinbase.com/assets/button.js\" type=\"text/javascript\"></script>'
0
slightlyfaulty On

The description parameter is only displayed on Coinbase's Payment Pages. The custom parameter (4th argument in createButton function) is recommended for returning data after payment is made, however, the description parameter will also be returned in the Callback response for Payment Buttons or Payment iFrames.

Not sure if this helps, but Coinbase also allows an include_address parameter (boolean) which prompts the buyer for their shipping address before displaying the payment options.

Parameter Reference: https://coinbase.com/api/doc/1.0/buttons/create.html

0
rjmacarthy On

I found the official Coinbase script quite unsuccesfull, so I wrote my own.

Hope this helps...

https://github.com/rjmacarthy/coinbase-api-php