2016-05-26 12 views
1

内部サービスエラーを返すペイパルボールトに保存されているカードを使用した場合:保存されたペイパルクレジットカード情報に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); 
} 

OUTPUTを取得ここで

{"name":"INTERNAL_SERVICE_ERROR","information_link":"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"b33db4a496dfc"} 

答えて

1

私はので、私はステップによって私のコードのステップに掘ったとsolution.thereを見つけた誰から任意のソリューションを取得していないとして、私のコードにはバグが何のクレジットカードのみでなく、負の試験後に続かないissue.i stackoverflowに投稿して取得する成功

PayPal Sandbox API endpoint returning 503 "Internal Service Error" error

PayPal Sandbox returning Internal Service Error

関連する問題