Closed (fixed)
Project:
UC Payflow Pro
Version:
6.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
7 Jul 2009 at 15:31 UTC
Updated:
20 Aug 2009 at 21:00 UTC
According to the PFP docs, PAYPERIOD must be one of the 4-letter all-caps codes listed in the document. We are currently sending the plain text representation.
The function that maps the internal codes to the PFP ones is currently in use in other places, so it will need to be forked.
Comments
Comment #1
kwinters commentedFixed in both the d5 and d6 devel branches. Set to Review just because I would like independent verification that the payment period comes through correctly.
* Split maps into two functions, one for pfp and the other for display
* Changed the helper function used by the interface functions to use the display map
* Corrected unsafe static naming assumptions
* Documented the modified functions
* Fixed a db query key typo for update recurring products
* Fixed reporting of term count on recurring products list
Comment #2
sarahjean commentedTrying to get the recurring payments working, we have regular payments going through and recurring payments set up on the client's Payflow account, but we are getting this error and the profiles don't get set up:
"Recurring payment declined for $5.00 with error code 7 (Field format error: Invalid PAYPERIOD)."
Everything else seems to be going through fine.
Comment #3
kwinters commentedWhich version are you currently using?
Also, if you could find out what the actual period being sent in with the XML is, that would be helpful. Search for /PayPeriod> in the class file. I believe it's supposed to be 4 letters and all caps.
Comment #4
sarahjean commented6.x-1.1-beta2
I'm not a developer, but I will do my best to look for it. Do you mean PayflowProRecurring.class.php , or am I completely misunderstanding you?
Comment #5
sarahjean commentedThis line?
<PayPeriod>' . check_plain($this->getPayPeriod()) . '</PayPeriod>Comment #6
kwinters commentedYes. Right before return $xml; do this:
var_dump($xml);die();
Comment #7
sarahjean commentedIn between
'</RPData>';and return $xml; ?Comment #8
kwinters commentedYes. On a new line is usually easiest.
You can find me on IRC, if that's easier.
Once the line is in place, place a test order and let me know what appears inside the period tag.
Comment #9
sarahjean commentedper IRC:
tried changing the line:
<PayPeriod>' . check_plain($this->getPayPeriod()) . '</PayPeriod>With:
<PayPeriod>Weekly</PayPeriod>with the same error message.Comment #10
kwinters commentedI committed some code, so try again with the devel version when you can. The XMLPay version's codes are apparently different than the REST version.
The SQL error in your log (via pastebin) was a result of the cart being empty and not checking some variables. It will no longer throw an error, but it shouldn't have broken anything before.
Devel releases are only generated every 12 hours as a tarball, so you may want check out from CVS.
Comment #11
sarahjean commentedJust set up another test with the dev version and it had the same error as before. Is there anything setup-wise that I should look at?
Comment #12
kwinters commentedIt looks like the CVS commit didn't work quite right. It should be resolved now in devel.
Comment #13
sarahjean commentedStill receiving the error with the dev version from today, I tried deleting the schedules and setting them up with different products as well.
Comment #14
kwinters commentedFirst, let's make sure you have the right version of the code. If you can find the string "Twice a Month" in includes/uc_payflowpro_recurring.inc then it's the right version. The Id string at the top will also say 1.2.2.12 so check that as well.
http://developer.paypal-portal.com/pdn/board/message?board.id=payflow&me... says "Weekly" etc. is the right format, so if it's not working with the official text then you may need to post in that forum or open a ticket at their support center.
If you post the XML, be careful about what you send (don't publicize your credit card, for example). Also, view source usually gives you a better result than trying to copy XML directly out of the normal page view.
Comment #15
sarahjean commentedNo, I've got v 1.2.2.11 from the Development snapshot. That must be part of the problem. I don't know how to do a checkout from CVS, was that what I was supposed to do?
Comment #16
kwinters commentedhttp://drupal.org/node/263591/cvs-instructions/DRUPAL-6--1 has instructions on checking out the right code from CVS.
You can also grab the file directly here: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/uc_payflowp... (though it has the wrong header, that's OK).
The devel tarball is only created every 12 hours.
Comment #17
sarahjean commentedOk, I downloaded the file directly and ran a test, and got a different error this time:
Recurring payment declined for $5.00 with error code 4 (Invalid amount).
Comment #18
kwinters commentedHrm, there shouldn't be a dollar sign in the TotalAmt XML field... It expects a number like 19.99 instead of $19.99. Is there a dollar sign in the product price field when you edit the product node?
Comment #19
sarahjean commentedNo, there's a dollar sign outside the field. I copied that text from the order view inside the store administration page.
Comment #20
kwinters commentedWell, error 4 says "Invalid amount format. Use the format: "#####.##" Do not include currency symbols or commas" in the developer docs.
I changed the code to strip off any trailing zeros, let's see if that makes a difference. The error message is incredibly unhelpful if this was the case, though.
Comment #21
sarahjean commentedOk, I tried it twice this morning, once with 6.x-1.x-dev 2009-Aug-04 and once with the version that I checked out from CVS and now it's giving me "Error code 7 Field format error: Invalid PAYPERIOD" again.
Comment #22
kwinters commentedTry the CVS version again (after cvs update), forgot a place.
Comment #23
sarahjean commentedAlright, success! I have two recurring profiles set up, with weekly as the payperiod. I checked on the PayPal Manager and they both seem to be set up properly. Thanks for the help!
Comment #24
kwinters commentedYay! Marking this as fixed, releasing another beta.