我正在使用paypal ruby sdk以通过rest api处理信用卡。从信用卡处理的角度来看,一切都很好。信用卡处理得恰到好处,没有任何问题。
不幸的是,当我在沙盒(或实时)商家paypal帐户上预先形成交易的csv时,"项目标题"字段未填充,我也看不到任何地方都使用了描述字段。
请求paypal:
Request[post]: https://api.sandbox.paypal.com/v1/payments/payment
Request.body={
"intent":"sale",
"payer":{
"payment_method":"credit_card",
"funding_instruments":[{
"credit_card":{
"number":"xxxxxxxxxxxxxxxx",
"type":"visa",
"expire_month":10,
"expire_year":2020,
"first_name":"First Name",
"last_name":"Last Name"
}
}]
},
"transactions":[{
"amount":{
"currency":"USD",
"total":"1"
},
"description":"This is item description",
"item_list":{
"items":[{
"quantity":"1",
"name":"This is item description",
"price":"1",
"currency":"USD",
"sku":"This is item description"
}]
}
}]
}
在成功的paypal响应中,我收到所有这些数据,包括填充了&#34的字段;这是项目描述"。
我的问题是,为了填充"项目标题"我们需要为此api调用提供哪个参数。交易中的字段csv export?
"描述"的目的是什么?这个api请求中的字段以及在我们使用信用卡处理付款之后在paypal端(显示)使用此字段的位置?
EDITED
也尝试使用PHP SDK(只是为了确保这不是特定SDK的问题)。最后似乎问题是" 是否有一个字段用作REST API的一部分,它对应于'项目标题' paypal导出中的列?"
答案 0 :(得分:5)
确实从pp_pduan回答了最初的赏金问题(与具体报告有关)。我正在添加与此特定报告和其他报告相关的更新。
对于信用卡处理,您可以在paypal端使用以下API:
根据我与paypal方面的讨论以及相当详细的研究,不可能使用REST API为某些报告填充项目名称。 对于信用卡处理(为了避免报告系统的一般问题),如果您有专业账户,我建议使用DoDirect Payment Api。似乎这个特定的API已经过时了#34;然后REST API信用卡处理因此它更稳定,并且报告系统没有任何问题。
考虑到DoDirect Payment Api有奇怪的文档(至少对我来说这没有得到适当的介绍)我建议使用工作解决方案(示例)检查以下php repository。
答案 1 :(得分:2)
尝试像这样放置一个样本请求有效负载,
{
"intent": "sale",
"payer": {
"payment_method": "paypal"
},
"redirect_urls": {
"return_url": "http://localhost:80/getpaypal",
"cancel_url": "http://localhost:80/cancel"
},
"transactions": [
{
"description": "Transaction Desc Text",
"amount": {
"total":"80",
"currency":"USD"
},
"item_list": {
"items": [
{
"name": "Test Ticket 1",
"currency": "USD",
"quantity": "1",
"sku": "55a460ff65f13",
"price": "10"
},
{
"name": "Test Ticket 2",
"currency": "USD",
"quantity": "2",
"sku": "55a460ff66c7a",
"price": "20"
},
{
"name": "Test Ticket 3",
"currency": "USD",
"quantity": "3",
"sku": "55a460ff66ce2",
"price": "10"
}
]
},
"invoice_number": "55a460ff696br"
}
]
}
当您从PayPal个人资料中下载交易历史记录(csv)时,
"description": "Transaction Desc Text",
”({{1} 项目标题 col description
对象中的}字段