2016-11-22 1 views
1

PayPal Reference Transactin을 사용하려고합니다. 이미 결제 동의서를 만들었으며 거래가 완료되기 전에 결제 계약 ID가 설정되었습니다. PayPal 참조 거래 - 상태 코드 400 in

나는 간단한 트랜잭션 요청을하지만, 가지고 : PPHttpConnection.php 라인 (108)에

PPConnectionException :
있어 HTTP 응답 코드 (400) https://api-3t.sandbox.paypal.com/2.0에 액세스 할 때.

내 코드 (상인-SDK-PHP 패키지 Laravel 5.3 writte) :

$user=Auth::user(); 

$currencyCode = 'GBP'; 
$price=config('constants.offer_submit_price'); 

$reference_id=$user->userExt()->where('field_name', '=', 'billing_agreement')->firstOrFail()->field_value; 
$amount = new BasicAmountType($currencyCode, $price); 

$paymentDetails = new PaymentDetailsType(); 
$paymentDetails->OrderTotal = $amount; 

$RTRequestDetails = new DoReferenceTransactionRequestDetailsType(); 
$RTRequestDetails->PaymentDetails = $paymentDetails; 
$RTRequestDetails->ReferenceID = $reference_id; 
$RTRequestDetails->PaymentAction ='sale'; 

$RTRequest = new DoReferenceTransactionRequestType(); 
$RTRequest->DoReferenceTransactionRequestDetails = $RTRequestDetails; 

$RTReq = new DoReferenceTransactionReq(); 
$RTReq->DoReferenceTransactionRequest = $RTRequest; 

$paypalService = new PayPalAPIInterfaceServiceService($this->config); 
try { 
    $setRTResponse = $paypalService->DoReferenceTransaction($RTReq); 
} catch (Exception $ex) { 
    dd($ex); 
} 

스크립트에 의해 생성 된 SAOP의 envelopr 그게 : 내 친구의 도움으로

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" > 
    <soapenv:Header> 
    <ns:RequesterCredentials> 
    <ebl:Credentials> 
     <ebl:Username>username 
</ebl:Username> 
<ebl:Password>password 
</ebl:Password> 
<ebl:Signature>signature 
</ebl:Signature> 
</ebl:Credentials> 
</ns:RequesterCredentials> 
</soapenv:Header> 
<soapenv:Body> 
    <ns:DoReferenceTransactionReq> 
    <ns:DoReferenceTransactionRequest> 
    <ebl:DoReferenceTransactionRequestDetails> 
    <ebl:ReferenceID>B-reference_id 
</ebl:ReferenceID> 
<ebl:PaymentAction>sale 
</ebl:PaymentAction> 
<ebl:PaymentDetails> 
    <ebl:OrderTotal currencyID="GBP">10 
</ebl:OrderTotal> 
<ebl:ButtonSource>PayPal_SDK 
</ebl:ButtonSource> 
</ebl:PaymentDetails> 
</ebl:DoReferenceTransactionRequestDetails> 
<ebl:Version>106.0 
</ebl:Version> 
</ns:DoReferenceTransactionRequest> 
</ns:DoReferenceTransactionReq> 
</soapenv:Body> 
</soapenv:Envelope>' 
+0

huehuehuehuehue – TheWandererr

답변

1

I 무엇이 잘못되었는지 알아 냈습니다. 대신

$RTRequestDetails->PaymentAction ='sale'; 

페이팔 SOAP API를

$RTRequestDetails->PaymentAction ='Sale'; 

민감한 권리 경우 모든이 필요합니다. 후회, 그들은 잘못된 정보를 보내지 않습니다.