2011-04-08 3 views
3

업데이트 2 : 다음과 같이페이팔 확인은?

내가 currentlly이 코드는 다음과 같습니다

paypalplatform.php :

https://www.paypal-labs.com/integrationwizard/adaptive/code2.php

basic_payment.php 다음의 (b)에서 (스크립트 아래 링크 )

위의 두 번째 링크의 상자가 비어 있으면, 그냥 "시작"을 클릭하고 당신이 얻을 때까지 다음을 클릭합니다 (IPN 리스너)

https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNImplementation

:3210

ipn.php 4 단계, 또는 여기를 클릭 : https://www.paypal-labs.com/integrationwizard/adaptive/main.php

UPDATE 1 :

을 나는이 코드 시작 t 생각 그는 지불, 여기에 사용자 정의 값을 지정해야합니까? 그렇다면 어떻게?

<?php 
//------------------------------------------------- 
// When you integrate this code 
// look for TODO as an indication 
// that you may need to provide a value or take action 
// before executing this code 
//------------------------------------------------- 

require_once ("paypalplatform.php"); 


// ================================== 
// PayPal Platform Basic Payment Module 
// ================================== 

// Request specific required fields   
$actionType   = "PAY"; 
$cancelUrl   = "some url here"; // TODO - If you are not executing the Pay call for a preapproval, 
           //  then you must set a valid cancelUrl for the web approval flow 
           //  that immediately follows this Pay call 
$returnUrl   = "some url here"; // TODO - If you are not executing the Pay call for a preapproval, 
           //  then you must set a valid returnUrl for the web approval flow 
           //  that immediately follows this Pay call 
$currencyCode   = "USD"; 

// A basic payment has 1 receiver 
// TODO - specify the receiver email 
$receiverEmailArray  = array(
        'receivers email here' 
       ); 

// TODO - specify the receiver amount as the amount of money, for example, '5' or '5.55' 
$receiverAmountArray  = array(
        'receivers amount here' 
       ); 

// for basic payment, no primary indicators are needed, so set empty array 
$receiverPrimaryArray  = array(); 

// TODO - Set invoiceId to uniquely identify the transaction associated with the receiver 
//  You can set this to the same value as trackingId if you wish 
$receiverInvoiceIdArray  = array(
        '1234abc' 
       ); 

// Request specific optional or conditionally required fields 
// Provide a value for each field that you want to include in the request, if left as an empty string the field will not be passed in the request 
$senderEmail    = "";  // TODO - If you are executing the Pay call against a preapprovalKey, you should set senderEmail 
          //  It is not required if the web approval flow immediately follows this Pay call 
$feesPayer    = ""; 
$ipnNotificationUrl   = "some url here"; 
$memo     = "";  // maxlength is 1000 characters 
$pin     = "";  // TODO - If you are executing the Pay call against an existing preapproval 
          //  the requires a pin, then you must set this 
$preapprovalKey    = "";  // TODO - If you are executing the Pay call against an existing preapproval, set the preapprovalKey here 
$reverseAllParallelPaymentsOnError = "";  // Do not specify for basic payment 
$trackingId      = generateTrackingID(); // generateTrackingID function is found in paypalplatform.php 

//------------------------------------------------- 
// Make the Pay API call 
// 
// The CallPay function is defined in the paypalplatform.php file, 
// which is included at the top of this file. 
//------------------------------------------------- 
$resArray = CallPay ($actionType, $cancelUrl, $returnUrl, $currencyCode, $receiverEmailArray, 
         $receiverAmountArray, $receiverPrimaryArray, $receiverInvoiceIdArray, 
         $feesPayer, $ipnNotificationUrl, $memo, $pin, $preapprovalKey, 
         $reverseAllParallelPaymentsOnError, $senderEmail, $trackingId 
); 

