【发布时间】:2015-12-23 07:37:04
【问题描述】:
我正在使用适用于 .NET 的 paypal API,并且正在通过以下方法创建付款:POST /v1/payments/payment。
我的付款创建请求:
Payment = {
intent: 'sale',
payer = {
payment_method = 'paypal'
},
transactions = [
transaction= = {
amount = {
currency = 'GBP',
total = '10.00'
},
item_list = {
items = [
item = {
quantity = '1',
name = 'name',
price = '10.00',
currency = 'GBP',
sku = 'description'
}
],
shipping_address = {
recipient_name = 'name',
line1 = 'address',
city = 'city',
country_code = 'GB',
postal_code = 'G69 7LS'
}
}
}
],
redirect_urls = {
return_url = 'http://localhost/',
cancel_url = 'http://localhost/'
}
}
如您所见,我没有创建“销售”类型的相关交易。
在创建并执行付款后,在某些情况下我们需要退还客户的钱,但要退款,我们需要一个 saleId。我尝试通过创建付款来生成 saleId,但仍然失败,因为 API 似乎忽略了 sale 对象。
【问题讨论】:
-
付款作为答案给出,它带有一个空的payment_resources数组。