Discord.js - 我将如何整合 PayPal 发票 API?
Discord.js - How would i integrate the PayPal invoicing API?
所以,我想知道是否有任何可能的方法将 PayPal invoicing API 与我的 discord.js 机器人集成。
我是 discord.js 中 API 的新手,我正在尝试解决这个问题。
一个简单的请求应该是这样的,
curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
"merchant_info": {
"email": "merchant@example.com",
"first_name": "David",
"last_name": "Larusso",
"business_name": "Mitchell & Murray",
"phone": {
"country_code": "001",
"national_number": "4085551234"
},
"address": {
"line1": "1234 First Street",
"city": "Anytown",
"state": "CA",
"postal_code": "98765",
"country_code": "US"
}
},
"billing_info": [
{
"email": "bill-me@example.com",
"first_name": "Stephanie",
"last_name": "Meyers"
}
],
"shipping_info": {
"first_name": "Stephanie",
"last_name": "Meyers",
"address": {
"line1": "1234 Main Street",
"city": "Anytown",
"state": "CA",
"postal_code": "98765",
"country_code": "US"
}
},
"items": [
{
"name": "Zoom System wireless headphones",
"quantity": 2,
"unit_price": {
"currency": "USD",
"value": "120"
},
"tax": {
"name": "Tax",
"percent": 8
}
},
{
"name": "Bluetooth speaker",
"quantity": 1,
"unit_price": {
"currency": "USD",
"value": "145"
},
"tax": {
"name": "Tax",
"percent": 8
}
}
],
"discount": {
"percent": 1
},
"shipping_cost": {
"amount": {
"currency": "USD",
"value": "10"
}
},
"note": "Thank you for your business.",
"terms": "No refunds after 30 days."
}'
但是我一开始并不确定如何请求。
感谢您的帮助。
所以,我最终使用了 paypal-rest-sdk(感谢@rup)并放弃了开发票的想法,因为它更容易付款。
我 运行 遇到另一个问题,我无法获得批准 url 并将其放入不和谐的嵌入中。
如果我不能自己解决这个问题,我会 post 提出一个问题。
所以,我想知道是否有任何可能的方法将 PayPal invoicing API 与我的 discord.js 机器人集成。 我是 discord.js 中 API 的新手,我正在尝试解决这个问题。 一个简单的请求应该是这样的,
curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
"merchant_info": {
"email": "merchant@example.com",
"first_name": "David",
"last_name": "Larusso",
"business_name": "Mitchell & Murray",
"phone": {
"country_code": "001",
"national_number": "4085551234"
},
"address": {
"line1": "1234 First Street",
"city": "Anytown",
"state": "CA",
"postal_code": "98765",
"country_code": "US"
}
},
"billing_info": [
{
"email": "bill-me@example.com",
"first_name": "Stephanie",
"last_name": "Meyers"
}
],
"shipping_info": {
"first_name": "Stephanie",
"last_name": "Meyers",
"address": {
"line1": "1234 Main Street",
"city": "Anytown",
"state": "CA",
"postal_code": "98765",
"country_code": "US"
}
},
"items": [
{
"name": "Zoom System wireless headphones",
"quantity": 2,
"unit_price": {
"currency": "USD",
"value": "120"
},
"tax": {
"name": "Tax",
"percent": 8
}
},
{
"name": "Bluetooth speaker",
"quantity": 1,
"unit_price": {
"currency": "USD",
"value": "145"
},
"tax": {
"name": "Tax",
"percent": 8
}
}
],
"discount": {
"percent": 1
},
"shipping_cost": {
"amount": {
"currency": "USD",
"value": "10"
}
},
"note": "Thank you for your business.",
"terms": "No refunds after 30 days."
}'
但是我一开始并不确定如何请求。 感谢您的帮助。
所以,我最终使用了 paypal-rest-sdk(感谢@rup)并放弃了开发票的想法,因为它更容易付款。
我 运行 遇到另一个问题,我无法获得批准 url 并将其放入不和谐的嵌入中。
如果我不能自己解决这个问题,我会 post 提出一个问题。