如何在 stripe charge 中发送额外的参数。

How to send extra parameter in stripe charge.

我正在集成条纹支付网关。我已经成功整合了它。但问题是我想为 stripe 发送一次 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.
                ));

谢谢。

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

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

检查文档 here

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