PayPal / not finished (one more...)

03.02.2013 01:46
#1
OldLodgeSkins
Joomshopping forum user no avatar
Name: Seb
13.02.2012
Posts: 18
Quote
PayPal / not finished (one more...)

Hi all,

I'm currently doing my second attempt at using JoomShopping. I'm nearly set up this time; except I'm having the same problem a lot of other people have had... I've searched everywhere on the forum, but couldn't find a complete answer.

My configuration:
Joomla 2.5.7
PHP 5.2.12 (is PHP 5.3 required?)
JoomShopping 3.3.2

PayPal settings:
Verify data: NO
Use SSL: YES
Override addresses: YES

I have tested with both the sandbox and live settings. I get two different results.

* Sandbox: the order is normally registered in the back office but remains "pending". I've always had this behavior with the sandbox in the past using other shopping cart systems, so there's nothing surprising to me here.
* Live: the order shows as "not finished" and is locked.

I have tried to alter the settings of my PayPal acount (especially the IPN settings) but this didn't change anything. The IPNs seem to be getting through anyway. The log shows the payments as completed...

Here are the last orders in paymentdata.log, the first one is a live one, the second one is from the sandbox.


2013-02-03 01:27:16 url: /index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_paypal&no_lang=1
transaction_subject=20
payment_date=16:27:14 Feb 02, 2013 PST
last_name=Cismondo
residence_country=FR
item_name=Order number 00000143
payment_gross=-1.00
mc_currency=USD
business=contact@*******.com
payment_type=instant
protection_eligibility=Ineligible
verify_sign=A5v94doyzkAL45GWSOpp3GzSpU1aAgzX5Q.b9gAJL3yTzR1-eCmhaLwK
payer_email=********@gmail.com
txn_id=0CJ75978NC808382C
receiver_email=contact@********.com
first_name=
parent_txn_id=6P273243WV9191726
payer_id=NVG32QW47EB6Q
receiver_id=4RDHEFJY7YL3N
reason_code=other
item_number=
handling_amount=0.00
payment_status=Refunded
payment_fee=-0.03
mc_fee=-0.03
shipping=0.00
mc_gross=-1.00
custom=20
charset=windows-1252
notify_version=3.7
ipn_track_id=f4e748e337396

2013-02-03 01:28:47 url: /index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_paypal&no_lang=1
transaction_subject=24
txn_type=web_accept
payment_date=16:28:43 Feb 02, 2013 PST
last_name=Cismondo
residence_country=FR
pending_reason=unilateral
item_name=Order number 00000147
payment_gross=1.00
mc_currency=USD
payment_type=instant
protection_eligibility=Ineligible
verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31A5DVYK9egHyD6EqB2jfZ9DYakZNC
payer_status=verified
test_ipn=1
tax=0.00
payer_email=buyer2_1256219792_per@******.net
txn_id=9HE28655V0661723M
quantity=1
receiver_email=contact@******.net
first_name=Sebastien
payer_id=88WUVT8P9LSWQ
item_number=
handling_amount=0.00
payment_status=Pending
shipping=0.00
mc_gross=1.00
custom=24
charset=windows-1252
notify_version=3.7
ipn_track_id=58ae16dc77c76

2013-02-03 01:29:01 url: /index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_paypal

2013-02-03 01:29:01 url: /index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_paypal
transaction_subject=24
txn_type=web_accept
payment_date=16:28:43 Feb 02, 2013 PST
last_name=Cismondo
residence_country=FR
pending_reason=unilateral
item_name=Order number 00000147
payment_gross=1.00
mc_currency=USD
payment_type=instant
protection_eligibility=Ineligible
payer_status=verified
verify_sign=ABBFETVyISiRLBqaIgorVuJD-vlAAWERjHnr2wbjfdY5exDqe5WgvEJW
tax=0.00
test_ipn=1
payer_email=buyer2_1256219792_per@******.net
txn_id=9HE28655V0661723M
quantity=1
receiver_email=contact@h******.net
first_name=Sebastien
payer_id=88WUVT8P9LSWQ
item_number=
handling_amount=0.00
payment_status=Pending
shipping=0.00
mc_gross=1.00
custom=24
charset=windows-1252
notify_version=3.7
auth=AKDWUvo12g-630i1WbTaisG6PVDdCwdS90JXi2WVaX1Em7JRIBpm69o0SLQUDtqr57rbq5y-4lLnXPA9spQV1LQ


