gpt4 book ai didi

php - Paypal 一次性购买和单笔交易中的定期付款,通过 rest api 使用快速结帐

转载 作者:太空宇宙 更新时间:2023-11-03 16:05:13 25 4
gpt4 key购买 nike

我正在使用 PayPal REST API,我想创建一个合并交易,以在单笔交易中处理一次性付款和定期付款。

用例:根据流程,用户可以从门户购买产品,也可以按月和按季度订阅产品。用户还可以在单​​笔交易中购买订阅产品和一次性付款产品。

我搜索了 REST API 文档以及 PHP SDK 示例,但找不到在单个交易中混合使用定期付款和一次性付款的交易示例。

最佳答案

我注意到 https://www.paypal-community.com/t5/Business-Tools/One-time-purchase-and-recurring-payments-in-single-transaction/td-p/1509420有类似的问题并有答案;我怀疑同一位作者可能问了这两个问题,但我认为这对寻求答案的其他人可能有用。

为避免链接失效,我将在下面粘贴给出的答案 - 但我没有亲自尝试过,所以我不知道它是否有效。

One option for a one time payment is to use the Trial Variables set for one day, after that the regular payment starts on the second day.

For example, you run a service business:

There's a Onetime Setup Fee of $25.00 plus a Monthly Maintenance Fee of $10.00. The Setup Fee is charged by using the Trial Variables set for one day, after that the regular payment starts on the second day.

Some sample code with notes:

<!-- "a1" Trial amount 1. This is the price of the first trial period.
For a free trial, use a value of 0 -->
<input type="hidden" name="a1" value="25.00">
<!-- "p1" Trial period 1. This is the length of the first trial period.
The number is modified by the trial period 1 units (t1, below) -->
<input type="hidden" name="p1" value="1">
<!-- "t1" Trial period 1 units. This is the units of trial period 1 (p1, above).
Acceptable values are: D (days), W (weeks), M (months), Y (years) -->
<input type="hidden" name="t1" value="D">

Not sure if this is what you have in mind but, it may give you some other ideas too.

关于php - Paypal 一次性购买和单笔交易中的定期付款,通过 rest api 使用快速结帐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50405238/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com