我正在尝试创建WebProfile。下面的代码在过去的8天里为我工作,从今天起它返回500响应。
PHP
$flowConfig = new \PayPal\Api\FlowConfig();
$flowConfig->setLandingPageType("Billing");
$flowConfig->setBankTxnPendingUrl($this->referer);
$presentation = new \PayPal\Api\Presentation();
$inputFields = new \PayPal\Api\InputFields();
$inputFields->setAllowNote(false)
->setNoShipping(1)
->setAddressOverride(0);
// #### Payment Web experience profile resource
$webProfile = new \PayPal\Api\WebProfile();
// Name of the web experience profile. Required. Must be unique
$webProfile->setName(uniqid())
// Parameters for flow configuration.
->setFlowConfig($flowConfig)
// Parameters for style and presentation.
->setPresentation($presentation)
// Parameters for input field customization.
->setInputFields($inputFields);
try {
// Use this call to create a profile.
$createProfileResponse = $webProfile->create($this->apiContext);
$createProfileResponse = json_decode($createProfileResponse);
$web_profile_id = $createProfileResponse->id;
return $web_profile_id;
} catch (\PayPal\Exception\PayPalConnectionException $ex) {
return FALSE;
}
paypal.log:
[08-10-2016 02:33:16] PayPal\Core\PayPalHttpConnection : INFO: Response
Status : 500
[08-10-2016 02:33:16] PayPal\Core\PayPalHttpConnection : DEBUG: Response
Headers : HTTP/1.1 500 Internal Server Error, Date: Sat, 08 Oct 2016
14:33:06 GMT, Server: Apache, PROXY_SERVER_INFO:
host=slcsbplatformapiserv3002.slc.paypal.com;threadId=495, Paypal-
Debug-Id: c6d80d6e1ffc8, Connection: close, Paypal-Debug-Id:
c6d80d6e1ffc8, Set-Cookie:X-
PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D1880%26app%3Dplatformapiserv%26TIME%3D2718169431%26HTTP_X_PP_AZ_LOCATOR%3D; Expires=Sat, 08 Oct 2016 15:03:06 GMT; domain=.paypal.com; path=/; Secure; HttpOnly, Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT, Vary: Authorization, Content-Length: 145, Content-Type: application/json, ,
[08-10-2016 02:33:16] PayPal\Core\PayPalHttpConnection : ERROR: Got Http
response code 500 when accessing https://api.sandbox.paypal.com/v1/payment-
experience/web-profiles/. {"name":"INTERNAL_SERVICE_ERROR","information_link":"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"c6d80d6e1ffc8"}
[08-10-2016 02:33:16] PayPal\Core\PayPalHttpConnection : DEBUG:
我尝试了this示例并遇到了同样的错误。创建最终执行付款的工作非常完美,因此问题仅在于Web配置文件。任何想法如何解决?提前谢谢。