Payment Module Error
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Payment Module Error
Hi;
I am using 1.0.8.14.
I am using a Indian payment gateway in form of a payment module. And I am getting a redirected to login page after a successful payment transaction or a failed payment transaction.
It does create the order on the backend server but on customer side always redirects to login page.
My redirect URL is
$GLOBALS['Linker']->build('checkout_process.php');
On cancel URL it redirects to
$GLOBALS['Linker']->build('checkout_payment.php');
I tested by clicking cancel payemnt on a order- I checked response in Chrome developer too it shows a 302 checkout_payment redirect from the gateway and hence returns back to login.php instead with 200.
Can you please help me find the issue as not able to figure out what exactly happens?
What further details are required please let me know so shall I provide.
Thank you so much in advance
I am using 1.0.8.14.
I am using a Indian payment gateway in form of a payment module. And I am getting a redirected to login page after a successful payment transaction or a failed payment transaction.
It does create the order on the backend server but on customer side always redirects to login page.
My redirect URL is
$GLOBALS['Linker']->build('checkout_process.php');
On cancel URL it redirects to
$GLOBALS['Linker']->build('checkout_payment.php');
I tested by clicking cancel payemnt on a order- I checked response in Chrome developer too it shows a 302 checkout_payment redirect from the gateway and hence returns back to login.php instead with 200.
Can you please help me find the issue as not able to figure out what exactly happens?
What further details are required please let me know so shall I provide.
Thank you so much in advance
- burt
- Core Team
- Posts: 4551
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Payment Module Error
If something redirects back to login.php when it should not, then the customer session is not active.
You need to find out why your customer session is lost.
You need to find out why your customer session is lost.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Payment Module Error
You could try turning down the xs-cookie (samesite) permissions from the default Lax to None: https://github.com/CE-PhoenixCart/Phoen ... re.php#L29
Another alternative is to turn the admin > Sessions > Force Cookie Use to False. May also require setting the SID manually if not already defined.
OrBeyond that, I don't have more to say than Burt's suggestion of figuring out why it is dropping the session. Those are my three thoughts on how the session might be getting lost.
Another alternative is to turn the admin > Sessions > Force Cookie Use to False. May also require setting the SID manually if not already defined.
Or
Code: Select all
$GLOBALS['Linker']->build('checkout_process.php')->set_parameter(session_name(), session_id());- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Payment Module Error
I have seen the same problem on OSC 2.3.3, PhoenixCart 1.0.4.0 and PhoenixCart 1.0.7.12.
There it happened on Mobile if someone used an app to pay and were returned in another browser than the one they came to the app from.
I hope this can help you find the problem in case the changes mentioned above does not help.
//Daniel
There it happened on Mobile if someone used an app to pay and were returned in another browser than the one they came to the app from.
I hope this can help you find the problem in case the changes mentioned above does not help.
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Payment Module Error
Hi dear;ecartz wrote: ↑Wed May 11, 2022 8:40 am You could try turning down the xs-cookie (samesite) permissions from the default Lax to None: https://github.com/CE-PhoenixCart/Phoen ... re.php#L29
Another alternative is to turn the admin > Sessions > Force Cookie Use to False. May also require setting the SID manually if not already defined.
OrBeyond that, I don't have more to say than Burt's suggestion of figuring out why it is dropping the session. Those are my three thoughts on how the session might be getting lost.Code: Select all
$GLOBALS['Linker']->build('checkout_process.php')->set_parameter(session_name(), session_id());
Thank you so much it worked like a charm now all works well with this change to the URL
Code: Select all
$GLOBALS['Linker']->build('checkout_process.php')->set_parameter(session_name(), session_id());Very Warm Regds./
radhavallabh
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Payment Module Error
Fixed the issue I just quoted previously so removed it from here sorry for the trouble.....ecartz wrote: ↑Wed May 11, 2022 8:40 am You could try turning down the xs-cookie (samesite) permissions from the default Lax to None: https://github.com/CE-PhoenixCart/Phoen ... re.php#L29
Another alternative is to turn the admin > Sessions > Force Cookie Use to False. May also require setting the SID manually if not already defined.
OrBeyond that, I don't have more to say than Burt's suggestion of figuring out why it is dropping the session. Those are my three thoughts on how the session might be getting lost.Code: Select all
$GLOBALS['Linker']->build('checkout_process.php')->set_parameter(session_name(), session_id());
Dear @ecartz please help with below
When I try delete a order from admin below error is thrown-
Fatal error: Uncaught Error: Call to undefined method order::remove() in /xx/admin/includes/actions/orders/delete_confirm.php:15 Stack trace: #0 /xx/admin/includes/segments/process_action.php(19): require() #1 /xx/admin/orders.php(16): require('/hermes/walnacw...') #2 {main} thrown in /xx/admin/includes/actions/orders/delete_confirm.php on line 15
Please help me dear,
Thank you in advance;
Regds,/
radhavallabh
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Payment Module Error
Do you have an order.php file in one of admin/includes/classes/, admin/includes/classes/override/, or includes/system/override/ ? If so, either delete it or add the remove function to it from https://github.com/CE-PhoenixCart/Phoen ... p#L46..L63
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Payment Module Error
Wow it worked perfectly dear!!!!ecartz wrote: ↑Wed May 11, 2022 1:20 pm Do you have an order.php file in one of admin/includes/classes/, admin/includes/classes/override/, or includes/system/override/ ? If so, either delete it or add the remove function to it from https://github.com/CE-PhoenixCart/Phoen ... p#L46..L63
Thank you so much....
@ecartz Please help me fix the checkout_payment_address.php error too dear as need to take my site live in full on production level this Friday, need to fix all bugs that I possibly find...
Re writing the issue here for your reference
When a customer tries to change the address on payment page below address is thrown-
Notice: Undefined index: company in xx/includes/modules/customer_data/cd_company.php on line 102
Fatal error: Uncaught TypeError: Argument 1 passed to Text::input() must be of the type string, null given, called in /xx/includes/modules/customer_data/cd_company.php on line 102 and defined in /xx/includes/system/versioned/1.0.8.2/text.php:34 Stack trace: #0 /xx/includes/modules/customer_data/cd_company.php(102): Text::input(NULL) #1 /xx/includes/system/versioned/1.0.5.6/requirements_manager.php(37): cd_company->process(Array) #2 /xx/includes/system/versioned/1.0.5.6/requirements_manager.php(65): requirements_manager->act_on(Object(cd_company), 'process', Array) #3 /xx/checkout_payment_address.php(29): requirements_manager->process(Array) #4 {main} thrown in /xx/includes/system/versioned/1.0.8.2/text.php on line 34
When I applied the fix you gave previously it starts to show the error for country_id which is next on the list....
Please help me fix the issue...
Thanking you in advance;
Regds./
radhavallabh
-
raiwa
- Certified Developer
- Posts: 1640
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Has thanked: 70 times
- Been thanked: 152 times
Re: Payment Module Error
Did you find a solution for this specific case?Kofod95 wrote: ↑Wed May 11, 2022 8:55 am I have seen the same problem on OSC 2.3.3, PhoenixCart 1.0.4.0 and PhoenixCart 1.0.7.12.
There it happened on Mobile if someone used an app to pay and were returned in another browser than the one they came to the app from.
I hope this can help you find the problem in case the changes mentioned above does not help.
//Daniel
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Payment Module Error
I hooked a check in on checkout_process, that caught the order_id from the URL and recreated the customers' session from that before the file checks for log-in.
//Daniel
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide