在 Paypal Vault 中使用存储的卡时,它会返回 INTERNAL SERVICE ERROR
Posted
技术标签:
【中文标题】在 Paypal Vault 中使用存储的卡时,它会返回 INTERNAL SERVICE ERROR【英文标题】:when using stored card in Paypal Vault it return INTERNAL SERVICE ERROR 【发布时间】:2016-09-24 11:48:51 【问题描述】:我的代码有什么问题:在保存的贝宝信用卡信息中使用 Vault api,但是当我使用保存的卡时出现错误
function paypalPaymentViaStoredCreditCard_post()
$access_token = "XXXXXXXX";
$ch = curl_init();
$data = '
"intent": "sale",
"payer":
"payment_method": "credit_card",
"funding_instruments":[
"credit_card_token":
"credit_card_id": "CARD-6F0009583J819301DK5DO5JA",
"payer_id": "BAAAA"
]
,
"transactions":[
"amount":
"total":"100.00",
"currency":"USD"
,
"description": "This is the payment transaction description."
]
';
curl_setopt($ch, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/payments/payment");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type:application/json",
"Authorization: Bearer " . $access_token,
"Content-length: " . strlen($data))
);
curl_setopt($ch, CURLOPT_USERAGENT, "User-Agent: Some-Agent/1.0");
$result = curl_exec($ch);
print_r($result);die;
if (empty($result)) die("Error: No response.");
else
$json = json_decode($result);
print_r($json);
die;
return $json;
curl_close($ch);
在这里输出
"name":"INTERNAL_SERVICE_ERROR","information_link":"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"b33db4a496dfc"
【问题讨论】:
【参考方案1】:由于我没有从任何人那里得到任何解决方案,所以我一步一步地挖掘我的代码并找到了解决方案。我的代码中没有错误,只有信用卡没有和负面测试问题。我在 *** 上关注以下帖子并得到获得成功
PayPal Sandbox API endpoint returning 503 "Internal Service Error" error
PayPal Sandbox returning Internal Service Error
【讨论】:
以上是关于在 Paypal Vault 中使用存储的卡时,它会返回 INTERNAL SERVICE ERROR的主要内容,如果未能解决你的问题,请参考以下文章