alexminza / wc-moldovaagroindbank

WooCommerce maib Moldova Agroindbank Payment Gateway
https://wordpress.org/plugins/wc-moldovaagroindbank/
GNU General Public License v3.0
15 stars 3 forks source link

Order status "Pending Payment" though the transaction was completed succesfuly #16

Closed davidfilat closed 3 years ago

davidfilat commented 3 years ago

I setup the plugin correctly and the payments get through, but after a payment the user is redirected to the cart and the order's status is "Pending Payment", though it received a OK status code from the bank. What might be causing this problem?

alexminza commented 3 years ago

@davidfilat detailed logs would be helpful in this case.

davidfilat commented 3 years ago

Desigur:

Logs > 2021-05-14T20:41:43+00:00 INFO Plată inițiată prin Moldova Agroindbank: TRANSACTION_ID=J8fX8%2BF7HNK0s3Wag7GRO2UfVAo%3D > 2021-05-14T20:52:13+00:00 INFO Plată inițiată prin Moldova Agroindbank: TRANSACTION_ID=s4S1lQOwuokx3IrQSgQW%2B1hd6xU%3D > 2021-05-14T20:53:05+00:00 INFO Plată inițiată prin Moldova Agroindbank: TRANSACTION_ID=5kQrcFesmN2P3EDRd90JPiczUiw%3D > 2021-05-14T20:57:16+00:00 INFO Plată inițiată prin Moldova Agroindbank: TRANSACTION_ID=QP2VJgliESdTtWr0pl1pJ%2FBJ60k%3D > 2021-05-14T20:59:02+00:00 DEBUG Array > ( > [RESULT] => OK > [RESULT_CODE] => 500 > [FLD_074] => 0 > [FLD_075] => 0 > [FLD_076] => 1 > [FLD_077] => 0 > [FLD_086] => 0 > [FLD_087] => 0 > [FLD_088] => 17725 > [FLD_089] => 0 > ) > 2021-05-14T20:59:02+00:00 NOTICE Close business day via Moldova Agroindbank succeeded: RESULT=OK&RESULT_CODE=500&FLD_074=0&FLD_075=0&FLD_076=1&FLD_077=0&FLD_086=0&FLD_087=0&FLD_088=17725&FLD_089=0
Guzzle > [2021-05-14 20:41:43] maib_guzzle_request.INFO: [2021-05-14T20:41:43+00:00] "POST /ecomm2/MerchantHandler /" 200 {"request":"[object] (GuzzleHttp\\Message\\Request: POST /ecomm2/MerchantHandler HTTP/1.1\r\nHost: ecomm.maib.md:4455\r\nUser-Agent: Guzzle/5.3.1 curl/7.68.0 PHP/7.4.18\r\nContent-Length: 115\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\ncommand=v&amount=17725¤cy=498&client_ip_addr=93.115.7.238&description=Order+%2310014&language=ro&msg_type=SMS)","response":"[object] (GuzzleHttp\\Message\\Response: HTTP/1.1 200 OK\r\nContent-Type: text/html;charset=UTF-8\r\nDate: Fri, 14 May 2021 20:41:35 GMT\r\nX-FRAME-OPTIONS: SAMEORIGIN\r\nTransfer-Encoding: chunked\r\n\r\nTRANSACTION_ID: J8fX8+F7HNK0s3Wag7GRO2UfVAo=)"} [] > [2021-05-14 20:52:13] maib_guzzle_request.INFO: [2021-05-14T20:52:13+00:00] "POST /ecomm2/MerchantHandler /" 200 {"request":"[object] (GuzzleHttp\\Message\\Request: POST /ecomm2/MerchantHandler HTTP/1.1\r\nHost: ecomm.maib.md:4455\r\nUser-Agent: Guzzle/5.3.1 curl/7.68.0 PHP/7.4.18\r\nContent-Length: 114\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\ncommand=v&amount=1000¤cy=978&client_ip_addr=93.115.7.238&description=Order+%2310017&language=ro&msg_type=SMS)","response":"[object] (GuzzleHttp\\Message\\Response: HTTP/1.1 200 OK\r\nContent-Type: text/html;charset=UTF-8\r\nDate: Fri, 14 May 2021 20:52:06 GMT\r\nX-FRAME-OPTIONS: SAMEORIGIN\r\nTransfer-Encoding: chunked\r\n\r\nTRANSACTION_ID: s4S1lQOwuokx3IrQSgQW+1hd6xU=)"} [] > [2021-05-14 20:53:05] maib_guzzle_request.INFO: [2021-05-14T20:53:05+00:00] "POST /ecomm2/MerchantHandler /" 200 {"request":"[object] (GuzzleHttp\\Message\\Request: POST /ecomm2/MerchantHandler HTTP/1.1\r\nHost: ecomm.maib.md:4455\r\nUser-Agent: Guzzle/5.3.1 curl/7.68.0 PHP/7.4.18\r\nContent-Length: 114\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\ncommand=v&amount=1000¤cy=978&client_ip_addr=93.115.7.238&description=Order+%2310017&language=ro&msg_type=SMS)","response":"[object] (GuzzleHttp\\Message\\Response: HTTP/1.1 200 OK\r\nContent-Type: text/html;charset=UTF-8\r\nDate: Fri, 14 May 2021 20:52:58 GMT\r\nX-FRAME-OPTIONS: SAMEORIGIN\r\nTransfer-Encoding: chunked\r\n\r\nTRANSACTION_ID: 5kQrcFesmN2P3EDRd90JPiczUiw=)"} [] > [2021-05-14 20:57:16] maib_guzzle_request.INFO: [2021-05-14T20:57:16+00:00] "POST /ecomm2/MerchantHandler /" 200 {"request":"[object] (GuzzleHttp\\Message\\Request: POST /ecomm2/MerchantHandler HTTP/1.1\r\nHost: ecomm.maib.md:4455\r\nUser-Agent: Guzzle/5.3.1 curl/7.68.0 PHP/7.4.18\r\nContent-Length: 115\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\ncommand=v&amount=21394¤cy=498&client_ip_addr=93.115.7.238&description=Order+%2310018&language=ro&msg_type=SMS)","response":"[object] (GuzzleHttp\\Message\\Response: HTTP/1.1 200 OK\r\nContent-Type: text/html;charset=UTF-8\r\nDate: Fri, 14 May 2021 20:57:08 GMT\r\nX-FRAME-OPTIONS: SAMEORIGIN\r\nTransfer-Encoding: chunked\r\n\r\nTRANSACTION_ID: QP2VJgliESdTtWr0pl1pJ/BJ60k=)"} [] > [2021-05-14 20:59:02] maib_guzzle_request.INFO: [2021-05-14T20:59:02+00:00] "POST /ecomm2/MerchantHandler /" 200 {"request":"[object] (GuzzleHttp\\Message\\Request: POST /ecomm2/MerchantHandler HTTP/1.1\r\nHost: ecomm.maib.md:4455\r\nUser-Agent: Guzzle/5.3.1 curl/7.68.0 PHP/7.4.18\r\nContent-Length: 9\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\ncommand=b)","response":"[object] (GuzzleHttp\\Message\\Response: HTTP/1.1 200 OK\r\nContent-Type: text/html;charset=UTF-8\r\nDate: Fri, 14 May 2021 20:58:55 GMT\r\nX-FRAME-OPTIONS: SAMEORIGIN\r\nTransfer-Encoding: chunked\r\n\r\nRESULT: OK\nRESULT_CODE: 500\nFLD_074: 0\nFLD_075: 0\nFLD_076: 1\nFLD_077: 0\nFLD_086: 0\nFLD_087: 0\nFLD_088: 17725\nFLD_089: 0\n)"} []
davidfilat commented 3 years ago
Site Information > ### wp-core ### > > version: 5.7.2 > site_language: en_US > user_language: en_US > permalink: /%postname%/ > https_status: true > user_registration: 1 > default_comment_status: open > multisite: false > user_count: 389 > dotorg_communication: true > > ### wp-active-theme ### > parent_theme: Beaver Builder Theme (bb-theme) > theme_features: core-block-patterns, post-thumbnails, automatic-feed-links, title-tag, woocommerce, align-wide, wp-block-styles, html5, menus, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, widgets > > ### wp-parent-theme ### > > name: Beaver Builder Theme (bb-theme) > version: 1.7.8 (latest version: 1.7.9) > author: The Beaver Builder Team > author_website: http://www.wpbeaverbuilder.com/?utm_medium=bb-pro&utm_source=bb-theme&utm_campaign=themes-admin-page > > ### wp-themes-inactive (2) ### > > Storefront: version: 3.6.0, author: Automattic > Twenty Twenty-One: version: 1.3, author: the WordPress team > > ### wp-mu-plugins (2) ### > > Health Check Troubleshooting Mode: author: (undefined), version: 1.7.1 > Kinsta Must-use Plugins: version: 2.3.2, author: Kinsta Team > > ### wp-plugins-active (60) ### > > Admin Columns: version: 4.3, author: AdminColumns.com > Advanced Custom Fields Multilingual: version: 1.8.2, author: OnTheGoSystems > Advanced Custom Fields PRO: version: 5.9.5, author: Elliot Condon (latest version: 5.9.6) > Advanced Product Search For WooCommerce: version: 1.0.5, author: aThemeArt (latest version: 1.0.6) > Antispam Bee: version: 2.9.4, author: pluginkollektiv > Beaver Builder Plugin (Pro Version): version: 2.4.2.2, author: The Beaver Builder Team > Booster Plus for WooCommerce: version: 5.4.0, author: Pluggabl LLC > Classic Editor: version: 1.6, author: WordPress Contributors > Cloudflare: version: 4.4.0, author: Cloudflare, Inc. > Cyr-To-Lat: version: 5.0.4, author: Sergey Biryukov, Mikhail Kobzarev, Igor Gergel > Enable Media Replace: version: 3.5.0, author: ShortPixel > Health Check & Troubleshooting: version: 1.4.5, author: The WordPress.org community > Jetpack by WordPress.com: version: 9.7, author: Automattic > MonsterInsights - eCommerce Addon: version: 7.5.0, author: MonsterInsights Team > MonsterInsights - EU Compliance: version: 1.1.3, author: MonsterInsights Team > MonsterInsights - Google Optimize Addon: version: 1.3.2, author: MonsterInsights Team > MonsterInsights - Page Insights Addon: version: 1.3.3, author: MonsterInsights Team > MonsterInsights - Performance Addon: version: 1.4.2, author: MonsterInsights Team > MonsterInsights Pro: version: 7.17.0, author: MonsterInsights > My Custom Functions: version: 4.49, author: Space X-Chimp > PDF Embedder: version: 4.6.2, author: Lever Technology LLC > Perfmatters: version: 1.7.1, author: forgemedia > Portfolio Post Type: version: 1.0.1, author: Devin Price > Product Filter for WooCommerce: version: 7.2.0, author: 7VX LLC, USA CA > Regenerate Thumbnails Advanced: version: 2.4.0, author: ShortPixel > Resize Image After Upload: version: 1.8.6, author: ShortPixel > ShortPixel Image Optimizer: version: 4.22.2, author: ShortPixel > Smart Variation Swatches for WooCommerce: version: 1.3.0, author: aThemeArt > SVG Support: version: 2.3.18, author: Benbodhi > User Role Editor: version: 4.59.1, author: Vladimir Garagulya > WC Search Orders By Product: version: 1.5, author: WPHEKA > WooCommerce: version: 5.3.0, author: Automattic > WooCommerce Menu Cart: version: 2.9.7, author: Jeremiah Prummer, Ewout Fernhout > WooCommerce Moldova Agroindbank Payment Gateway: version: 1.2.0, author: Alexander Minza > WooCommerce Multilingual: version: 4.11.5, author: OnTheGoSystems > WooCommerce Order Test: version: 1.6, author: WP Fix It > WooCommerce PDF Invoices & Packing Slips: version: 2.8.3, author: Ewout Fernhout > WooCommerce PDF Invoices & Packing Slips Premium Templates: version: 2.10.2, author: Ewout Fernhout > WooCommerce PDF Invoices & Packing Slips Professional: version: 2.7.4, author: Ewout Fernhout > WooCommerce PDF Watermark: version: 1.2.1, author: WooCommerce > WooCommerce Smart Coupons: version: 4.20.1, author: StoreApps (latest version: 4.21.0) > Woocommerce Table Rate Shipping: version: 2.1.0, author: JEM Plugins (latest version: 2.1.1) > WPForms: version: 1.6.7, author: WPForms > WPForms Form Pages: version: 1.4.1, author: WPForms > WPForms Form Templates Pack: version: 1.2.1, author: WPForms > WPForms Mailchimp: version: 2.1.0, author: WPForms > WPForms Multilingual: version: 0.1.2, author: OnTheGoSystems > WPForms PayPal Standard: version: 1.4.0, author: WPForms > WPForms Surveys and Polls: version: 1.6.4, author: WPForms > WPForms User Registration: version: 1.3.3, author: WPForms > WPML CMS Nav: version: 1.5.5, author: OnTheGoSystems > WPML Media: version: 2.6.4, author: OnTheGoSystems > WPML Multilingual CMS: version: 4.4.10, author: OnTheGoSystems > WPML SEO: version: 2.0.0, author: OnTheGoSystems > WPML Sticky Links: version: 1.5.4, author: OnTheGoSystems > WPML String Translation: version: 3.1.8, author: OnTheGoSystems > WPML Translation Management: version: 2.10.6, author: OnTheGoSystems > WP Overnight Sidekick: version: 2.3.1, author: Jeremiah Prummer, Ewout Fernhout, Michael Kluver > Yoast SEO: WooCommerce: version: 13.9, author: Team Yoast > Yoast SEO Premium: version: 15.5, author: Team Yoast > > ### wp-plugins-inactive (3) ### > > Media from FTP: version: 11.14, author: Katsushi Kawamori > URL coupons for woocommerce: version: 1.0.4, author: WebToffee > > ### wp-media ### > > image_editor: WP_Image_Editor_Imagick > imagick_module_version: 1690 > imagemagick_version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org > imagick_limits: > imagick::RESOURCETYPE_AREA: 122 MB > imagick::RESOURCETYPE_DISK: 1073741824 > imagick::RESOURCETYPE_FILE: 768 > imagick::RESOURCETYPE_MAP: 512 MB > imagick::RESOURCETYPE_MEMORY: 256 MB > imagick::RESOURCETYPE_THREAD: 1 > gd_version: 2.3.0 > ghostscript_version: unknown > > ### wp-server ### > > server_architecture: Linux 5.4.0-1040-gcp x86_64 > httpd_software: nginx/1.19.10 > php_version: 7.4.18 64bit > php_sapi: fpm-fcgi > max_input_variables: 10000 > time_limit: 1200 > memory_limit: 1024M > max_input_time: 300 > upload_max_size: 256M > php_post_max_size: 256M > curl_version: 7.68.0 OpenSSL/1.1.1f > suhosin: false > imagick_availability: true > > > ### wp-database ### > > extension: mysqli > server_version: 10.5.10-MariaDB-1:10.5.10+maria~focal > client_version: mysqlnd 7.4.18 > > ### wp-constants ### > > WP_HOME: undefined > WP_SITEURL: undefined > WP_MAX_MEMORY_LIMIT: 1024M > WP_DEBUG: false > WP_DEBUG_DISPLAY: true > WP_DEBUG_LOG: false > SCRIPT_DEBUG: false > WP_CACHE: false > CONCATENATE_SCRIPTS: undefined > COMPRESS_SCRIPTS: undefined > COMPRESS_CSS: undefined > WP_LOCAL_DEV: undefined > > ### wp-filesystem ### > > wordpress: writable > wp-content: writable > uploads: writable > plugins: writable > themes: writable > mu-plugins: writable > > ### jetpack ### > > site_id: 177831961 > ssl_cert: No > time_diff: undefined > version_option: 9.7:1620241408 > old_version: 9.6.1:1618415213 > public: Public > version: 9.7 > plan: free > protect_header: {"trusted_header":"REMOTE_ADDR","segments":1,"reverse":false} > full_sync: {"started":"Sat, 27 Mar 2021 08:16:35 +0000","finished":"Sat, 27 Mar 2021 08:20:25 +0000","progress":{"options":{"finished":true},"functions":{"finished":true},"constants":{"finished":true},"users":{"total":"1","sent":1,"finished":true,"last_sent":"2"},"network_options":{"finished":true}},"config":{"options":true,"functions":true,"constants":true,"users":[2],"network_options":true}} > sync_size: undefined > sync_lag: 0 seconds > full_sync_size: undefined > full_sync_lag: 0 seconds > idc_error_option: false > idc_optin: true > cxn_tests: All Pass.
davidfilat commented 3 years ago

@alexminza

alexminza commented 3 years ago

Can you also check the browser console logs and network requests?

As you can see here https://github.com/alexminza/wc-moldovaagroindbank/blob/master/wc-moldovaagroindbank.php#L721 a redirect to the bank payment page is returned so the browser must execute it.

Additionally, you could add a debug log before the return statement to check the generated redirect url: $this->log($redirect);

davidfilat commented 3 years ago

Thank you for the advice! The payment works and the orders are marked as complete, but the problem remains that the client is redirected to this page after checkout, which return a 404 error code.

https://shop.eurasiaprecept.org/finalizare/comanda+primit%C4%83/10154/?key=wc_order_CzRqlv7WViacs&utm_nooverride=1

CleanShot 2021-05-28 at 10 19 43@2x

alexminza commented 3 years ago

@davidfilat this return URL is being generated by the system based on your WooCommerce settings.

Check the WooCommerce Settings - Advanced page: /wp-admin/admin.php?page=wc-settings&tab=advanced

Screenshot 2021-05-28 at 13 39 29

Reference:

davidfilat commented 3 years ago

This issue was related to WPML plugin.