From 5f6a4940efdd73d1cb2149314aee00c347b9b5eb Mon Sep 17 00:00:00 2001 From: Bruce Atkinson Date: Thu, 13 May 2021 23:01:53 +0200 Subject: [PATCH] = 1.4.3 - May 13, 2021 * Tested on WooCommerce 5.3 and Wordpress 5.7. * Add SnapScan payment type. * Remove legacy reference to 'paypopup'. * Fix error messaging on cancelled and declined transactions. * Use pending status for checksum failures. * Add cron job for query function on orders older than 60 minutes. * Fixed incorrect order note on transaction declined for Notify method. --- README.md | 4 +- assets/css/paygate_checkout.css | 2 +- assets/images/snapscan.svg | 1 + assets/js/maps/paygate_checkout.js.map | 2 +- assets/js/paygate_checkout.js | 2 +- changelog.txt | 9 ++ classes/WC_Gateway_PayGate.php | 144 +++++++++++++++---------- classes/WC_Gateway_PayGate_Cron.php | 42 +++++++- classes/WC_Gateway_PayGate_Portal.php | 22 ++-- gateway-paygate.php | 14 ++- 10 files changed, 161 insertions(+), 81 deletions(-) create mode 100644 assets/images/snapscan.svg diff --git a/README.md b/README.md index 9ed261c..6d65547 100755 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # PayWeb_WooCommerce -## PayGate WooCommerce plugin v1.4.2 for WooCommerce v4.9.0 +## PayGate WooCommerce plugin v1.4.3 for WooCommerce v5.3.0 This is the PayGate PayWeb3 plugin for WooCommerce. Please feel free to contact the PayGate support team at support@paygate.co.za should you require any assistance. ## Installation [![How To Setup PayGate PayWeb for WooCommerce](https://www.appinlet.com/wp-content/uploads/2018/09/WooCommerce-Integration.jpg)](https://www.youtube.com/watch?v=MMcEG7FmoEM "How To Setup PayGate PayWeb for WooCommerce") -Please navigate to the [releases page](https://github.com/PayGate/PayWeb_WooCommerce/releases), download the latest release (v1.4.2) and unzip. You will then be able to follow the integration guide PDF which is included in the zip. +Please navigate to the [releases page](https://github.com/PayGate/PayWeb_WooCommerce/releases), download the latest release (v1.4.3) and unzip. You will them be able to follow the integration guide PDF which is included in the zip. ## Collaboration diff --git a/assets/css/paygate_checkout.css b/assets/css/paygate_checkout.css index fae9406..9716679 100755 --- a/assets/css/paygate_checkout.css +++ b/assets/css/paygate_checkout.css @@ -1 +1 @@ -#payPopup{display:block;position:fixed;z-index:9999999999;left:0;top:0;width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;overflow-y:scroll;background-color:#000;background-color:rgba(0,0,0,.6)}#payPopupContent{width:94%;background-color:#fefefe;margin:3% auto 0 auto;padding:0;border:0;border-radius:3px;height:90%;overflow:auto;-webkit-overflow-scrolling:touch;overflow-y:scroll}#payPopupFrame{margin:0 0 -7px 0;padding:0;border:none;width:100%;height:100%}#paygate_checkout{display:none}#payPopupClose{color:#aaa;float:right;font-size:28px;font-weight:700;margin:0;padding:0;font-family:Times New Roman,sans-serif;line-height:15px;height:15px}#payPopupClose:focus,#payPopupClose:hover{color:#000;text-decoration:none;cursor:pointer}img.pay_method_image{width:35px;margin-top:15px}td.pay_method_image{padding:0;vertical-align:middle}#payment .payment_methods li td.pay_method_image img{width:130px;height:auto;border:none;max-height:none;padding:10px 5px;float:right}.start_hidden{display:none}thead td{padding:0}#payment .payment_method_paygate tr td{border:none}#payment .payment_method_paygate thead{display:none}#payment .payment_method_paygate table{margin:none} \ No newline at end of file +#paygate_checkout{display:none}img.pay_method_image{width:35px;margin-top:15px}td.pay_method_image{padding:0;vertical-align:middle}#payment .payment_methods li td.pay_method_image img{width:130px;height:auto;border:none;max-height:none;padding:10px 5px;float:right}.start_hidden{display:none}thead td{padding:0}#payment .payment_method_paygate tr td{border:none}#payment .payment_method_paygate thead{display:none}#payment .payment_method_paygate table{margin:none} \ No newline at end of file diff --git a/assets/images/snapscan.svg b/assets/images/snapscan.svg new file mode 100644 index 0000000..6c72916 --- /dev/null +++ b/assets/images/snapscan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/js/maps/paygate_checkout.js.map b/assets/js/maps/paygate_checkout.js.map index eabc85b..7c0b853 100644 --- a/assets/js/maps/paygate_checkout.js.map +++ b/assets/js/maps/paygate_checkout.js.map @@ -1 +1 @@ -{"version":3,"file":"../paygate_checkout.js","sources":["paygate_checkout.js"],"sourcesContent":["jQuery(function() {\n jQuery.ajaxSetup({\n complete: function(xhr, textStatus) {\n var result = JSON.parse(xhr.responseText);\n if (result.paygate_override) {\n jQuery('.woocommerce-error').remove();\n initPayPopup(result);\n return false;\n }\n return;\n }\n });\n jQuery(document).ajaxComplete(function() {\n if (jQuery('body').hasClass('woocommerce-checkout') || jQuery('body').hasClass('woocommerce-cart')) {\n jQuery('html, body').stop();\n }\n });\n});\n\nfunction initPayPopup(result) {\n jQuery(\"body\").append(\"
\");\n jQuery(\"#payPopup\").append(\"
\");\n jQuery(\"#payPopupContent\").append(\"
\");\n}\njQuery(document).on('submit', 'form#order_review', function(e) {\n jQuery(\"#place_order\").attr(\"disabled\", \"disabled\");\n var contine = true;\n if (jQuery('#terms').length) {\n if (!jQuery(\"#terms\").is(\":checked\") == true) {\n contine = false;\n }\n }\n if (contine && jQuery('#payment_method_paygate').length && jQuery(\"#payment_method_paygate\").is(\":checked\") == true) {\n if (paygate_checkout_js.is_order_pay) {\n e.preventDefault();\n var result = JSON.parse(paygate_checkout_js.pay_now_form_data);\n initPayPopup(result);\n } else {\n e.preventDefault();\n jQuery.ajax({\n 'url': wc_add_to_cart_params.ajax_url,\n 'type': 'POST',\n 'dataType': 'json',\n 'data': {\n 'action': 'order_pay_payment',\n 'order_id': paygate_checkout_js.order_id\n },\n 'async': false\n }).complete(function(response) {\n var ajaxResult = JSON.parse(response);\n initPayPopup(ajaxResult);\n });\n }\n }\n});\n"],"names":["initPayPopup","result","jQuery","append","PAY_REQUEST_ID","CHECKSUM","ajaxSetup","complete","xhr","textStatus","JSON","parse","responseText","paygate_override","remove","document","ajaxComplete","hasClass","stop","on","e","attr","contine","length","is","paygate_checkout_js","is_order_pay","preventDefault","pay_now_form_data","ajax","url","wc_add_to_cart_params","ajax_url","type","dataType","data","action","order_id","async","response"],"mappings":"AAmBA,SAASA,aAAaC,GAClBC,OAAO,QAAQC,OAAO,6BACtBD,OAAO,aAAaC,OAAO,oCAC3BD,OAAO,oBAAoBC,OAAO,mLAAqLF,EAAOG,eAAiB,4DAA8DH,EAAOI,SAAW,0KAtBnUH,OAAO,WACHA,OAAOI,UAAU,CACbC,SAAU,SAASC,EAAKC,GACpB,IAAIR,EAASS,KAAKC,MAAMH,EAAII,cAC5B,GAAIX,EAAOY,iBAGP,OAFAX,OAAO,sBAAsBY,SAC7Bd,aAAaC,IACN,KAKnBC,OAAOa,UAAUC,aAAa,YACtBd,OAAO,QAAQe,SAAS,yBAA2Bf,OAAO,QAAQe,SAAS,sBAC3Ef,OAAO,cAAcgB,WAUjChB,OAAOa,UAAUI,GAAG,SAAU,oBAAqB,SAASC,GACxDlB,OAAO,gBAAgBmB,KAAK,WAAY,YACxC,IAAIC,GAAU,EACVpB,OAAO,UAAUqB,QACuB,IAAnCrB,OAAO,UAAUsB,GAAG,cACrBF,GAAU,GAGdA,GAAWpB,OAAO,2BAA2BqB,QAA8D,GAApDrB,OAAO,2BAA2BsB,GAAG,cACxFC,oBAAoBC,cACpBN,EAAEO,iBAEF3B,aADaU,KAAKC,MAAMc,oBAAoBG,sBAG5CR,EAAEO,iBACFzB,OAAO2B,KAAK,CACRC,IAAOC,sBAAsBC,SAC7BC,KAAQ,OACRC,SAAY,OACZC,KAAQ,CACJC,OAAU,oBACVC,SAAYZ,oBAAoBY,UAEpCC,OAAS,IACV/B,SAAS,SAASgC,GAEjBvC,aADiBU,KAAKC,MAAM4B"} \ No newline at end of file +{"version":3,"file":"../paygate_checkout.js","sources":["paygate_checkout.js"],"sourcesContent":["jQuery(function() {\n jQuery(document).ajaxComplete(function() {\n if (jQuery('body').hasClass('woocommerce-checkout') || jQuery('body').hasClass('woocommerce-cart')) {\n jQuery('html, body').stop();\n }\n });\n});\n\njQuery(document).on('submit', 'form#order_review', function(e) {\n jQuery(\"#place_order\").attr(\"disabled\", \"disabled\");\n});\n"],"names":["jQuery","document","ajaxComplete","hasClass","stop","on","e","attr"],"mappings":"AAAAA,OAAO,WACHA,OAAOC,UAAUC,aAAa,YACtBF,OAAO,QAAQG,SAAS,yBAA2BH,OAAO,QAAQG,SAAS,sBAC3EH,OAAO,cAAcI,WAKjCJ,OAAOC,UAAUI,GAAG,SAAU,oBAAqB,SAASC,GACxDN,OAAO,gBAAgBO,KAAK,WAAY"} \ No newline at end of file diff --git a/assets/js/paygate_checkout.js b/assets/js/paygate_checkout.js index 2b2c9ce..8e6c5d8 100755 --- a/assets/js/paygate_checkout.js +++ b/assets/js/paygate_checkout.js @@ -1,2 +1,2 @@ -function initPayPopup(e){jQuery("body").append("
"),jQuery("#payPopup").append("
"),jQuery("#payPopupContent").append("