如何在不让用户输入卡详细信息的情况下为重复交易生成卡随机数?

How to generate card nonce for repeated transactions without making users to enter card details?

我们要求在没有用户干预的情况下重复发起付款,就像 GooglePlay 商店 中移动应用的 monthly/yearly 订阅费一样。付款应在特定时间间隔后自动从后端触发(每个时间间隔的金额可能不同)。我们发现在 square payment card nonce 中用于执行交易。当用户第一次输入他们的卡信息时,卡随机数是从支付表单生成的。如何在不让用户以方形支付形式输入他们的卡详细信息的情况下为进一步的交易生成随机数?

您可能希望利用 Card on File 功能。基本上,当客户第一次在 Square Payment Form 中输入他们的信用卡详细信息时,您会生成一个随机数,然后使用该随机数将卡保存到客户的个人资料中(因此您当然需要创建一个 Square 客户作为出色地)。将来,您可以对存档的卡进行收费,而不是让他们再次输入他们的卡详细信息。

有关使用 Square 保存卡片的详细信息:https://docs.connect.squareup.com/payments/transactions/cookbook/save-cards-on-file

Square 存档的有关收费的详细信息:https://docs.connect.squareup.com/payments/transactions/cookbook/charge-cards-on-file

CreateCustomerCard 端点的详细信息:https://docs.connect.squareup.com/api/connect/v2#endpoint-customers-createcustomercard