0
votes

The problem is in the buyer paypal account. The problem is that Total appears $0.00 USD not $0.02. The amount inside the recurring is set to $0.02 enter image description here

This is the parameters that I set with CreateRecurringPaymentsProfile :

$padata = array(
'L_PAYMENTREQUEST_0_NAME0' => 'My Product',
'PROFILEREFERENCE' => 'RPInvoice123',
'PROFILESTARTDATE' => date('Y-m-d') . 'T' . date('H:i:s').'Z',
'SUBSCRIBERNAME' => 'Mr Sub Scriber',
'TOKEN' => urlencode($token),
'DESC' => 'My Product + Second Product',
'AMT' => '0.02',
'BILLINGPERIOD' => 'Month',
'BILLINGFREQUENCY' => '1',
'TOTALBILLINGCYCLES' => '12',
'REGULARTOTALBILLINGCYCLES' => '1',
'VERSION' => '74.0',
'MAXFAILEDPAYMENTS' => '1',
'L_PAYMENTREQUEST_0_AMT0' => '0.02',
'L_PAYMENTREQUEST_0_NUMBER0' => '10101',
'L_PAYMENTREQUEST_0_QTY0' => '1',
'L_BILLINGTYPE0' => 'RecurringPayments',
'L_BILLINGAGREEMENTDESCRIPTION0' => 'My Product + Second Product',
'L_PAYMENTREQUEST_0_ITEMCATEGORY0' => 'Digital'
);

How can I get this working?

2

2 Answers

0
votes

Actually you are not setting some initial amount to charge immediately to customer.So the Recurring profile get created and will charge the customer $0.02 from next billing cycle. Suppose you are charging customer $100/month and you want to charge first $100 immediately set initial amount in API call.So after creating the profile one $100 (or any other amount you want charge the customer for first time) transaction will occur against that profile. Sample SOAP API Call

$profileDetails = new RecurringPaymentsProfileDetailsType();
$profileDetails->BillingStartDate = gmdate("Y-m-d\TH:i:s\Z");
$profileDetails->ProfileReference = 'user_id=' . $_SESSION['userid'].'|plan_id='.$_SESSION['plan_id'];
$activationDetails = new ActivationDetailsType();
/*
 * (Optional) Initial non-recurring payment amount due immediately upon profile creation. Use an initial amount for enrolment or set-up fees.
 */
$activationDetails->InitialAmount = new BasicAmountType($this->currency, $_SESSION['amount']);

$paymentBillingPeriod = new BillingPeriodDetailsType();
$paymentBillingPeriod->BillingFrequency = 1;
$paymentBillingPeriod->BillingPeriod = "Month";
$paymentBillingPeriod->Amount = new BasicAmountType($this->currency, $_SESSION['amount']);

$scheduleDetails = new ScheduleDetailsType();


$scheduleDetails->Description = "recurring";
$scheduleDetails->PaymentPeriod = $paymentBillingPeriod;
$scheduleDetails->ActivationDetails = $activationDetails;

$createRPProfileRequestDetails = new CreateRecurringPaymentsProfileRequestDetailsType();
$createRPProfileRequestDetails->Token = $_SESSION['token'];

$createRPProfileRequestDetails->ScheduleDetails = $scheduleDetails;
$createRPProfileRequestDetails->RecurringPaymentsProfileDetails = $profileDetails;

$createRPProfileRequest = new CreateRecurringPaymentsProfileRequestType();
$createRPProfileRequest->CreateRecurringPaymentsProfileRequestDetails = $createRPProfileRequestDetails;

$createRPProfileReq = new CreateRecurringPaymentsProfileReq();
$createRPProfileReq->CreateRecurringPaymentsProfileRequest = $createRPProfileRequest;

$config = array(
    'mode' => $this->environment,
    'acct1.UserName' => $this->username,
    'acct1.Password' => $this->password,
    'acct1.Signature' => $this->signature
);
$paypalService = new PayPalAPIInterfaceServiceService($config);
$createRPProfileResponse = $paypalService->CreateRecurringPaymentsProfile($createRPProfileReq);
0
votes

You need to pass the variable "INITAMT=0.02" if you want to charge an initial amount while creating the recurring profile and it will show up in the first row of the image that you have attached. This will be the one time charge and has no impact on the regular recurring amount .

You can refer the below link for more info :

https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/