The live payment says "refunded" most likely because I have refunded myself... Before that it was showing as "completed".

At 1:27:16 (which maches the live payment) I have this in payment.log:


2013-02-03 01:27:16 Error mc_gross. Order ID 20


And then:

2013-02-03 01:28:48 Status pending. Order ID 24. Reason: unilateral
2013-02-03 01:28:48 unilateral


... But that's for the sandbox payments.

By the way, I'm doing the live tests using a new account I've just opened for the occasion. It's working I can transfer money between my two accounts but I wanted to mention it in case it's important. I got my nephew to do a test for me earlier and got the same kind of result (the order showing as "not finished") but that was before I tried to alter the IPN settings in my PayPal account...

Thanks.

Seb.


Joomla: 2.5.7
JoomShopping: 3.3.2
PHP: 5.2.12
MySQL: 5.1.45

Letzte Änderung: 03.02.2013 01:53
 
03.02.2013 01:57
#2
OldLodgeSkins
Joomshopping forum user no avatar
Name: Seb
13.02.2012
Posts: 18
Quote
Aw: PayPal / not finished (one more...)

I have made another live test just to make sure.

paymentdata.log:


2013-02-03 01:55:46 url: /index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_paypal&no_lang=1
transaction_subject=25
payment_date=16:55:43 Feb 02, 2013 PST
txn_type=web_accept
last_name=Cismondo
residence_country=FR
item_name=Order number 00000148
payment_gross=1.00
mc_currency=USD
business=contact@******.com
payment_type=instant
protection_eligibility=Ineligible
verify_sign=AZQLM4eL0ZlMQDmqm92I2gMxkU0DAmhyAFU56dtRQofz44jSdLwnftZr
payer_status=unverified
tax=0.00
payer_email=******@gmail.com
txn_id=4KG81631CX028941K
quantity=1
receiver_email=contact@******.com
first_name=
payer_id=NVG32QW47EB6Q
receiver_id=4RDHEFJY7YL3N
item_number=
handling_amount=0.00
payment_status=Completed
payment_fee=0.33
mc_fee=0.33
shipping=0.00
mc_gross=1.00
custom=25
charset=windows-1252
notify_version=3.7
ipn_track_id=cf58d236e5e91

2013-02-03 01:55:48 url: /index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_paypal&tx=4KG81631CX028941K&st=Completed&amt=1.00&cc=USD&cm=25&item_number=


payment.log:


2013-02-03 01:55:47 Invalid response. Order ID 25


 
03.02.2013 09:03
#3
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: PayPal / not finished (one more...)

http://www.webdesigner-profi.de/joomla-webdesign/joomla-shop/forum/posts/7/4514.html

 
03.02.2013 11:20
#4
OldLodgeSkins
Joomshopping forum user no avatar
Name: Seb
13.02.2012
Posts: 18
Quote
Aw: PayPal / not finished (one more...)

Hi,

I have already seen this... As well as a lot of other posts on the subject.
As I have posted above, my configuration matches those settings.

Seb.

 
03.02.2013 12:57
#5
OldLodgeSkins
Joomshopping forum user no avatar
Name: Seb
13.02.2012
Posts: 18
Quote
Aw: PayPal / not finished (one more...)

I am guessing that the problem happens when Joomshopping tries to verify if the notification it received is real or fake. This is where the "invalid response" message I found in the log is generated I think:

components/com_jshopping/payments/pm_paypal/pm_paypal.php

