paypal - 有没有办法用 PaypalAPI 冻结一笔钱?
问题描述
一般来说,我有这里描述的流程:Is there a way to authorize orders directly call the paypal api
简而言之:只需使用 PaypalAPI 在我的网站上的用户之间进行付款
现在我想弄清楚如何用 PaypalAPI 冻结一笔钱
例如,当雇主在某些自由职业者平台上放置他们的项目并确认自由职业者时。他们的帐户将冻结一定数额的资金。并且,然后最终当工作完成时,转给了自由职业者。
解决方案
这个有可能。Paypal 称其为“授权和捕获”。它允许您“授权”一笔付款,从而冻结相关资金,然后可以将其捕获,即支付。
这是请求的开发人员文档。这是他们文档中的一个 curl 请求,很好地总结了它。
curl -v https://api-m.sandbox.paypal.com/v1/payments/payment \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>" \
-d '{
"intent": "authorize",
"payer":
{
"payment_method": "paypal"
},
"transactions": [
{
"amount":
{
"total": "30.11",
"currency": "USD",
"details":
{
"subtotal": "30.00",
"tax": "0.07",
"shipping": "0.03",
"handling_fee": "1.00",
"shipping_discount": "-1.00",
"insurance": "0.01"
}
},
"description": "This is the payment transaction description.",
"custom": "EBAY_EMS_90048630024435",
"invoice_number": "48787589673",
"payment_options":
{
"allowed_payment_method": "INSTANT_FUNDING_SOURCE"
},
"soft_descriptor": "ECHI5786786",
"item_list":
{
"items": [
{
"name": "hat",
"description": "Brown color hat",
"quantity": "5",
"price": "3",
"tax": "0.01",
"sku": "1",
"currency": "USD"
},
{
"name": "handbag",
"description": "Black color hand bag",
"quantity": "1",
"price": "15",
"tax": "0.02",
"sku": "product34",
"currency": "USD"
}],
"shipping_address":
{
"recipient_name": "Hello World",
"line1": "4thFloor",
"line2": "unit#34",
"city": "SAn Jose",
"country_code": "US",
"postal_code": "95131",
"phone": "011862212345678",
"state": "CA"
}
}
}],
"note_to_payer": "Contact us for any questions on your order.",
"redirect_urls":
{
"return_url": "https://example.com/return",
"cancel_url": "https://example.com/cancel"
}
}'
推荐阅读
- reactjs - 当本地依赖改变时重新编译
- python-3.x - 找到一种方法来检查 GPIO 输入到打开和关闭 LED,而程序的其他部分仍在运行
- php - 引导模式中的表单不会在 MySQL 中插入数据
- linux - 执行写操作时内核中的空指针异常
- reactjs - ReactJS 将 props 从 root 传递给 child
- swift - 在swift 3中加载所有数据时如何在tableview中隐藏刷新控件?
- soap - SOAP 服务的 TAM 到 ISAM 迁移
- angular - Spring Boot 应用程序的架构
- c - 搜索并打印目录的所有文件和子文件夹
- javascript - 使用 jquery ajax、.net mvc 进行无限滚动