简体   繁体   English

如何将自定义参数发送到 twilio-pay

[英]How to send custom parameters to twilio-pay

I am able to use Twilio pay to charge a credit card.我可以使用 Twilio pay 从信用卡中扣款。 However, there is no way to send a orderid parameter with my payment details.但是,无法发送包含我的付款详细信息的 orderid 参数。 Its very hard to know the payment is for which order since we do not have any parameter to match the person who is paying.很难知道付款是针对哪个订单,因为我们没有任何参数来匹配付款人。

There are two things you can do here.您可以在这里做两件事。 As Chetan has suggested in the comments, you can set your order ID as a URL parameter in the callback URL. eg:正如 Chetan 在评论中建议的那样,您可以在回调 URL 中将订单 ID 设置为 URL 参数。例如:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>Calling Twilio Pay</Say>
  <Pay chargeAmount="20.45" 
    action="https://enter-your-callback-function-url.twil.io/pay?orderId=YOUR_ORDER_ID"/>
</Response>

Or, you can store the current CallSid against the order in your system, and then when you receive the callback, match up the CallSid to the order.或者,您可以将当前的CallSid与订单存储在系统中,然后当您收到回调时,将CallSid与订单匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM