Search code examples
phpcoinbase-php

Creating a variable price button with the php coinbase api


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.


Solution

  • 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;