利用Paypal API将单笔付款发送到电子邮件 [英] Utilize Paypal API to send a single payment to email

查看:419
本文介绍了利用Paypal API将单笔付款发送到电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我的网站上有一个提现页面,其中包括Paypal提现系统,用户可以在其中指定他/她的电子邮件.将单笔付款发送到指定电子邮件的新更新方式是什么?我需要使用哪个API?

Say i've had a cash out page on my website that included Paypal cash out system where user would specify his/her email. What is the new updated way to send single payment to the specified email? Which API would i need to use?

我已经研究了大约一个小时,但我似乎找不到合适的方法,我已经看到了:

I've been researching it approximately for an hour and i can't seem to find a proper method, I've seen this:

curl -v https://api.sandbox.paypal.com/v1/payments/payouts?sync_mode=true \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer Access-Token" \
  -d '{
  "sender_batch_header":{
    "sender_batch_id":"2014021801",
    "email_subject":"You have a payout!",
    "recipient_type":"EMAIL"
  },
  "items":[
    {
      "recipient_type":"EMAIL",
      "amount":{
        "value":"1.0",
        "currency":"USD"
      },
      "note":"Thanks for your patronage!",
      "sender_item_id":"201403140001",
      "receiver":"anybody01@gmail.com"
    }
  ]
}' - [from here][1]

但是我似乎无法理解如何获取sender_batch_header.我认为此方法用于不同的目的.

But i can't seem to understand how to obtain sender_batch_header. I think this method is used for different purposes.

那么通过贝宝(Paypal)发送付款的最新工作方法是什么?

So what's the newest working method to send payments by paypal?

谢谢!

推荐答案

据我了解,付款API 是取代以前的 Mass Payments API 的API ,用于以同步方式或异步方式将许多付款发送给不同的受益人.

As far as I understand, the Payouts API is the API that's substituting the previous Mass Payments API, used to send many payouts synchronously or asynchronously to different beneficiaries.

基本上可以想象一家公司使用Paypal支付员工工资,并且有一个内部应用程序,每月向每个人发送薪水.

Basically imagine a company that uses Paypal to pay his employees and has an internal application which every month sends everyone their salaries.

您可以在文档中阅读

注意:在大众付款"适用的任何地方都可以使用付款 可用的.您通过Payouts API发送的所有付款都显示为 您的PayPal帐户和批量付款"报告中的批量付款".

Note: Payouts are available everywhere that Mass Payments are available. Any payouts that you send through the Payouts API appear as Mass Payments in your PayPal account and in Mass Payment reports.

现在,关于sender_batch_header,基本上,它允许您按批次跟踪付款,因此您不会意外地将同一批次发送两次.

Now, regarding the sender_batch_header, it basically allows you to track payments by batches so you don't accidentally send the same batch twice.

比方说,每个圣诞节,我上面提到的同一家公司,都喜欢向员工发送一份小礼物,比如额外的500美元.如果公司开发的用于发送付款的客户应用程序有一个错误,并且没有在日历中记录特殊付款,则CEO可能会感到困惑,并尝试将其发送两次.在这种情况下,贝宝(Paypal)拒绝接受具有相同sender_batch_Id的另一笔付款.

Let's say every Christmas, the same company I mentioned above, likes to send a small gift to their employees, something like an extra 500$. If by some chance the client application which the company has developed to send the payments has a bug and doesn't log extraordinary payments in the calendar, the CEO might get confused and try to send it twice. In that case, Paypal refuses to accept another payout with the same sender_batch_Id.

此外,您可以通过其sender_batch_Id并通过以下端点检索特定批次的信息:

Furthermore, you can retrieve the information of a certain batch through its sender_batch_Id through the following endpoint:

/v1/payments/payouts/payout_batch_id

通过这种方式,您可以知道该批次是否已经处理过,您的员工是否将其保存在其Paypal帐户中,是否已被拒绝或您需要什么.

That way you can know if the batch has already been processed and your employees have it in their Paypal accounts, if it has been denied, or whatever you need.

如果您需要更多信息,我发现该API的文档非常齐全:

If you need more information, I found the API to be fairly well documented: link.

这篇关于利用Paypal API将单笔付款发送到电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