gpt4 book ai didi

php - PayPal REST API Payment::get 不返回电话

转载 作者:太空宇宙 更新时间:2023-11-03 15:55:14 25 4
gpt4 key购买 nike

基本上,我正在创建一个订单管理系统,需要检索“付款人”的电话号码。但是在 JSON 响应中没有... Paypal 是否根本不返回这个?我设置用于测试的沙盒买家帐户记录了两个电话号码。然而,当发出 Payment::get() 请求时,他们的电话号码没有返回。

{
"id": "PAY-5L1626419H036282VKVFYNAQ",
"create_time": "2015-05-07T15:36:34Z",
"update_time": "2015-05-07T15:36:45Z",
"state": "approved",
"intent": "sale",
"payer": {
"payment_method": "paypal",
"status": "VERIFIED",
"payer_info": {
"email": "moca66-buyer@live.com",
"first_name": "test",
"last_name": "buyer",
"payer_id": "G33XSXSD68SKL",
"shipping_address": {
"line1": "1 Main St",
"city": "San Jose",
"state": "CA",
"postal_code": "95131",
"country_code": "US",
"recipient_name": "test buyer"
}
}
},
"transactions": [
{
"amount": {
"total": "12.94",
"currency": "USD",
"details": {
"subtotal": "4.99",
"tax": "0.35",
"shipping": "7.60"
}
},
"description": "Payment description",
"invoice_number": "554b86812d73f",
"item_list": {
"items": [
{
"name": "This item is a test for shipping calculation",
"price": "4.99",
"currency": "USD",
"quantity": "1"
}
]
},
"related_resources": [
{
"sale": {
"id": "8M4317138Y452345R",
"create_time": "2015-05-07T15:36:34Z",
"update_time": "2015-05-07T15:36:45Z",
"amount": {
"total": "12.94",
"currency": "USD"
},
"payment_mode": "INSTANT_TRANSFER",
"state": "completed",
"protection_eligibility": "ELIGIBLE",
"protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
"parent_payment": "PAY-5L1626419H036282VKVFYNAQ",
"transaction_fee": {
"value": "0.68",
"currency": "USD"
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/8M4317138Y452345R",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/8M4317138Y452345R/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5L1626419H036282VKVFYNAQ",
"rel": "parent_payment",
"method": "GET"
}
]
}
}
]
}
],
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5L1626419H036282VKVFYNAQ",
"rel": "self",
"method": "GET"
}
]

最佳答案

您需要在卖家账户中开启电话号码设置。你可以在这里设置它:

https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_profile-website-payments

enter image description here

一旦你打开它,你应该也会得到电话号码作为回应,如下所示:

{
"id": "PAY-43P312788Y877032MKVFZAHI",
"create_time": "2015-05-07T16:17:33Z",
"update_time": "2015-05-07T16:18:33Z",
"state": "approved",
"intent": "sale",
"payer": {
"payment_method": "paypal",
"status": "VERIFIED",
"payer_info": {
"email": "XXXXXXXXX",
"first_name": "XXXXXPersonal Test",
"last_name": "Account",
"payer_id": "XXXXXX",
"shipping_address": {
"line1": "593 Mill Street",
"city": "Greenville",
"postal_code": "29611",
"country_code": "DE",
"recipient_name": "Paypal Test"
},
"phone": "408-767-7151"
}
},
"transactions": [
{
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"subtotal": "7.47"
}
},
"description": "This is the payment transaction description.",
"related_resources": [
{
"sale": {
"id": "2J742201JN363443E",
"create_time": "2015-05-07T16:17:33Z",
"update_time": "2015-05-07T16:18:33Z",
"amount": {
"total": "7.47",
"currency": "USD"
},
"payment_mode": "INSTANT_TRANSFER",
"state": "completed",
"protection_eligibility": "ELIGIBLE",
"protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
"parent_payment": "PAY-43P312788Y877032MKVFZAHI",
"transaction_fee": {
"value": "0.52",
"currency": "USD"
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/2J742201JN363443E",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/2J742201JN363443E/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-43P312788Y877032MKVFZAHI",
"rel": "parent_payment",
"method": "GET"
}
]
}
}
]
}
],
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-43P312788Y877032MKVFZAHI",
"rel": "self",
"method": "GET"
}
]
}

关于php - PayPal REST API Payment::get 不返回电话,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30106041/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com