$port = 80;
if ($pmconfigs['use_ssl']) $port = 443;
$fp = fsockopen ($host, $port, $errno, $errstr, 30);
if (!$fp) {
return array(0, 'Http error. Order number '.$order->order_id);
} else {
@fputs ($fp, $header . $req);
while (!@feof($fp)) {
$res = @fgets($fp, 1024);
$res = trim($res);
$debug .= $res."\n";
if (strcmp ($res, "VERIFIED") == 0) {
if ($payment_status == 'Completed'){
return array(1, '');
} elseif ($payment_status == 'Pending') {
saveToLog("payment.log", "Status pending. Order ID ".$order->order_id.". Reason: ".$_POST['pending_reason']);
return array(2, trim(stripslashes($_POST['pending_reason'])) );
} elseif ($payment_status == 'Failed') {
return array(3, 'Status Failed. Order ID '.$order->order_id );
} elseif ($payment_status == 'Refunded') {
return array(3, "Status Refunded. Order ID ".$order->order_id );
}else {
return array(0, "Order number ".$order->order_id."\nPaypal error\nPayment status - $payment_status.");
}
} else if (strcmp ($res, "INVALID") == 0) {
return array(0, 'Invalid response. Order ID '.$order->order_id);
}
}
fclose ($fp);
if ($jshopConfig->savelog && $jshopConfig->savelogpaymentdata){
saveToLog("paymentdata.log", $debug);
}
return array(0, "Error response. Order ID ".$order->order_id);
}


My knowledge of PHP is insufficient to fully understand this function.
Still, I can see we're opening a connection (with fsockopen, which, I have verified, is available on my current server), we read something from that connection and store it in $res, which we then compare (using function strcmp) with the result we're expecting, which must be either "VERIFIED" or "INVALID".
For some reason it seems in my case $res isn't equal to "VERIFIED" but is equal to "INVALID" instead. Does this have something to do with the status of the buyer's PayPal account? What are we "verifying" exactly here?

Thanks.

Seb.


Letzte Änderung: 03.02.2013 12:57
 
03.02.2013 13:40
#6
OldLodgeSkins
Joomshopping forum user no avatar
Name: Seb
13.02.2012
Posts: 18
Quote
Aw: PayPal / not finished (one more...)

Apparently I've got the string "INVALID" inside of $res - here is what it was containing:

Connection: close
Content-Length: 7
Date: Sun, 03 Feb 2013 12:32:33 GMT
Content-Type: text/html; charset=UTF-8
Strict-Transport-Security: max-age=14400
Strict-Transport-Security: max-age=14400
X-Frame-Options: SAMEORIGIN
HTTP/1.1 200 OK
INVALID

Set-Cookie:
aksession=1359895053~id=cookieVtcd0CLfxq364yqiUFiiaR2sMGSjITRWqJNquBaNPY94Y8ei7ILuMpAoGQfdtdCp/dMrNEAFfhNbL3VrTbzLzsx3vATnkeCg27LCIO/EA1NfJWWf8EnjT/cMKRCtmxua;
expires=Sun, 03-Feb-2013 12:37:33 GMT; path=/; domain=.paypal.com
Set-Cookie:
TSe9a623=91e1bfde38d4fef34aa65d37323d3094e8abffadeeacf6e5510e58e1a0e245893f1d86d9634137d16081497ffaa6df6385ae782bba64fcf83ecccf34b4608ba7a73d2ff0318f6e136a7cddb1b4608ba73b777707;
Path=/
Set-Cookie: Apache=10.73.8.45.1359894753162339; path=/; expires=Tue,
27-Jan-43 12:32:33 GMT
Set-Cookie:
X-PP-SILOVER=773171ffd3ead328a3fd20d7a015ffd5863af7429974993dd69e6a4c8f549f5b9e95be448d7252811404caa6a760a5ea3236d2bbad9ba6ca8a0ec9ffc26954df078f10ae93c52237820849dd92ef35d57fa1b8fe3149a2366eb790d531d6a5ef135389b2a6bba958a9a99c1833c67f8c
Set-Cookie: navlns=0.0; expires=Sat, 29-Jan-2033 12:32:33 GMT;
domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.73.8.134.1359894753168726; path=/; expires=Tue,
27-Jan-43 12:32:33 GMT
Set-Cookie: cookie_check=yes; expires=Wed, 01-Feb-2023 12:32:33 GMT;
domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/;
Secure; HttpOnly
Set-Cookie:
cwrClyrK4LoCV1fydGbAxiNL6iG=K4KjZrm-R_XfSdRXkwn1txnKs5smlJNi_dyUTadTH4PVSI030PI-syirJFtFLoCwKVwprjzTWiQ_Gb9exuUoCZdUrRCaq3gl2WccIwGghmW24RhhBdJ5S4zvXAW%7c5oTf9UZ5_zQlCsHlIrVaOprlz09wi7mSgBR64zxrn-6S2cN30XNLJVnRmHWdJsGnaw0kqm%7ceN1eepTQe2oRQhiHPPy9tNlaSpzmt4v2qOhNrXzTBGQOt4yoDb7vMHSCk56fbm_KdSOlFG%7c1359894753;
domain=.paypal.com; path=/; Secure; HttpOnly


