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) »
  • ContributionProcessor.php for recurring contributions
Pages: [1]

Author Topic: ContributionProcessor.php for recurring contributions  (Read 3327 times)

nkinkade

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 5
ContributionProcessor.php for recurring contributions
September 18, 2009, 03:15:36 pm
I just tried using the script bin/ContributionProcessor.php to import a recurring contribution from PayPal, but it fails with the following error and skips the contribution:

"Transaction refused because of an invalid argument. See additional error messages for details. The transaction id is not valid"

Does ContributionProcessor.php not support fetching recurring payment transactions?

The $trxnDetails look like this:

Code: [Select]
(
    [receiverbusiness] => <biz email>
    [receiveremail] => <biz email>
    [receiverid] => 64QCW9X259U2W
    [email] => <user email>
    [payerid] => ZGN83TYBBKFQ8
    [payerstatus] => verified
    [countrycode] => US
    [shiptoname] => Test User
    [shiptostreet] => 1 Main St
    [shiptocity] => San Jose
    [shiptostate] => CA
    [shiptocountrycode] => US
    [shiptocountryname] => United States
    [shiptozip] => 95131
    [addressowner] => PayPal
    [addressstatus] => Confirmed
    [invnum] => 4c50e9ac1e5b6fbb19d9c97abb8096e0
    [custom] => a:2:{s:5:"pcpid";s:1:"1";s:6:"groups";a:2:{i:1;s:6:"Events";i:0;s:0:"";}}
    [timestamp] => 2009-09-18T21:41:51Z
    [correlationid] => 2f76abf24fbf7
    [ack] => Success
    [version] => 3
    [build] => 000000
    [firstname] => Test
    [lastname] => User
    [transactionid] => 7JG25838KM5983525
    [transactiontype] => subscrpayment
    [paymenttype] => instant
    [ordertime] => 2009-09-18T21:04:21Z
    [amt] => 133.00
    [feeamt] => 4.16
    [currencycode] => USD
    [paymentstatus] => Completed
    [pendingreason] => None
    [reasoncode] => None
    [l_name0] => Online Contribution: Join the Commons
    [l_currencycode0] => USD
    [l_optionsname0] => Gifts
    [l_optionsvalue0] => Yes
    [subscriptionid] => S-4XM3920876257903R
    [subscriptiondate] => 2009-09-18T21:04:20Z
    [recurrences] => 12
    [l_amt2] => 133.00
    [l_period2] => 1 M
    [reattempt] => 1
    [recurring] => 1
)

The error looks like this:

Skipped - <user email>, 133.00, 7JG25838KM5983525 ...
Code: [Select]
CRM_Core_Error Object
(
    [_errors] => Array
        (
            [0] => Array
                (
                    [code\] => 10004
                    [params] =>
                    [package] => CRM
                    [level] => 0
                    [time] => 1253311768.21
                    [context] => Array
                        (
                            [file] => /var/www/zupport.creativecommons.org/www/sites/default/modules/civicrm/CRM/Core/Payment/PayPalImpl.php
                            [line] => 474
                            [function] => invokeAPI
                            [class] => CRM_Core_Payment_PayPalImpl
                        )

                    [message] => Transaction refused because of an invalid argument. See additional error messages for details. The transaction id is not valid
                )

            [1] => Array
                (
                    [code\] => 10004
                    [params] =>
                    [package] => CRM
                    [level] => 0
                    [time] => 1253311767.54
                    [context] => Array
                        (
                            [file] => /var/www/zupport.creativecommons.org/www/sites/default/modules/civicrm/CRM/Core/Payment/PayPalImpl.php
                            [line] => 474
                            [function] => invokeAPI
                            [class] => CRM_Core_Payment_PayPalImpl
                        )

                    [message] => Transaction refused because of an invalid argument. See additional error messages for details. The transaction id is not valid
                )

        )

    [_errorsByLevel] => Array
        (
            [0] => Array
                (
                    [0] => Array
                        (
                            [code\] => 10004
                            [params] =>
                            [package] => CRM
                            [level] => 0
                            [time] => 1253311767.54
                            [context] => Array
                                (
                                    [file] => /var/www/zupport.creativecommons.org/www/sites/default/modules/civicrm/CRM/Core/Payment/PayPalImpl.php
                                    [line] => 474
                                    [function] => invokeAPI
                                    [class] => CRM_Core_Payment_PayPalImpl
                                )

                            [message] => Transaction refused because of an invalid argument. See additional error messages for details. The transaction id is not valid
                        )

                    [1] => Array
                        (
                            [code\] => 10004
                            [params] =>
                            [package] => CRM
                            [level] => 0
                            [time] => 1253311768.21
                            [context] => Array
                                (
                                    [file] => /var/www/zupport.creativecommons.org/www/sites/default/modules/civicrm/CRM/Core/Payment/PayPalImpl.php
                                    [line] => 474
                                    [function] => invokeAPI
                                    [class] => CRM_Core_Payment_PayPalImpl
                                )

                            [message] => Transaction refused because of an invalid argument. See additional error messages for details. The transaction id is not valid
                        )

                )

        )

    [_package] => CRM
    [_compat] =>
    [_msgCallback] => Array
        (
            [0] => CRM_Core_Error Object
 *RECURSION*
            [1] => getErrorMessage
        )

    [_contextCallback] => Array
        (
            [0] => CRM_Core_Error Object
 *RECURSION*
            [1] => getFileLine
        )

    [_errorCallback] => Array
        (
        )

    [_logger] => Log_display Object
        (
            [_lineFormat] => <b>%3$s</b>: %4$s
            [_timeFormat] => %b %d %H:%M:%S
            [_opened] =>
            [_id] => 6df21d29d3395a847f24c4f155b5edbd
            [_ident] =>
            [_priority] => 6
            [_mask] => 255
            [_listeners] => Array
                (
                )

            [_formatMap] => Array
                (
                    [%{timestamp}] => %1$s
                    [%{ident}] => %2$s
                    [%{priority}] => %3$s
                    [%{message}] => %4$s
                    [%{file}] => %5$s
                    [%{line}] => %6$s
                    [%{function}] => %7$s
                    [%\{] => %%{
                )

        )

    [_errorMsgs] => Array
        (
        )

)
PAYPAL ERROR: Skipping transaction id: S-4XM3920876257903R


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: ContributionProcessor.php for recurring contributions
September 18, 2009, 05:15:05 pm

ContributionProcessor does not handle recurring contributions (we did not write any recurring specific code, so dont know if it works). Does it work for regular contributions. The first error message seems like a paypal message, so might want to start your investigation there

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

nkinkade

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 5
Re: ContributionProcessor.php for recurring contributions
September 21, 2009, 02:38:06 pm
Hmm.  Yes, non-recurring donations work just fine with ContributionProcessor.php.  I guess it could be a PayPal error, but if so then it seems like it's most likely Civi's API code that is triggering it because the payment goes through just fine and PayPal seems happy.  The error arises when ContributionProcessor.php goes to fetch the contribution.

I guess I'll go through the code and see about adding support for recurring contributions.  It really needs to be able to support them and I sort of consider it a bug if it doesn't since support for recurring contributions is a standard part of CiviContribute.

nkinkade

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 5
Re: ContributionProcessor.php for recurring contributions
September 25, 2009, 09:08:45 am
Fixed for PayPal with the patch attached to the follow issue:

http://issues.civicrm.org/jira/browse/CRM-5129

If payment processors other than PayPal support recurring contributions, it would be nice to see someone make it work for them following the PayPal example in that patch.

Nathan

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • ContributionProcessor.php for recurring contributions

This forum was archived on 2017-11-26.