php - Using a variable for amount in Stripe Payment Gateway -


i trying integrate stripe payment onto site. have php variable '$val' set price amount sent form

$val = $_post['myfieldname']; 

i'm trying use variable charge amount holds stripe

 stripe_charge::create(array(                              "amount" =>  $val ,                             "currency" => "gbp",                             "card" => $_post['stripetoken'])); 

but seems stripe wont except variable. puts 'missing required param: amount' error on page wants accept actuale integer such '1234' tried cast int using => intval($var) nut no joy. tell me im going wrong

thnks

you should try this

stripe_charge::create(array(   "amount" => 400,   "currency" => "usd",   "card" => "tok_14igbg2ezvkylo2cm0akcrhg", // obtained stripe.js   "description" => "charge test@example.com" )); 

description field missing per documentation


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -