paypal / merchant-sdk-php

PHP SDK for integrating with PayPal's Express Checkout / MassPay / Web Payments Pro APIs
Other
231 stars 201 forks source link

Invalid billing period , Frequency and Bill amount #99

Closed ArchitW closed 2 years ago

ArchitW commented 9 years ago

I am trying to create recurring profile but keep on getting this issues . Monthly US $10 for a year.

Code directly taken from "CreateRecurringPaymentsProfile.php"

$currencyCode = "USD"; $billingStartDate = date("Y-m-d\TH:i:s\Z"); $subscriberName = "Name";// Session var $token = "" ; // $amount = "10.00"

$RPProfileDetails = new RecurringPaymentsProfileDetailsType(); $RPProfileDetails->SubscriberName = $subscriberName; $RPProfileDetails->BillingStartDate = $billingStartDate;

$activationDetails = new ActivationDetailsType();

$paymentBillingPeriod = new BillingPeriodDetailsType(); $paymentBillingPeriod->BillingFrequency = '12'; $paymentBillingPeriod->BillingPeriod = 'Month';

$paymentBillingPeriod->Amount = new BasicAmountType($currencyCode, $amount); $paymentBillingPeriod->ShippingAmount = new BasicAmountType($currencyCode, 0.0); $paymentBillingPeriod->TaxAmount = new BasicAmountType($currencyCode, 0.0);

$scheduleDetails = new ScheduleDetailsType(); $scheduleDetails->Description = "This is recurring payment"; $scheduleDetails->ActivationDetails = $activationDetails;

$createRPProfileRequestDetail = new CreateRecurringPaymentsProfileRequestDetailsType(); $createRPProfileRequestDetail->Token = $token;

$createRPProfileRequestDetail->ScheduleDetails = $scheduleDetails; $createRPProfileRequestDetail->RecurringPaymentsProfileDetails = $RPProfileDetails; $createRPProfileRequest = new CreateRecurringPaymentsProfileRequestType(); $createRPProfileRequest->CreateRecurringPaymentsProfileRequestDetails = $createRPProfileRequestDetail;

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

$paypalService = new PayPalAPIInterfaceServiceService(Configuration::getAcctAndConfig()); try { /* wrap API method calls on the service object with a try catch */ $createRPProfileResponse = $paypalService->CreateRecurringPaymentsProfile($createRPProfileReq); } catch (Exception $ex) { include_once("Error.php"); exit; }

Errors :

Invalid billing period. / 11518 Billing frequency must be > 0 and be less than or equal to one year / 11516 Bill amount must be greater than 0 / 11519

devchristina commented 2 years ago

Closing due to lack of support, this repo will be archived.