1

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?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Chris 'Pig' Hill
  • 175
  • 2
  • 12

3 Answers3

1

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

Hope this helps...

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

rjmacarthy
  • 2,164
  • 1
  • 13
  • 22
0

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>'
nahtnam
  • 2,659
  • 1
  • 18
  • 31
  • I am using the API library. The code you provided is the same code I mentioned. I got some BTC in the end, and tested it. It works like I thought it would. Also, if anyone is interested. The "my custom tracking code for this order" part shows up as "Custom param" in the coinbase account. This would be a better option to use to get customers details. – Chris 'Pig' Hill Jan 09 '14 at 09:57
  • 1
    Sorry I didnt notice that. Also if the API stops working for some reason and you can't get it to work, you could create a custom button in the coinbase ui. – nahtnam Jan 09 '14 at 15:53
0

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

slightlyfaulty
  • 1,401
  • 14
  • 13