Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
首先,您希望预先捕获卡详细信息,但不收取任何费用。
大多数支付服务提供商 (PSP) 都可以做到这一点。通常,您将从您的站点重定向到由 PSP 托管的站点,该站点捕获卡的详细信息。一旦用户离开该页面,他们将重定向回您的网站,您将收到一个支付令牌,它本质上是一个 GUID,可以在将来的交易中使用,而不是卡号。
每次您想从该卡上付款时,您可以将您的令牌 ID 和付款值提交给 PSP 进行授权和结算。请记住,授权完全有可能失败或被拒绝。
这在技术上称为定期付款,因为您的 PSP 应该为您处理潜在的复杂情况,例如信用卡过期或被更换。体面的 PSP 将利用 Visa 帐户更新程序服务或同等的万事达卡自动计费更新程序来确保卡号在后台自动更新。值得检查一下您选择的 PSP 是否提供此功能。
First you want to capture card details up front, but not make any charge.
That can be done with most payment service providers (PSPs). Usually you will redirect from your site to a site hosted by the PSP which captures the card details. Once the user leaves that page they will redirect back to your site, and you will receive a payment Token, which is essentially a GUID which can be used in future transactions instead of a card number.
Each time you want to take payment from that card you can submit your Token Id and payment value to the PSP for authorisation and settlement. Bear in mind that its entirely possible that the authorization could fail or be declined.
This is technically known as a recurring payment in that there are potential complications which your PSP should handle for you, such as credit cards expiring, or being replaced. Decent PSPs will make use of the Visa Account Updater service, or the equivalent Mastercard Automated Billing Updater to ensure that behind the scenes the card number is automatically updated. Worth checking that your chosen PSP provides this capability.
我建议将其外包给处理付款的公司,但由于收费,我建议不要使用 PayPal。如果你从头开始编写所有内容,你最终会遇到很多麻烦。
除此之外,我假设这是一个现实世界的场景。在这种情况下,我不会将其视为定期付款,因为它是一次完成的付款。忘记添加、将他们的信息存储在第三方供应商处,或者真正擅长了解可以和不能在线存储的规则。
I recommend outsourcing this to a company that handles payments, I advise against PayPal because of charges. You will end up getting into a lot of trouble if you are writing everything from the ground up.
Beyond that I am assuming this is a real world scenario. In that case I wouldn't consider it a recurring payment, on account of it is a once and done payment. Forgot to add, store their information with a 3rd party vendor or get really good at knowing the rules of what you can and cannot store online.