0
votes

Im trying to do a simple thing and it doesn't work properly:

Im trying to do initial payment when creating a profile, problem is, when user comes back (after his consent) from paypal, the status of the profile is pending (probably due to the initial payment that doesn't happen), and no initial amount is being paid, what could be the reason for that?

my code for excuting the recurring paypal:

$req = array(
            'USER'      => 'bennyrefaelov-facilitator_api1.gmail.com',
            'PWD'  => 'YWKQ3M3NXBTZQ78U',
            'SIGNATURE' => 'AFcWxV21C7fd0v3bYYYRCpSSRl31AuVEFUpBu6N8yXkmFksuwwSiQOW8',
            'VERSION'   => '98.0',
            'METHOD'    => 'CreateRecurringPaymentsProfile',
            'TOKEN'=>$token,
            'payerid'=>$payerId,
            'PROFILESTARTDATE' =>'2014-11-05T09:28:00Z',
            'TOTALBILLINGCYCLES'=>'11',
            'DESC'=>'Pay up',
            'BILLINGPERIOD'=>'Day',
            'BILLINGFREQUENCY'=>'1',
            'AMT'=>'100.00',
            'INITAMT' => '50.00',
            '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);

In short, why doesn't initial payment occur?

1
By default, PayPal does not activate the profile if the initial payment amount fails. To override this default behavior, set the "FAILEDINITAMTACTION" field to "ContinueOnFailure". If the initial payment amount fails, "ContinueOnFailure" instructs PayPal to add the failed payment amount to the outstanding balance due on this recurring payment profile. - user4042183
ok i got this, but how can i make the initial ammount occur when creating the profile, why doesn't it happen? i want the initial ammount to get the money right from the create - totothegreat

1 Answers

0
votes

You are using sandbox method. sandbox is slow sometimes it took a couple days for the profile to become active and send the IPN.Even live sometimes takes time.