CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • CiviContribute new Recurring Contribution throws 11518 error from PayPal Pro
Pages: [1]

Author Topic: CiviContribute new Recurring Contribution throws 11518 error from PayPal Pro  (Read 757 times)

elmobile

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
    • elMobile Inc.
  • CiviCRM version: 3.1, 3.3, 3.4, 4.1
  • CMS version: Drupal 6.16, 6.22, 7 / Joomla 1.5, 2.5
CiviContribute new Recurring Contribution throws 11518 error from PayPal Pro
July 12, 2011, 04:39:53 pm
CiviCRM version: 3.2.4.

The one-time contributions all went through successfully so we know the PayPal Pro integration works.

Problem is we use the sample 'Help Support CiviCRM' page with 'Recurring contributions' box checked and it throws error like-
  Payment Processor Error message
: 11518:Invalid billing period. Billing period must be one of Day, Week, SemiMonth, or Year

Same error message was printed when we did the Test Drive on the same contribution page.

We limit the recurring units to month and year on the sample 'Help Support CiviCRM' page.

Could there be any Drupal / CiviCRM plugin(s) that conflicting the 'Make Donation' form submission?

Any tip appreciated!

elmobile

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
    • elMobile Inc.
  • CiviCRM version: 3.1, 3.3, 3.4, 4.1
  • CMS version: Drupal 6.16, 6.22, 7 / Joomla 1.5, 2.5
Re: CiviContribute new Recurring Contribution throws 11518 error from PayPal Pro
July 15, 2011, 12:17:46 am
Actually found the cause of the problem.

We modified the *label* column of the 'recur_frequency_units' option in the CiviCRM database.
The out-of-box 'label' column has the following entries:
day, week, month, year.

We customized the 'label' column to have
daily, weekly, monthly, yearly
to match our custom message on the Contribution pages.

Such customization on the 'label' made the assignToTemplate( ) function in
CRM/Contribute/Form/ContributionBase.php sending
'daily', or 'weekly', or 'monthly' or 'yearly' to PayPal Pro.
And thus PayPal returns error message.

A closer look at around line 592 in the assignToTemplate( ) function of the
ContributionBase.php showed the $frequencyUnits is getting the 'label' entries
of the 'recur_frequency_units' option:

$frequencyUnits =  CRM_Core_OptionGroup::values( 'recur_frequency_units' );

I think the original intend is for $frequencyUnits to get the 'value' entries of the 'recur_frequency_units' option.
The 'value' entries of the 'recur_frequency_units' option are
day, week, month, year.
And the function call to get $frequencyUnits should be

$frequencyUnits =  CRM_Core_OptionGroup::values( 'recur_frequency_units',
/* $flip = */ false, /* $grouping = */ false, /* $localize = */ false, /* $condition = */ null,
/* $valueColumnName = */ 'value');

The above modification allows CiviCRM developer using any custom 'label' on the
Contribution page while passing the correct billing period to PayPal.
So the above change fixed our problem.

Thanks for the great framework.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviContribute new Recurring Contribution throws 11518 error from PayPal Pro
July 15, 2011, 01:55:30 pm

Can you please file an issue for this and link to this forum post

thnx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

elmobile

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
    • elMobile Inc.
  • CiviCRM version: 3.1, 3.3, 3.4, 4.1
  • CMS version: Drupal 6.16, 6.22, 7 / Joomla 1.5, 2.5
Re: CiviContribute new Recurring Contribution throws 11518 error from PayPal Pro
July 16, 2011, 08:05:38 am
Filed a bug report as CRM-8504:
http://issues.civicrm.org/jira/browse/CRM-8504

Thanks.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • CiviContribute new Recurring Contribution throws 11518 error from PayPal Pro

This forum was archived on 2017-11-26.