Download & Extend

Payment Information not return

Project:Simple payments
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active

Issue Summary

Hello

I am trying to implement simple payments paypal hooks. But it doesn't seems to work for me.
I have created button as said in module description it takes me to paypal also and after successful payments also it doesn't return any payment information back.
Can anyone help me in this ??

Comments

#1

Yeah, I can't get it to save transactions to the simple_payment table either. I'm using 6.x-1.x-dev in sandbox mode.

I can:

- Click the button, it takes me to the payment screen.
- Pay via PayPal's sandbox mode and complete the transaction.
- Return to the referring piece of content.
- Receive payment info via simple_payments_paypal_ipn() and output to log via watchdog();

hook_simple_payment_process(); in my module (referenced in the "module" key of the form builder) doesn't seem to be firing.

UPDATE: my sandbox accounts were using different currencies and was thus marking payments as "pending". When a payment is marked as "pending", Simple Payments doesn't do anything, even though the payment was successful.

#2

@Yarrait -- Is PayPal pushing data to /system/simple_payments_paypal/ipn? If so, then the module's working, just there's something wrong with the transaction (In my case, PayPal was marking transactions as "pending" due to a difference in currency between the Merchant and Buyer accounts; make your testing accounts are the same currency.).

First thing -- use the dev version if you're not already, it allows you to use PayPal's sandbox mode.

Secondly -- try adding the following line to simple_payments/gateways/simple_payments_paypal.module at around line 148 (just after $ipn = $_POST; ):

watchdog('simple_payments', 'IPN received data: @info', array('@info' => var_export($payment, TRUE)));

This will cause an entry in /admin/reports/dblog (Enable the Core: Database Logging module first!) containing all of your returned payment info.

If you can get to that point, figuring out the rest is pretty simple. There are two conditionals after the line I told you to add, which are what cause the problem I outlined above.

@jbrown -- It'd help a lot if you could put some debug info into the two conditionals in function simple_payments_paypal_ipn()... I just spent ~two hours placing watchdog(); statements all over your code, trying to figure out where it was exiting before writing to db... A debug mode in general would make this a super awesome module.

#3

The payment status I'm getting is pending, although the buyer and seller accounts are same currency.

Question: Does paypal later convert "Pending" to "Completed"? And if it does, does paypal send another IPN to the module when this happens? (Should I expect a 2nd call?)

Finally, should I just consider "Pending" the same as "Completed" in the code? And if so, is this a bug in this module, or is there some other reason "Pending" and "Completed" are treated differently?

Thanks!

#4

Bumping...

#5

Title:Payment Information not return» Check libcurl!

In my case, the problem was the absence of the php5-curl library.

#6

Title:Check libcurl!» Payment Information not return

Sorry, I changed the title...