如何在条带电荷中发送额外的参数。

时间:2016-07-23 10:06:45

标签: php stripe-payments

我正在整合条形支付网关。我已成功整合它。但问题是我想发送一段时间的exptra参数并获得响应。 现在我用

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

我想发送额外的分配器,例如order_id,并希望从响应作为条带给客户ID重复充电。

       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.
                ));

谢谢。

2 个答案:

答案 0 :(得分:0)

您可以使用元数据属性。见下文 -

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

查看文档here

答案 1 :(得分:0)

// 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();