我试图使用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/为一个巨大的散装。 –