0

I'm using coinbase-php and have run into a problem:

I have tried so many things but I honestly don't understand how to pass options to the create button function. I noticed how they pass the description option but when I try to do the same for variable_price it does not appear to work. Here is what I tried:

$button = $coinbase->createButton("TipModel", "0.01", "USD", "", array("variable_price" => True))->embedHtml;

It still is a fixed price though.

SteveDeFacto
  • 1,317
  • 4
  • 19
  • 35

2 Answers2

2

It seems to be a bug, your code seems to be correct. Some one else commented it too that the variable_price does not work in the php api.

Vladimir • a month ago

There is a problem with creating customized button with option "variable_price"=>"true" using coinbase.php class from github. Such a button does not have input field for number of btc to send. The value is fixed, no matters variable_price is set for true or false. All other custom options works good.

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

vincent kleine
  • 724
  • 1
  • 6
  • 22
  • Interestingly, after looking at the code I see no reason it should be any different than other options, however, it does appear that there is something wrong with it. Possibly there could even be something wrong with the coinbase api. I am going to start a bounty to see if anyone can come up with a work around. – SteveDeFacto Jan 31 '14 at 01:40
0

If you do the choose_price option too, it seems to work. Try this:

$button = $coinbase->createButton("TipModel", "0.01", "USD", "", array("variable_price" => true, 'choose_price' => true))->embedHtml;
Farkie
  • 3,307
  • 2
  • 22
  • 33