我試圖使用PayPal沙盒進行支付到PayPal保險櫃信用卡,但我無法弄清楚。似乎無法解決錯誤。它可以工作或者它不工作,我沒有經歷過它的工作。如何解決PayPal保險櫃信用卡充電故障
我可以拉出卡片清單,我可以找回特定的卡片,但是我無法向他們中的任何人付款。
我正在使用PHP Paypal SDK。這是貝寶作爲我的要求看到的。
{
"body": {
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card_token": {
"credit_card_id": "CARD-6XP216179L970340WK6BNY5A",
"payer_id": "1"
}
}
]
},
"transactions": [
{
"amount": {
"currency": "USD",
"total": "26.01"
}
}
]
},
"header": {
"x-pp-silover": "name\\u003dSANDBOX3.API.1\\u0026silo_version\\u003d1880\\u0026app\\u003dplatformapiserv\\u0026TIME\\u003d1702332759\\u0026HTTP_X_PP_AZ_LOCATOR\\u003d",
"content-length": "233",
"paypal-request-id": "323223593916288146862657311204",
"x-slr-retry": "SLR-RETRY-EMPTY",
"accept": "*/*",
"client-auth": "No cert",
"host": "api.sandbox.paypal.com",
"user-agent": "PayPalSDK/PayPal-PHP-SDK 1.7.3 (platform-ver\\u003d5.6.23-2+deb.sury.org~xenial+1; bit\\u003d64; os\\u003dLinux_4.4.0-21-generic; machine\\u003dx86_64; crypto-lib-ver\\u003d1.0.2h; curl\\u003d7.47.0)",
"x-slr-nobounce": "true",
"x-slr-orig-script_uri": "https://api.sandbox.paypal.com/v1/payments/payment",
"x-pp-corrid": "793fa20aaec8b",
"pp_remote_addr": "99.99.99.1",
"content-type": "application/json",
"authorization": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxl4S0"
},
"additional_properties": {},
"method": "POST"
}
我修改了IP,使其成爲我當前分配的內容。我不知道發佈它是否是安全問題,這不是祕密。
我正在使用的代碼看起來像這樣。
$apiContext = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential(
$clientId,
$secret
)
);
$cardToken = new CreditCardToken();
$cardToken->setCreditCardId($paymentMethod->getProcessorId());
$cardToken->setPayerId("1");
$fi = new FundingInstrument();
$fi->setCreditCardToken($cardToken);
$payer = new Payer();
$payer->setPaymentMethod("credit_card")
->setFundingInstruments(array($fi));
$amount = new Amount();
$amount->setCurrency("USD")
->setTotal("26.01");
$transaction = new Transaction();
$transaction->setAmount($amount);
$payment = new Payment();
$payment->setIntent("sale")
->setPayer($payer)
->setTransactions(array($transaction));
print_r($payment);
$payment->create($apiContext);
if ($payment->getState() == 'approved') {
return TRUE;
}
return FALSE;
} catch (Exception $ex) {
print_r($ex);
}
的$ paymentMethod-> getProcessorId()是一個有效的信用卡庫ID,我可以從PayPal的沙箱檢索。
這是貝寶的迴應。
{
"status": 500,
"duration_time": 135,
"body": {
"message": "An internal service error occurred.",
"information_link": "https://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR",
"name": "INTERNAL_SERVICE_ERROR",
"debug_id": "793fa20aaec8b"
},
"additional_properties": {},
"header": {
"Content-Length": "209",
"Content-Language": "*",
"X-SLR-RETRY": "500",
"CORRELATION-ID": "793fa20aaec8b",
"Date": "Fri, 15 Jul 2016 23:53:39 GMT",
"Connection": "close",
"Paypal-Debug-Id": "793fa20aaec8b",
"PROXY_SERVER_INFO": "host\\u003dslcsbplatformapiserv3001.slc.paypal.com;threadId\\u003d569",
"Content-Type": "application/json"
}
}
據我瞭解,內部錯誤只是意味着某事不對,但並不說明什麼是不正確的。這是煩人的工作,他們給你沒有任何有用的答覆排除故障,顯然沒有日誌記錄通過貝寶SB儀表板進行檢查。
我做到了,他們確實得到了我。我需要使用這些卡號來測試。 VISA:4716 3248 7603 0777 萬事達卡:5453 9874 8085 6045 – Halfstop
PayPal Sandbox中很少使用信用卡,並造成奇怪的行爲。想想一張擁有50萬帳單地址的信用卡。這些問題在現場得到了很好的介紹,但是在沙盒中,它會導致這些問題。最好的辦法是使用獨特的信用卡。您可以使用https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1413&viewlocale=zh_CN&direct=en中的第4步來幫助您創建一個或http://www.getcreditcardnumbers.com/爲一個巨大的散裝。 –