Page 1 of 1

PayPal IPN / Auto Return

Posted: Fri Jun 25, 2021 4:16 pm
by philpla
phoenix v1.0.8.4
PayPal Payments Standard Module v5.018 (sandbox)

Hello @all

I have Problem with the Auto Return process for paypal standart modul.
After sucessfull payment, the customer is auto return to .../checkout_process.php. But then he is not forwarded to checkout_success.php, instead he is forwarded to login.php. But anyway he is STILL logged in to the store.

Code: Select all

shop.XXX.de:443 19XXXX47 - - [25/Jun/2021:17:56:21 +0200] "POST /checkout_process.php HTTP/1.1" 302 5475 "https://www.sandbox.paypal.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0"
shoXXXde:443 1XXXX7 - - [25/Jun/2021:17:56:21 +0200] "GET /login.php HTTP/1.1" 200 5872 "https://www.sandbox.paypal.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0"
additionaly the IPN call produces

Code: Select all

[Fri Jun 25 17:55:54.877837 2021] [fcgid:warn] [pid 18026] [client 173.0.80.116:3727] mod_fcgid: stderr: PHP Notice:  Undefined index: pending_reason in /vaXXXXXXXXle/includes/modules/payment/paypal_standard.php on line 609
[Fri Jun 25 17:55:54.877909 2021] [fcgid:warn] [pid 18026] [client 173.0.80.116:3727] mod_fcgid: stderr: PHP Notice:  Undefined variable: customer in /var/cuXXXXXXyle/ext/modules/payment/paypal/standard_ipn.php on line 62
[Fri Jun 25 17:55:54.877914 2021] [fcgid:warn] [pid 18026] [client 173.0.80.116:3727] mod_fcgid: stderr: PHP Notice:  Undefined index: comments in /vaXXXXXXXyle/includes/system/segments/checkout/insert_history.php on line 18

shoXXXXXe:443 173.0.80.116 - - [25/Jun/2021:17:55:53 +0200] "POST /ext/modules/payment/paypal/standard_ipn.php?language=de HTTP/1.1" 200 5757 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
any help why variable: customer is undefined would be very nice. thx @all

Re: PayPal IPN / Auto Return

Posted: Fri Jun 25, 2021 4:29 pm
by ecartz
You could try it with

