Issue 16: IPN integration caused bugs in mailing code
Status:  Fixed
Owner: ----
Closed:  Jun 2008
Reported by cmauj...@gmail.com, Feb 19, 2008
What steps will reproduce the problem?
1. enable and configure paypal IPN
2. run an order live mode/production environment or in test
mode/development environment
3. watch the email not be sent. 

What is the expected output? What do you see instead?

expected to get an email, got none, log messages included FAILED TO SEND
CONFIRMATION EMAIL

What version of the product are you using? On what operating system?

Substruct 1.0.a2 on CentOS5 with mongrel_cluster, lighttpd proxy balancing
and mysql.


Please provide any additional information below.

the first issue is with Order.cleanup_successful attempting to have
OrderAccount obscure a non-existent cc_number
the second is in the confirmation email template
app/views/orders_mailer/_order.rhtml where order_account.cc_number.length
is being called with a nil cc_number.

I'll be submitting a patch for this tomorrow.
 

 
Feb 19, 2008
#1 cmauj...@gmail.com
actually, I've filed this wrong, too tired to be filing bugs. I'll refile it
correctly tomorrow with the patches, there are 2 different bugs here, not 1.
Feb 19, 2008
#2 cmauj...@gmail.com
OK.  Issue 1 , IPN receives a 500 error due to an attempt to clear_personal_information
on a nil OrderAccount.cc_number, auth_transaction_id is stored on the order anyway.
Paypal resends IPN, order is flagged for fraud, due to existing auth_transaction_id

Patch attached as double-ipn-call.patch
double-ipn-call.patch
585 bytes   View   Download
Feb 19, 2008
#3 cmauj...@gmail.com
item 2 - email fails to be sent due to OrderAccount.cc_number.length call with
cc_number.nil? == true in app/views/orders_mailer/_order.rb.

patch attached as mail-send-fails.patch
mail-send-fails.patch
846 bytes   View   Download
Feb 19, 2008
#4 cmauj...@gmail.com
one more note on this. These patches come courtesy of www.azimuthinternet.com, the
company paying me to hack on substruct.
Jun 14, 2008
Project Member #5 subim...@gmail.com
Thanks for the patches, and the heads up on this. However, I chose to fix this in a little different way, one that 
involves less code.

With r84 I created a new method - OrderAccount.cc_number_last_four, which returns the proper value.

r85 cleans the code up so it won't error out of the cc number is nil. I believe this is better and more robust than 
checking CC processor where it's unnecessary.
Status: Fixed