我的paypal重复代码有什么问题

时间:2014-11-03 16:03:10

标签: php paypal

我做的一切都是正确的,看起来都是合法的,但我没有看到我的假用户向商家付款:

enter image description here

这是我的代码中的内容:

创建计划:

$req = array(
            'USER'      => 'bennyrefaelov-facilitator_api1.gmail.com',
            'PWD'  => 'YWKQ3M3NXBTZQ78U',
            'SIGNATURE' => 'AFcWxV21C7fd0v3bYYYRCpSSRl31AuVEFUpBu6N8yXkmFksuwwSiQOW8',
            'VERSION'   => '98.0',
            'METHOD'    => 'SetExpressCheckout',
            'PAYMENTREQUEST_0_PAYMENTACTION' => 'Mark',
            'REQCONFIRMSHIPPING'=>'0',
            'NOSHIPPING'=>'1',
            'ALLOWNOTE'=>'0',
            'SOLUTIONTYPE'=>'Sole',
            'LANDINGPAGE'=>'Billing',
            'BRANDNAME'=>'MisterSurvey',
            'PAYMENTREQUEST_0_AMT'=>'100.00',
            'MAXAMT' => '100.00',
            'L_BILLINGAGREEMENTDESCRIPTION0' => 'Pay up',
            'PAYMENTREQUEST_0_TAXAMT'=>'0',
            'PAYMENTREQUEST_0_ITEMAMT'=>'100.00',
            'L_BILLINGTYPE0' => 'RecurringPayments',
            'PAYMENTREQUEST_0_DESC'=>'An awesome package',
            'PAYMENTREQUEST_0_CUSTOM'=>'This is just for fun',
            'PAYMENTREQUEST_0_CURRENCYCODE'=>'USD',
            'L_PAYMENTREQUEST_0_NUMBER0'=>'itemid1',
            'L_PAYMENTREQUEST_0_NAME0'=>'MyItem1',
            'L_PAYMENTREQUEST_0_DESC0'=>'basic package',
            'L_PAYMENTREQUEST_0_QTY0'=>'1',
            'L_PAYMENTREQUEST_0_AMT0'=>'100.00',
            'L_PAYMENTREQUEST_0_TAXAMT0'=>'0',
            'RETURNURL'=>'http://mistersurveylocal.com:8080/#/pricing',
            'CANCELURL'=>'http://mistersurveylocal.com:8080/#/'
       );

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp');
        curl_setopt($ch, CURLOPT_VERBOSE, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($req));
        $return = curl_exec($ch);
        curl_close($ch);

执行计划(在用户同意后)

 $token =  Input::get('token');
     $payerId = Input::get('payerId');

$req = array(
        'USER'      => 'bennyrefaelov-facilitator_api1.gmail.com',
        'PWD'  => 'YWKQ3M3NXBTZQ78U',
        'SIGNATURE' => 'AFcWxV21C7fd0v3bYYYRCpSSRl31AuVEFUpBu6N8yXkmFksuwwSiQOW8',
        'VERSION'   => '98.0',
        'METHOD'    => 'CreateRecurringPaymentsProfile',
        'TOKEN'=>$token,
        'payerid'=>$payerId,
        'PROFILESTARTDATE' =>date('Y-m-d\TH:i:s\Z'),
        'TOTALBILLINGCYCLES'=>'12',
        'DESC'=>'Pay up',
        'BILLINGPERIOD'=>'Month',
        'BILLINGFREQUENCY'=>'1',
        'AMT'=>'100',
        'CURRENCYCODE'=>'USD',
        'COUNTRYCODE'=>'US',
        'MAXFAILEDPAYMENTS'=>'3'
   );

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp');
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($req));
    $return = curl_exec($ch);
    curl_close($ch);

    return urldecode($return);

它说它已经激活并经过验证,开始日期是在这个时刻,为什么没有付款? 有什么遗失的吗?

1 个答案:

答案 0 :(得分:1)

我遇到了完全相同的问题。事实证明,Sandbox的速度非常慢。经过2天的故障排除和调试,所有交易完成后,我收到了与之相关的所有IPN消息。

这很不幸,但解决办法就是等待他们处理。希望生活会更快。