自动将 Paypal 结帐分派到多个帐户
我的网站允许用户购买东西,付款将分摊给几个人(通常是 1/4 人)。
到目前为止,我使用的流程是将付款接收到一个帐户,然后使用 Paypal 自适应付款API 根据百分比将收到的付款发送给所有人。
这个解决方案的问题是,“接收贝宝账户”将有大量的输入/输出资金,并且将成为我电子商务的阿基里斯利爪(如果这个账户被暂停,我的商业就会崩溃)。
我的问题很简单:有没有办法自动执行此操作?
我发现如果买家有 Paypal 帐户,那么我可以直接使用 Paypal API 将付款(基于他的 paypal 电子邮件)发送给人们,这很完美,但问题是:如果买家不这样做会发生什么没有 PayPal 帐户并想使用信用卡付款?
感谢您的帮助!
My website allows user to buy stuffs, and the payments will be splitted between a few people (generally 1/4 people).
So far, the processus I use is to receive the payment into one account, and then use the Paypal Adaptive Payment API to send this received payment to all the people, based on their percentage.
The problem with this solution is that the "reception paypal account" will have a lot of input/output money and will be the Achille's talon of my e-commerce (if this account is suspended, my commerce is down).
My question is quite simple: is there a way to do this automatically?
I found that if the buyer have a Paypal account, then I could directly use the Paypal API to dispatch it's payment (based on his paypal email) to the people, and that is perfect, but the problem is : what happens if the buyer doesn't have a paypal account and want to pay with, say, a credit card?
Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,解决方案实际上非常简单,但需要彻底改变:
我不得不忘记 Web 结帐并使用 Paypal API,使用链式付款执行PAY请求(定义多个接收者) ,与一个(我)设置为
primary:true
)。在该请求中,设置 ipnNotificationUrl 以获取付款演变通知,仅此而已!Paypal 的响应如果正确,将包含 Paykey。
然后,您必须将买家重定向到:
然后,要保持更新,您所要做的就是向 Paypal 发送包含
paykey
的请求,以了解 付款详情!就是这样 !
Ok, the solution is quite simple in fact but need a complete change :
I had to forget about Web checkout and use Paypal API, do a PAY request with a Chained Payment (defining multiple receivers, with one (me) setted at
primary: true
). In that request, set the ipnNotificationUrl to be notified of the evolution of payments and that's it!The response from paypal, if correct, will contain a paykey.
Then, you have to redirect the buyer to :
Then, to be kept updated, all you have to do is send a request to Paypal containing the
paykey
to know the paymentdetails !That's it !
我将回答我的问题,研究 Paypal 自适应支付 API,我们可以看到专门的“宾客付款”部分。
看起来这是可能的,但它要求所有将收到资金的人都拥有商业帐户或高级帐户!
I'll answer my question on that, looking into the Paypal Adaptive Payment API, we can see a dedicated section "Guest Payments".
It seems it's possible, but it requires all the people that will receive the money to have a Business Account or Premium account!
好吧,我将添加第二个答案,因为它更完整并且与第一个答案略有不同。
简单地做到这一点的最佳方法是使用 快速结账 API(SetExpressCheckout、GetExpressCheckoutDetails、DoExpressCheckoutPayment)。
通过使用它而不是后面带有 IPN 的基本“结帐”按钮,可以定义多个将收到款项的收件人:并行支付。
就是这么简单!
(现在我必须重写所有代码来实现它,耶!)
Well I'll add a second answer because it's more complete and slightly different from the first one.
The best way to do it quite simply is to use the Express Checkout API (SetExpressCheckout, GetExpressCheckoutDetails, DoExpressCheckoutPayment).
By using it instead of the basic "checkout" bouton with an IPN behind, it is possible to define more than one recipient that will receive the money : the parallel payment.
It's that easy!
(Now I have to rewrite all my code to implement it, yayh!)