$ack = strtoupper($resArray["responseEnvelope.ack"]); 
if($ack=="SUCCESS") 
{ 
    if ("" == $preapprovalKey) 
    { 
     // redirect for web approval flow 
     $cmd = "cmd=_ap-payment&paykey=" . urldecode($resArray["payKey"]); 
     RedirectToPayPal ($cmd); 
    } 
    else 
    { 
     // payKey is the key that you can use to identify the payment resulting from the Pay call 
     $payKey = urldecode($resArray["payKey"]); 
     // paymentExecStatus is the status of the payment 
     $paymentExecStatus = urldecode($resArray["paymentExecStatus"]); 
    } 
} 
else 
{ 
    //Display a user friendly Error on the page using any of the following error information returned by PayPal 
    //TODO - There can be more than 1 error, so check for "error(1).errorId", then "error(2).errorId", and so on until you find no more errors. 
    $ErrorCode = urldecode($resArray["error(0).errorId"]); 
    $ErrorMsg = urldecode($resArray["error(0).message"]); 
    $ErrorDomain = urldecode($resArray["error(0).domain"]); 
    $ErrorSeverity = urldecode($resArray["error(0).severity"]); 
    $ErrorCategory = urldecode($resArray["error(0).category"]); 

    echo "Preapproval API call failed. "; 
    echo "Detailed Error Message: " . $ErrorMsg; 
    echo "Error Code: " . $ErrorCode; 
    echo "Error Severity: " . $ErrorSeverity; 
    echo "Error Domain: " . $ErrorDomain; 
    echo "Error Category: " . $ErrorCategory; 
} 

?> 

원래의 질문 :

나는 사용자가 내 웹 사이트에서 결제 할 수 있습니다 페이팔에서 일부 스크립트가 있습니다. 그들은 기본적인 지불 스크립트를 사용하여 지불을 보낼 때 첫 번째 단계에서

, 내가 다시이 값을 얻을 :

지불이 자신의 IPN 시스템을 사용하여, 페이팔에서 확인
Array ( 
[responseEnvelope.timestamp] => 2011-04-08T01:34:03.578-07:00 
[responseEnvelope.ack] => Success 
[responseEnvelope.correlationId] => a2de97aaf57f0 
[responseEnvelope.build] => 1822511 
[payKey] => AP-8AW04791DK417062F 
[paymentExecStatus] => CREATED) 

, 내가 다시이 값을 얻을 :

test_ipn = 1 
payment_type = instant 
payment_date = 01:11:38 Apr 08, 2011 PDT 
payment_status = Completed 
address_status = confirmed 
payer_status = verified 
first_name = John 
last_name = Smith 
payer_email = [email protected] 
payer_id = TESTBUYERID01 
address_name = John Smith 
address_country = United States 
address_country_code = US 
address_zip = 95131 
address_state = CA 
address_city = San Jose 
address_street = 123, any street 
business = [email protected] 
receiver_email = [email protected] 
receiver_id = TESTSELLERID1 
residence_country = US 
item_name = something 
item_number = AK-1234 
quantity = 1 
shipping = 3.04 
tax = 2.02 
mc_currency = USD 
mc_fee = 0.44 
mc_gross = 12.34 
mc_gross_1 = 9.34 
txn_type = web_accept 
txn_id = 3848811 
notify_version = 2.1 
custom = xyz123 
charset = windows-1252 
verify_sign = AWPjjtnKgiQkL5dH.EojlIO6uUy9AijwJCRexi2IglsAajCxoIkbVEq- 

내가 나를 지불이 성공적으로 완료되었다는 말을 올바른 데이터베이스 레코드를 업데이트 할 수 있도록 나에게 연결을 할 수 있도록 모든 값을 볼 수 없습니다.

+0

Paypal에서 "내부 서버 오류입니다. 자세한 내용은 서버 로그를 확인하십시오."라는 오류 메시지가 표시됩니다. 나는 그 문제가 무엇인지 알지 못한다. 서버 로그를 확인했지만이 오류와 관련된 내용을 찾지 못했습니다. 나에 대한 제안이 있니? – gautamlakum

답변

2

txn_id = 3848811은 paypal의 거래 ID입니다. Paypal에서 시스템의 일부 식별자 (지불 식별자)에 대한 참조를 되돌리려면, 먼저 요청할 때 "custom"필드를 사용할 수 있습니다.

NVP를 사용하는 경우 PAYMENTREQUEST_n_CUSTOM이고 SOAP 인터페이스에 대해 알지 못합니다.

+0

나는 paypals 기본 결제 모듈 스크립트에서 txn_id를 어떻게 캡처합니까? 이를 캡처 할 수 있다면 ipn에서 반환 된 txn_id를 사용하여 올바른 데이터베이스 레코드를 업데이트하는 방법을 알 수 있습니다. – oshirowanen

+0

고객을 리디렉션 하시겠습니까? 거래 ID는 고객이 결제를 완료 한 경우에만 생성됩니다. 즉, 재 방문 요청 (의미, 성공 URL) 또는 IPN으로 캡처 할 수 있음을 의미합니다.따라서 실제 결제를 통해 장바구니를 식별하려면 사용자 정의 필드를 보내야합니다. – jishi

+0

@jishi, 원래 질문의 업데이트 1을 참조하십시오. – oshirowanen