相关疑难解决方法(0)

PHP Curl Paypal沙盒

是否可以使用CURL和Paypal的开发人员沙盒?当我尝试这个代码时,它在print_r($ lines)中说; 我需要登录Sandbox,如何让它发送我的浏览器cookie?

此代码来自http://leepeng.blogspot.com/2006/04/standard-paypal-php-integration.html

   $orderno = $_SESSION["ss_last_orderno"];
    $ppAcc = "[SELLER HERE]";
    $at = "[AT HERE]"; //PDT Identity Token
    $url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; //Test
    //$url = "https://www.paypal.com/cgi-bin/webscr"; //Live
    $tx = $_REQUEST['tx']; //this value is return by PayPal
    $cmd = "_notify-synch";
    $post = "tx=$tx&at=$at&cmd=$cmd";

    //Send request to PayPal server using CURL
    $ch = curl_init ($url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_setopt ($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt ($ch, CURLOPT_POST, 1);
    curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
    curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);

    $result = curl_exec ($ch); //returned result …
Run Code Online (Sandbox Code Playgroud)

php curl paypal-sandbox

9
推荐指数
1
解决办法
2万
查看次数

Paypal沙盒IPN返回INVALID

我正在尝试使用servlet进行IPN回调.我正在使用的代码由paypal提供,用于验证ipn数据.但每次我收到INVALID回复.

这是代码:

Enumeration en = req.getParameterNames();
String str = "cmd=_notify-validate";

    while (en.hasMoreElements()) {        
        String paramName = (String) en.nextElement();
        String paramValue = req.getParameter(paramName);

//str = str + "&" + paramName + "=" + URLEncoder.encode(paramValue,"UTF-8"); // for UTF-8 i set the encode format in my account as UTF-8
//str = str + "&" + paramName + "=" + URLEncoder.encode(paramValue,"ISO-8859-1");// for ISO-8859-1 i set the encode format in my account as ISO-8859-1
str = str + "&" + paramName + "=" …
Run Code Online (Sandbox Code Playgroud)

paypal sandbox paypal-sandbox

6
推荐指数
3
解决办法
3万
查看次数

是什么导致我的PayPal IPN脚本失败?

我正在从PayPal IPN脚本收到以下消息。从以下内容可以明显看出是什么导致IPN事务失败?如果没有,我该如何进一步调查问题?

[01/25/2010 7:49 PM] - FAIL: IPN Validation Failed.
IPN $_POST variables from PayPal:
mc_gross=25.00
protection_eligibility=Ineligible
address_status=unconfirmed
payer_id=AEVB83JZKDRCL
tax=0.00
address_street=1 Main Terrace
payment_date=10:49:52 Jan 25, 2010 PST
payment_status=Pending
charset=windows-1252
address_zip=W12 4LQ
first_name=Test
address_country_code=GB
address_name=Test User
notify_version=2.9
custom=
payer_status=unverified
address_country=United Kingdom
address_city=Wolverhampton
quantity=1
verify_sign=A0I1KzEZadt6mIDXxQkkIQCQKPTMAGvCuZ8RKXsOCujIi.RoMxAnbZXi
payer_email=test1_1263505944_per@example.com
txn_id=38A45069EV5838100
payment_type=instant
last_name=User
address_state=West Midlands
receiver_email=martin@example.com
pending_reason=unilateral
txn_type=web_accept
item_name=Ultimate Challenge UK Ressurection  Standard Seating (25.00 GBP)
mc_currency=GBP
item_number=
residence_country=GB
test_ipn=1
handling_amount=0.00
transaction_subject=Ultimate Challenge UK Ressurection  Standard Seating (25.00 GBP)
payment_gross=
shipping=0.00


IPN response from PayPal …
Run Code Online (Sandbox Code Playgroud)

paypal payment-gateway paypal-ipn

4
推荐指数
1
解决办法
9470
查看次数