As this is $req - for another payment, I've just added it (with the e-mail addresses blanked out for privacy):


cmd=_notify-validate&transaction_subject=34&payment_date=04%3A46%3A33+Feb+03%2C+2013+PST&txn_type=web_accept&last_name=Cismondo&residence_country=FR&item_name=Order+number+00000157&payment_gross=1.00&mc_currency=USD&business=contact%40******.com&payment_type=instant&protection_eligibility=Ineligible&verify_sign=AVb2IXaPCfAKEHflCw5VpE8U0tpfAFKZhlZz5LbjIc1tMUcOtMhoUjA7&payer_status=unverified&tax=0.00&payer_email=******%40gmail.com&txn_id=5JF21596757473029&quantity=1&receiver_email=contact%40******.com&first_name=&payer_id=NVG32QW47EB6Q&receiver_id=4RDHEFJY7YL3N&item_number=&handling_amount=0.00&payment_status=Completed&payment_fee=0.33&mc_fee=0.33&shipping=0.00&mc_gross=1.00&custom=34&charset=windows-1252&notify_version=3.7&ipn_track_id=8eb0e54218ef



Letzte Änderung: 03.02.2013 13:52
 
03.02.2013 14:01
#7
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: PayPal / not finished (one more...)

I can not understand what the problem is
All correctly transmitted.

Try sendbox.paypal


pending_reason=unilateral - means that the email address of the payment recipient has not been registered with PayPal.


Letzte Änderung: 03.02.2013 14:04
 
03.02.2013 14:10
#8
OldLodgeSkins
Joomshopping forum user no avatar
Name: Seb
13.02.2012
Posts: 18
Quote
Aw: PayPal / not finished (one more...)

The behavior with the sandbox is different as the orders do not get the "not finished" status they simply remain "pending"... Which is a problem I have always had with the sandbox.
The "not finished" problem only occurs with live payments.

Am I correct in thinking that the function I quoted above is intended to verify that the IPN notification that's been received is legit? If so it would mean the problem occurs when comparing the data between what's been received (contained in $req, right?) and what PayPal has on file (read through fsockopen).

 
03.02.2013 15:36
#9
OldLodgeSkins
Joomshopping forum user no avatar
Name: Seb
13.02.2012
Posts: 18
Quote
Aw: PayPal / not finished (one more...)

I think I know the answer now.

A friend of mine just made a test order and... Everything went fine! The order switched to "PAID" automatically.

I'm thinking the problem was due to the new PayPal account I created for my testing. It is unverified (not linked to any bank account or credit card) and this is most likely why PayPal was replying "invalid".
So next time someone reports a similar problem you might want to notify them about this...

Seb.

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.