0

Hello I am new to PayPal integration. I am using the Express checkout of PayPal for payment. I wrote the code use SetExpressCheckout method then GetExpressCheckout method and then use DoExpressCheckout method. After DoExpressCheckout I am calling the CreateRecurringPaymentsProfile for recurring payment. Code as follows-

$recurringdata = array(
                        'TOKEN' => $token,//token id

                        'PayerID' => $payerid,//payer id

                        'PROFILESTARTDATE' => date('Y-m-d H:i:s',$time),

                        'DESC' => "description",

                        'BILLINGPERIOD' => 'Day',

                        'BILLINGFREQUENCY' => 1,

                        'AMT' =>$checkoutDetails['PAYMENTREQUEST_0_AMT'],

                        'TRIALBILLINGPERIOD'=>'Day',

                        'TRIALBILLINGFREQUENCY'=>1,

                        'TRIALAMT'=> 0,

                        'CURRENCYCODE' => 'USD',

                        'COUNTRYCODE' => 'US',

                        'MAXFAILEDPAYMENTS' =>3
                     );

  $responserecurring = $paypal->request('CreateRecurringPaymentsProfile', $recurringdata);

This code creates the profile but I can not see that any recurring payment is done. I am not getting what actually happens. Is am I missing to pass any parameter in request.

ono2012
  • 4,967
  • 2
  • 33
  • 42

1 Answers1

0

Actually i am missing the one parameter i.e. 'TRIALTOTALBILLINGCYCLES'. This parameter is an optional so i am not used this. So my trail period goes in infinite state. So payment is not deducting from account.I pass the data like as_

$recurringdata = array( 'TOKEN' => $token,//token id

                    'PayerID' => $payerid,//payer id

                    'PROFILESTARTDATE' => date('Y-m-d H:i:s',$time),

                    'DESC' => "description",

                    'BILLINGPERIOD' => 'Day',

                    'BILLINGFREQUENCY' => 1,

                    'AMT' =>$checkoutDetails['PAYMENTREQUEST_0_AMT'],

                    'TRIALBILLINGPERIOD'=>'Day',

                    'TRIALBILLINGFREQUENCY'=>1,

                    'TRIALAMT'=> 0,

                    'TRIALTOTALBILLINGCYCLES' => 1,

                    'CURRENCYCODE' => 'USD',

                    'COUNTRYCODE' => 'US',

                    'MAXFAILEDPAYMENTS' =>3
                 );

$responserecurring = $paypal->request('CreateRecurringPaymentsProfile', $recurringdata);