Code: Select all

    if (!isset($customer) || !($customer instanceof customer) || ($customer_id != $customer->get_id())) {
at line 62 of ext/modules/payment/paypal/standard_ipn.php

Re: PayPal IPN / Auto Return

Posted: Fri Jun 25, 2021 4:50 pm
by philpla
ecartz wrote: Fri Jun 25, 2021 4:29 pm You could try it with

Code: Select all

    if (!isset($customer) || !($customer instanceof customer) || ($customer_id != $customer->get_id())) {
at line 62 of ext/modules/payment/paypal/standard_ipn.php
thx @ecartz ... i changed this line ... same result:

Code: Select all

==> /vaXXXXle.de-error.log <==
[Fri Jun 25 18:41:56.761577 2021] [fcgid:warn] [pid 21855] [client 173.0.80.117:42642] mod_fcgid: stderr: PHP Notice:  Undefined index: pending_reason in /vaXXXXXXyle/includes/modules/payment/paypal_standard.php on line 609
[Fri Jun 25 18:41:56.761649 2021] [fcgid:warn] [pid 21855] [client 173.0.80.117:42642] mod_fcgid: stderr: PHP Notice:  Undefined index: comments in /vaXXXXXtyle/includes/system/segments/checkout/insert_history.php on line 18
[Fri Jun 25 18:41:56.761655 2021] [fcgid:warn] [pid 21855] [client 173.0.80.117:42642] mod_fcgid: stderr: PHP Warning:  session_destroy(): Trying to destroy uninitialized session in /vaXXXXXXle/includes/system/versioned/1.0.8.3/session.php on line 64

==> /vXXXXXXXcess.log <==
shoXXXXXXe.de:443 173.0.80.117 - - [25/Jun/2021:18:41:55 +0200] "POST /ext/modules/payment/paypal/standard_ipn.php?language=de HTTP/1.1" 200 5549 "-" "PayPal IPN ( https://www.paypal.com/ipn )"
shoXXXXXde:443 19XXXXX47 - - [25/Jun/2021:18:42:26 +0200] "POST /checkout_process.php HTTP/1.1" 302 5475 "https://www.sandbox.paypal.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0"
shXXXXe:443 19XXXXX7 - - [25/Jun/2021:18:42:26 +0200] "GET /login.php HTTP/1.1" 200 5852 "https://www.sandbox.paypal.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0"
shXXXXe:443 1XXXXX7 - - [25/Jun/2021:18:42:26 +0200] "GET /images/thumbs/250_250/Schmuckst%C3%A4nder_031_001_1200_V1.png HTTP/1.1" 200 59590 "htXXXXXde/login.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0"
in the Backend log of payal i see the IPN call, this data looks good, but in "row customer" is also "guest" mentioned, maybe this information helps

i dont know where "to dig deeper" :?:

Re: PayPal IPN / Auto Return

Posted: Wed Jun 30, 2021 11:44 pm
by MyGamesShop
Phoenix 1.0.8.5 @ 7a8144f

Sale does not go thru and paypal express checkout returns to a blank page:-

"https://www.BLAHBLAH.com.au/ext/modules ... VTDUZFTDCA"

I have no input to Paypal site : Edit Instant Payment Notification (IPN) settings
What goes in there?

Auto-return is set to on :- https://www.BLAHBLAH.com.au/checkout_process.php

Payment data transfer (optional) :on and filled.

.From Error Log.

AH01071: Got error 'PHP message: PHP Notice: Undefined index: name in /ext/modules/payment/paypal/express.php on line 46PHP message: PHP Notice: Undefined index: iso_code_2 in /ext/modules/payment/paypal/express.php on line 47PHP message: PHP Notice: Undefined index: iso_code_3 in /ext/modules/payment/paypal/express.php on line 48PHP message: PHP Notice: Undefined index: format_id in /ext/modules/payment/paypal/express.php on line 49PHP message: PHP Notice: Undefined property: shoppingCart::$cartID in /ext/modules/payment/paypal/express.php on line 60PHP message: PHP Fatal error: Uncaught Error: Call to a member function fetch_to_address() on null in /includes/system/versioned/1.0.7.10/cart_order_builder.php:79\nStack trace:\n#0 /includes/system/versioned/1.0.7.10/cart_order_builder.php(163): cart_order_builder->build_addresses()\n#1 /includes/system/versioned/1.0.7.10/order.php(25): cart_order_builder::build()\n#2 /ext/modules/payment/paypal/express.php(155): order->__construct()\n#3 {main}\n thrown in /includes/system/versioned/1.0.7.10/cart_order_builder.php on line 79'

AH01071: Got error 'PHP message: PHP Notice: Undefined index: PAYMENTREQUEST_0_SHIPTOSTREET2 in /ext/modules/payment/paypal/express.php on line 393PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Text::input() must be of the type string, null given, called in /includes/functions/database.php on line 75 and defined in /includes/system/versioned/1.0.8.2/text.php:34\nStack trace:\n#0 /includes/functions/database.php(75): Text::input()\n#1 /ext/modules/payment/paypal/express.php(393): tep_db_prepare_input()\n#2 {main}\n thrown in /includes/system/versioned/1.0.8.2/text.php on line 34', referer: https://www.sandbox.paypal.com/

This is allmost a vanilla install localised to Australia:

Ran this script through phpMyAdmin.

-- Tables affected:
-- address_format;
-- countries;
-- zones;
-- geo_zones;
-- zones_to_geo_zones;
-- tax_rates;
-- tax_class;

DELETE FROM address_format;

-- Data based on that provided with v 2.3.4 installation, and added formats 6 to 10.
INSERT INTO address_format (address_format_id, address_format, address_summary) VALUES
(1, '$name$cr$streets$cr$city, $postcode$cr$statecomma$country','$city / $country'),
(2, '$name$cr$streets$cr$city, $state $postcode$cr$country', '$city, $state / $country'),
(3, '$name$cr$streets$cr$city$cr$postcode - $statecomma$country', '$state / $country'),
(4, '$name$cr$streets$cr$city ($postcode)$cr$country', '$postcode / $country'),
(5, '$name$cr$streets$cr$postcode $city$cr$country', '$city / $country'),
(6, '$name$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city $country'),
(7, '$name$cr$streets$cr$city,$cr$state$cr$postcode$cr$country', '$city, $state / $country'),
(8, '$name$cr$streets$cr$city$cr$postcode $country', '$country / $postcode'),
(9, '$name$cr$streets$cr$city $state $postcode$cr$country', '$city / $country'),
(10, '$name$cr$streets$cr$postcode $city$cr$country', '$city / $country');

-- Select a small set of reasonable countries
DELETE FROM countries;
INSERT INTO countries (countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) VALUES
(13, 'Australia', 'AU', 'AUS', 6),
(153, 'New Zealand', 'NZ', 'NZL', 1),
(96, 'Hong Kong', 'HK', 'HKG', 1),
(222, 'United Kingdom', 'GB', 'GBR', 7),
(223, 'United States', 'US', 'USA', 2),
(38, 'Canada', 'CA', 'CAN', 2),
(81, 'Germany', 'DE', 'DEU', 5),
(203, 'Sweden', 'SE', 'SWE', 5),
(103, 'Ireland', 'IE', 'IRL', 9),
(188, 'Singapore', 'SG', 'SGP', 7),
(150, 'Netherlands', 'AN', 'NLD', 11),
(221, 'United Arab Emirates', 'AE', 'ARE', 6);

-- Add Australian states
DELETE FROM zones;
INSERT INTO zones (zone_id, zone_country_id, zone_code, zone_name) VALUES
(1, 13, 'VIC', 'Victoria'),
(2, 13, 'NSW', 'New South Wales'),
(3, 13, 'QLD', 'Queensland'),
(4, 13, 'SA', 'South Australia'),
(5, 13, 'NT', 'Northern Territory'),
(6, 13, 'TAS', 'Tasmania'),
(7, 13, 'ACT', 'Australian Capital Territory'),
(8, 13, 'WA', 'Western Australia');

-- Create zones for AU GST, overseas, and one for NZ (useful for shipping)
DELETE FROM geo_zones;
INSERT INTO geo_zones (geo_zone_id, geo_zone_name, geo_zone_description, last_modified, date_added) VALUES
(1, 'Australia', 'GST within Australia', NOW(), NOW()),
(2, 'Outside Australia', 'Outside Australia', NOW(), NOW()),
(3, 'New Zealand', 'New Zealand', NOW(), NOW());

DELETE FROM zones_to_geo_zones;
INSERT INTO zones_to_geo_zones (
association_id, zone_country_id, zone_id, geo_zone_id, last_modified, date_added) VALUES
(1, 13, NULL, 1, NOW(), NOW() ),
(2, 153, 0, 3, NOW(), NOW() ),
(3, 96, 0, 2, NOW(), NOW() ),
(4, 222, 0, 2, NOW(), NOW() ),
(5, 223, 0, 2, NOW(), NOW() ),
(6, 38, 0, 2, NOW(), NOW() ),
(7, 81, 0, 2, NOW(), NOW() ),
(8, 203, 0, 2, NOW(), NOW() ),
(9, 103, 0, 2, NOW(), NOW() ),
(10, 188, 0, 2, NOW(), NOW() ),
(11, 150, 0, 2, NOW(), NOW() ),
(12, 221, 0, 2, NOW(), NOW() );

DELETE FROM tax_rates;
INSERT INTO tax_rates (tax_rates_id, tax_zone_id, tax_class_id, tax_priority, tax_rate, tax_description, last_modified, date_added) VALUES
(1, 1, 1, 1, 10.0000, 'GST', NOW(), NOW());

DELETE FROM tax_class;
INSERT INTO tax_class (tax_class_id, tax_class_title, tax_class_description, last_modified, date_added) VALUES
(1, 'Taxable Goods', 'The following types of products are included non-food, services, etc', NOW(), NOW()),
(2, 'GST free','GST free goods eg. unprocessed food.',NOW(),NOW());



And
both English.php edited to

setlocale(LC_ALL, ['en_AU.UTF-8', 'en_AU.UTF8', 'ena_au']);
and
const LANGUAGE_CURRENCY = 'AUD';

Any ideas?

Re: PayPal IPN / Auto Return

Posted: Sat Jul 03, 2021 1:31 pm
by MyGamesShop
Still having this problem with CE Phoenix v1.0.8.5

PayPal Payments Standard returns to the login page, client logged out, payment not received, cart emptied.

Paypal Express returns to a blank page (https://www.BLAHBLAH.com.au/ext/modules ... VTDUZFTDCA)
(client is not logged out) as above, but can complete the transaction if client clicks on the checkout and continues thru.

These two errors from the log:

AH01071: Got error 'PHP message: PHP Notice: Undefined index: PAYMENTREQUEST_0_SHIPTOSTREET2 in /ext/modules/payment/paypal/express.php on line 393PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Text::input() must be of the type string, null given, called in /includes/functions/database.php on line 75 and defined in /includes/system/versioned/1.0.8.2/text.php:34\nStack trace:\n#0 /web/includes/functions/database.php(75): Text::input()\n#1 /ext/modules/payment/paypal/express.php(393): tep_db_prepare_input()\n#2 {main}\n thrown in /includes/system/versioned/1.0.8.2/text.php on line 34', referer: https://www.sandbox.paypal.com/

AH01071: Got error 'PHP message: PHP Notice: Trying to access array offset on value of type null in /includes/system/versioned/1.0.7.3/shopping_cart.php on line 113PHP message: PHP Notice: Trying to access array offset on value of type null in web/includes/system/versioned/1.0.7.other/1.0.7.12/product_builder.php on line 98'

Also

AH01071: Got error 'PHP message: PHP Notice: Undefined variable: customer in /ext/modules/payment/paypal/standard_ipn.php on line 62PHP message: PHP Notice: Undefined index: comments in web/includes/system/segments/checkout/insert_history.php on line 18'

Mark.

Re: PayPal IPN / Auto Return

Posted: Tue Jul 06, 2021 11:13 am
by MyGamesShop
Seems to be a sandbox issue as a customer completed a transaction in-store and it auto returned...

Yay!

Re: PayPal IPN / Auto Return

Posted: Mon Jul 12, 2021 2:43 am
by MyGamesShop
BTW I had to do this as well.

viewtopic.php?f=10&t=551

Otherwise it would not return to site,, and if Paypal express selected without an existing customer record the customer was unable to see and edit in Admin.

Mark