Paypal一次性购买和通过休息apis快速结账的单笔交易中的经常性付款

问题描述 投票:1回答:1

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

使用案例:根据流程,用户可以从门户网站购买产品,也可以按月和季度订购产品。用户还可以在一次交易中通过一次性付款购买带有订阅和产品的产品。

我搜索了REST API文档以及PHP SDK示例,但找不到在单个Transaction中使用重复和一次性付款组合的事务示例。

php paypal paypal-rest-sdk
1个回答
0
投票

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

为了避免链接腐烂,我会粘贴下面给出的答案 - 但我没有亲自试过这个,所以我不知道它是否有效。

一次性付款的一个选项是使用设置为一天的试用变量,之后定期付款在第二天开始。

例如,您运营服务业务:

有一个25美元的一次性安装费加上10.00美元的每月维护费。设置费用使用为一天设置的试用变量收取,之后定期付款从第二天开始。

一些带注释的示例代码:

<!-- "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">  

不确定这是否是你的想法,但它也可能给你一些其他的想法。

© www.soinside.com 2019 - 2024. All rights reserved.