peterespana Posted September 13, 2019 Share Posted September 13, 2019 It does not come to any error at all... So the error occurs before Stripe is reached..... Quote Link to comment Share on other sites More sharing options...
mhsuffolk Posted September 13, 2019 Share Posted September 13, 2019 Forgive me if you have done this already. Are you using version 1.0.5 from here. https://apps.oscommerce.com/Get&EbCL1&fKidG There should be six boxes in admin where keys have to be added, and they are all different, earlier versions had less. Quote Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
peterespana Posted September 13, 2019 Share Posted September 13, 2019 Yes I did,. It has 3 fields for the live module and another 3 for the test module. I made webhooks for live and test. Filled al 6 keys in. I tried both, but always the same error when I try to make a payment. Thanks so much for your help! Quote Link to comment Share on other sites More sharing options...
mhsuffolk Posted September 13, 2019 Share Posted September 13, 2019 The developer @asro2004 is in New Zealand. He is normally active on the forums early morning UK time. I am sure he will have some ideas. Quote Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
peterespana Posted September 13, 2019 Share Posted September 13, 2019 Ok, thanks, I tried many things, but nothing seems to work. Hopefully he knows something. Regards Peter Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted September 13, 2019 Share Posted September 13, 2019 @asro2004, Tested v. 1.0.5 and all fine. It seems I found an easy fix for the discount module which should also work for all other third party order total modules: in stripe_sca.php line 127 add "order_total_modules->process();" function confirmation() { global $oscTemplate, $cartID, $cart_Stripe_SCA_ID, $customer_id, $languages_id, $order, $currencies, $currency, $stripe_payment_intent_id, $order_total_modules; $order_total_modules->process(); Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted September 13, 2019 Share Posted September 13, 2019 I do not get the order confirmation mails with the stripe sca module. I checked and I get it with the other payment module (PayPal express) I'm using. I also checked with different languages including the original english language file, and the same, no order confirmation mail is sent. Anybody else exprerience the same problem or do I need to analyse my store? Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
mhsuffolk Posted September 13, 2019 Share Posted September 13, 2019 No problem with confirmation emails here. raiwa 1 Quote Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
♥raiwa Posted September 13, 2019 Share Posted September 13, 2019 15 minutes ago, mhsuffolk said: No problem with confirmation emails here. Thanks, I'll check, must be something in my store then. You are using v 1.0.5? Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
mhsuffolk Posted September 13, 2019 Share Posted September 13, 2019 2 minutes ago, raiwa said: You are using v 1.0.5? Yes v1.0.5 raiwa 1 Quote Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
Mikepo Posted September 13, 2019 Share Posted September 13, 2019 12 hours ago, asro2004 said: insert a <style> block before the <script src="https://js.stripe.com/v3/"></script> line at line 861 in includes/modules/payment/stripe_sca.php @asro2004, I added the <style> block at the location specified, but it didn't work. So I added the code to the user.css. Now it works. Why? I don't know. Just thought I would pass on the issue/solution. Quote osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!) Link to comment Share on other sites More sharing options...
asro2004 Posted September 13, 2019 Author Share Posted September 13, 2019 @MikepoNot sure about that, I thought it might be a phoenix thing because I had only tested with an older version, but I just retested with Phoenix 1.02 and it works there. Could it be some custom theme you have for your store that is getting in the way? Quote Link to comment Share on other sites More sharing options...
asro2004 Posted September 13, 2019 Author Share Posted September 13, 2019 @peterespana, the error relates to the 'client secret' that is generated by stripe when the payment intent is created. In this module, that is in the includes/modules/payment/stripe_sca.php code, around line 375. It checks if it has a global stripe intent id set, which it would if the customer had made changes to the cart or other order details, in which case it retrieves the intent created when the customer first got to the page, and updates it with the current amount, currency and billing details in case any has changed. If it's the first time to the page, a new payment intent is created. In either case, the Stripe API returns a payment intent object that includes a new 'client secret' id that has to be put in the payment form, for the javascript code to use to link the card details entered by the customer with the store so the store can be informed of the payment result via the web hook. It sounds like it is not getting a successful payment intent created. I'd suggest turning on the 'log events' in the module configuration, retrying the payment, and then check the stripe_event_log' table. You should see a row with the action, 'page create intent', and the response field should contain a message indicating the problem. Quote Link to comment Share on other sites More sharing options...
asro2004 Posted September 13, 2019 Author Share Posted September 13, 2019 @raiwaI think the email problem may be in the $OSCOM_Hooks call immediately prior to generating the email. If there was a PHP error in there, that would stop it sending the customer email. I'll add the '$order_total_modules->process();' to the next release. You should find the card prompts have been fixed in 1.0.5. raiwa 1 Quote Link to comment Share on other sites More sharing options...
peterespana Posted September 14, 2019 Share Posted September 14, 2019 5 hours ago, asro2004 said: @peterespana, the error relates to the 'client secret' that is generated by stripe when the payment intent is created. In this module, that is in the includes/modules/payment/stripe_sca.php code, around line 375. It checks if it has a global stripe intent id set, which it would if the customer had made changes to the cart or other order details, in which case it retrieves the intent created when the customer first got to the page, and updates it with the current amount, currency and billing details in case any has changed. If it's the first time to the page, a new payment intent is created. In either case, the Stripe API returns a payment intent object that includes a new 'client secret' id that has to be put in the payment form, for the javascript code to use to link the card details entered by the customer with the store so the store can be informed of the payment result via the web hook. It sounds like it is not getting a successful payment intent created. I'd suggest turning on the 'log events' in the module configuration, retrying the payment, and then check the stripe_event_log' table. You should see a row with the action, 'page create intent', and the response field should contain a message indicating the problem. This is the log that appears: ID req_LWmdlGmOiCG4W6 Time 9/14/19, 7:01:22 AM Method POST URL /v1/payment_intents/pi_1FITLjK4kydItoIjO Status 200 IP address 81.169.144.135 Version 2018-05-21 Source Stripe/v1 PhpBindings/6.43.0 Related payment_intent Thanks!! Peter Quote Link to comment Share on other sites More sharing options...
mhsuffolk Posted September 14, 2019 Share Posted September 14, 2019 Oops, another bug. In test mode if I try to save a card whilst checking out it hangs. The order appears in admin in preparing status and I get this in the servers error log. [14-Sep-2019 07:22:01 Europe/London] PHP Fatal error: Uncaught Stripe\Error\InvalidRequest: No such payment_intent: pi_xxxxxxxxxxxx; a similar object exists in test mode, but a live mode key was used to make this request. in /home/*******/public_html/includes/modules/payment/stripe_sca/lib/ApiRequestor.php:210 from API request 'req_*************' Stack trace: #0 /home/******/public_html/includes/modules/payment/stripe_sca/lib/ApiRequestor.php(173): Stripe\ApiRequestor::_specificAPIError('{\n "error": {\n...', 404, Object(Stripe\Util\CaseInsensitiveArray), Array, Array) #1 /home/*******/public_html/includes/modules/payment/stripe_sca/lib/ApiRequestor.php(473): Stripe\ApiRequestor->handleErrorResponse('{\n "error": {\n...', 404, Object(Stripe\Util\CaseInsensitiveArray), Array) #2 /home/*******/public_html/includes/modules/payment/stripe_sca/lib/ApiRequestor.php(126): Stripe\ApiRequestor->_interpretResponse('{\n "error": {\n...', 404, Object(Stripe\Util\CaseInsensitiveArray)) #3 /home/********/public_html/includes/modules/payment/stripe_sca/lib/ApiResource.ph in /home/mhunt/public_html/includes/modules/payment/stripe_sca/lib/ApiRequestor.php on line 210 I have not tested in live mode but possibly the reverse error would exist. Also I have not yet tried to use a stored card. Quote Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
♥raiwa Posted September 14, 2019 Share Posted September 14, 2019 (edited) 8 hours ago, asro2004 said: @raiwaI think the email problem may be in the $OSCOM_Hooks call immediately prior to generating the email. If there was a PHP error in there, that would stop it sending the customer email. I checked with the discount hook commented out and the same, no order mails. I also observed that no order status history is saved to the database. Order status stays in "Preparing [Stripe SCA]" and order status history is empty. I had a look and found that the Secret Key constant has not been updated in the webhook and payment_intent. It is still "MODULE_PAYMENT_STRIPE_SCA_SECRET_KEY". I changed it in payment_intent.php to: // supply an API key $secret_key = MODULE_PAYMENT_STRIPE_SCA_TRANSACTION_SERVER == 'Live' ? MODULE_PAYMENT_STRIPE_SCA_LIVE_SECRET_KEY : MODULE_PAYMENT_STRIPE_SCA_TEST_SECRET_KEY; \Stripe\Stripe::setApiKey($secret_key); and in webhook.php line 55-56 to: $secret_key = MODULE_PAYMENT_STRIPE_SCA_TRANSACTION_SERVER == 'Live' ? MODULE_PAYMENT_STRIPE_SCA_LIVE_SECRET_KEY : MODULE_PAYMENT_STRIPE_SCA_TEST_SECRET_KEY; \Stripe\Stripe::setApiKey($secret_key); But no luck, still no order mail and no order status history. I guess that @mhsuffolk and others which have it correct working have still the old stripe module installed with the old constant defined. It seems there is still some bug in the process_payment or update_order_status functions. Any idea where to check else? rgds Rainer Edited September 14, 2019 by raiwa Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
mhsuffolk Posted September 14, 2019 Share Posted September 14, 2019 1 minute ago, raiwa said: which have it correct working have still the old stripe module installed with the old constant defined Yes, that could be the problem. I have the old module installed but turned off. Quote Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
♥raiwa Posted September 14, 2019 Share Posted September 14, 2019 (edited) 9 hours ago, asro2004 said: @raiwaI think the email problem may be in the $OSCOM_Hooks call immediately prior to generating the email. If there was a PHP error in there, that would stop it sending the customer email. Sorry, forgot this: The discount code hook condition should be secured like this: if (defined('MODULE_ORDER_TOTAL_DISCOUNT_STATUS') && (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true' || MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'True') && file_exists(DIR_FS_CATALOG . 'includes/hooks/shop/checkout_process/discount_code.php') { In the older versions lower case 'true' is used, in the Phoenix version I updated to upper case 'True' to match other modules. Edited September 14, 2019 by raiwa Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted September 14, 2019 Share Posted September 14, 2019 35 minutes ago, mhsuffolk said: Yes, that could be the problem. I have the old module installed but turned off. Sorry, I was wrong. The old module uses "MODULE_PAYMENT_STRIPE_SECRET_KEY", the first versions of the new module were using "MODULE_PAYMENT_STRIPE_SCA_SECRET_KEY". The newer versions are using "MODULE_PAYMENT_STRIPE_SCA_LIVE_SECRET_KEY" and "MODULE_PAYMENT_STRIPE_SCA_TEST_SECRET_KEY". So the explanation may be that you @mhsuffolk, didn't uninstall the module before updating to the version which uses both live and test constants. Like this the old constant "MODULE_PAYMENT_STRIPE_SCA_SECRET_KEY" stays in the database. Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
mhsuffolk Posted September 14, 2019 Share Posted September 14, 2019 (edited) Yes my database still contains MODULE_PAYMENT_STRIPE_SCA_SECRET_KEY but it has the correct live key stored. I have tried your modifications in payment_intent.php and webhook.php. Now it does not produce that error in the server log, the transaction completes and is stored in the database, but the card is not saved. Webhook comes back with a 500 error in Stripes dashboard logs. Edited September 14, 2019 by mhsuffolk Quote Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
♥raiwa Posted September 14, 2019 Share Posted September 14, 2019 @mhsuffolk, OK, thanks for confirming. Then let's see what the author @asro2004 says about. He will better know how to further debug this. mhsuffolk 1 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
asro2004 Posted September 14, 2019 Author Share Posted September 14, 2019 @raiwa, @mhsuffolk, @peterespana The hanging and failure to complete the transactions was due to the apiKey not being set correctly in payment_intent.php and webhook.php. It was only working for those who had installed the module before 1.0.5 because it was using the configuration key generated in the earlier release. I have re-tested by deleting the earlier configuraition keys and re-running transactions with new card with and without saving, and a saved card, and all seems ok now. I've updated the market place module with 1.0.6 Quote Link to comment Share on other sites More sharing options...
♥14steve14 Posted September 14, 2019 Share Posted September 14, 2019 (edited) Link to latest release version Latest version Is it a case that all the files in this latest release need to re-uploaded to the site or is it just the odd one or two. Upgrade instruction would be nice. Edited September 14, 2019 by 14steve14 Quote REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
mhsuffolk Posted September 14, 2019 Share Posted September 14, 2019 @14steve14 I believe it is just 3 ext/modules/payment/stripe_sca/payment_intent.php ext/modules/payment/stripe_sca/webhook.php includes/modules/payment/stripe_sca.php Quote Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.