0
votes

I am integrating stripe payment gateway. i have integrated it successfully. but the problem is that i want to send exptra parameter for stripe one time and get that in response. Now i using

               Stripe_Charge::create(array(
                    "amount" => number_format($amount,2,".","")*100,
                    "currency" => AccountCurrency,
                    "card" => $_POST['stripeToken'],
                    "description" => "Desc: " . $custom
                ));

I want to send extra partameter like order_id and want that from response as stripe give customer id for recurring charge.

       Stripe_Charge::create(array(
                    "amount" => number_format($amount,2,".","")*100,
                    "currency" => AccountCurrency,
                    "card" => $_POST['stripeToken'],
                    "description" => "Desc: " . $custom,
                    "Order_id => $order  // Is there any method to send paramerte like this.
                ));

Thank you.

2

2 Answers

1
votes

You can use the metadata attribute. See below -

Stripe_Charge::create(array(
    "amount" => number_format($amount, 2, ".", "")*100,
    "currency" => AccountCurrency,
    "card" => $_POST['stripeToken'],
    "description" => "Desc: " . $custom,
    "metadata" => array("order_id" => $order)
));

Check the documentation here

0
votes
// Get Logged Customer Id using Logged User's Email
Dictionary<string, string> Extra = new Dictionary<string, string>();
Extra.Add("email", ByEmail);
StripeCustomer customer = customerService.List(new StripeCustomerListOptions() { Limit = 1, ExtraParams = Extra }).SingleOrDefault();