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
Post a Comment