Changeset 3105176
- Timestamp:
- 06/20/2024 02:15:24 PM (22 months ago)
- Location:
- totalprocessing-card-payments
- Files:
-
- 128 added
- 13 edited
-
tags/7.0.0 (added)
-
tags/7.0.0/LICENSE.txt (added)
-
tags/7.0.0/README.md (added)
-
tags/7.0.0/README.txt (added)
-
tags/7.0.0/admin (added)
-
tags/7.0.0/admin/class-totalprocessing-card-payments-and-gateway-woocommerce-admin.php (added)
-
tags/7.0.0/admin/css (added)
-
tags/7.0.0/admin/css/totalprocessing-card-payments-and-gateway-woocommerce-admin.css (added)
-
tags/7.0.0/admin/index.php (added)
-
tags/7.0.0/admin/js (added)
-
tags/7.0.0/admin/js/totalprocessing-card-payments-and-gateway-woocommerce-admin.js (added)
-
tags/7.0.0/admin/partials (added)
-
tags/7.0.0/admin/partials/admin-options.php (added)
-
tags/7.0.0/admin/partials/totalprocessing-card-payments-and-gateway-woocommerce-admin-display.php (added)
-
tags/7.0.0/assets (added)
-
tags/7.0.0/assets/css (added)
-
tags/7.0.0/assets/css/cards_style.min.css (added)
-
tags/7.0.0/assets/css/cardsv2-style.css (added)
-
tags/7.0.0/assets/frames (added)
-
tags/7.0.0/assets/frames/3d.php (added)
-
tags/7.0.0/assets/frames/index.php (added)
-
tags/7.0.0/assets/img (added)
-
tags/7.0.0/assets/img/AMEX-3d.svg (added)
-
tags/7.0.0/assets/img/AMEX-inline.svg (added)
-
tags/7.0.0/assets/img/AMEX.svg (added)
-
tags/7.0.0/assets/img/MAESTRO-3d.svg (added)
-
tags/7.0.0/assets/img/MAESTRO-inline.svg (added)
-
tags/7.0.0/assets/img/MAESTRO.svg (added)
-
tags/7.0.0/assets/img/MASTER-3d.svg (added)
-
tags/7.0.0/assets/img/MASTER-inline.svg (added)
-
tags/7.0.0/assets/img/MASTER.svg (added)
-
tags/7.0.0/assets/img/TP-Logo-white.png (added)
-
tags/7.0.0/assets/img/VISA-3d.svg (added)
-
tags/7.0.0/assets/img/VISA-inline.svg (added)
-
tags/7.0.0/assets/img/VISA.svg (added)
-
tags/7.0.0/assets/img/default.svg (added)
-
tags/7.0.0/assets/img/tp-logo.png (added)
-
tags/7.0.0/assets/img/tpcp-ajax-loader.gif (added)
-
tags/7.0.0/assets/js (added)
-
tags/7.0.0/assets/js/block (added)
-
tags/7.0.0/assets/js/block/block.asset.php (added)
-
tags/7.0.0/assets/js/block/block.css (added)
-
tags/7.0.0/assets/js/block/block.js (added)
-
tags/7.0.0/assets/js/block/css (added)
-
tags/7.0.0/assets/js/block/css/block.css (added)
-
tags/7.0.0/assets/js/jquery-3.5.1.min.js (added)
-
tags/7.0.0/assets/js/tpJs-cardsv2.js (added)
-
tags/7.0.0/assets/js/tpJs-cardsv2_logging.js (added)
-
tags/7.0.0/assets/js/tpJs-cardsv2_logging_off.js (added)
-
tags/7.0.0/assets/js/tpJs-cardsv2_orderpay.js (added)
-
tags/7.0.0/assets/js/tpJs-cardsv2_orderpay_logging.js (added)
-
tags/7.0.0/assets/js/tpJs-cardsv2_orderpay_logging_off.js (added)
-
tags/7.0.0/assets/js/tpJs-cardsv2_registration.js (added)
-
tags/7.0.0/assets/js/tpJs-cardsv2x.js (added)
-
tags/7.0.0/assets/js/tpJs-cardsv2x_orderpay.js (added)
-
tags/7.0.0/blocks (added)
-
tags/7.0.0/blocks/class-wc-tp-cards-payments-blocks.php (added)
-
tags/7.0.0/gateways (added)
-
tags/7.0.0/gateways/index.php (added)
-
tags/7.0.0/gateways/init.php (added)
-
tags/7.0.0/gateways/open-banking-payment (added)
-
tags/7.0.0/gateways/open-banking-payment/assets (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/css (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/css/index.php (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/css/tp-openbank-frame.css (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/img (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/img/index.php (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/img/tp-direct-smaller.svg (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/img/tp-direct.svg (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/img/tp-logo.png (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/index.php (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/js (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/js/index.php (added)
-
tags/7.0.0/gateways/open-banking-payment/assets/js/open-banking-widget-initiator.js (added)
-
tags/7.0.0/gateways/open-banking-payment/callback.php (added)
-
tags/7.0.0/gateways/open-banking-payment/includes (added)
-
tags/7.0.0/gateways/open-banking-payment/includes/admin (added)
-
tags/7.0.0/gateways/open-banking-payment/includes/admin/admin-options.php (added)
-
tags/7.0.0/gateways/open-banking-payment/includes/admin/index.php (added)
-
tags/7.0.0/gateways/open-banking-payment/includes/constants.php (added)
-
tags/7.0.0/gateways/open-banking-payment/includes/index.php (added)
-
tags/7.0.0/gateways/open-banking-payment/includes/setting-fields.php (added)
-
tags/7.0.0/gateways/open-banking-payment/index.php (added)
-
tags/7.0.0/gateways/open-banking-payment/openbanking.php (added)
-
tags/7.0.0/includes (added)
-
tags/7.0.0/includes/class-totalprocessing-card-payments-and-gateway-woocommerce-activator.php (added)
-
tags/7.0.0/includes/class-totalprocessing-card-payments-and-gateway-woocommerce-deactivator.php (added)
-
tags/7.0.0/includes/class-totalprocessing-card-payments-and-gateway-woocommerce-i18n.php (added)
-
tags/7.0.0/includes/class-totalprocessing-card-payments-and-gateway-woocommerce-loader.php (added)
-
tags/7.0.0/includes/class-totalprocessing-card-payments-and-gateway-woocommerce.php (added)
-
tags/7.0.0/includes/class-totalprocessing-constants.php (added)
-
tags/7.0.0/includes/class-tp-payment-gateway-addons.php (added)
-
tags/7.0.0/includes/class-tp-payment-gateway-old-version-helper.php (added)
-
tags/7.0.0/includes/class-tp-payment-gateway.php (added)
-
tags/7.0.0/includes/error-codes-and-messages.php (added)
-
tags/7.0.0/includes/index.php (added)
-
tags/7.0.0/includes/payment-gateway-faqs-array.php (added)
-
tags/7.0.0/includes/payment-gateway-setting-fields.php (added)
-
tags/7.0.0/includes/payment-gateway-static-data-array.php (added)
-
tags/7.0.0/includes/tp-payment-gateway-debug-trait.php (added)
-
tags/7.0.0/includes/tp-payment-gateway-helper-trait.php (added)
-
tags/7.0.0/includes/tp-payment-gateway-subscriptions-trait.php (added)
-
tags/7.0.0/index.php (added)
-
tags/7.0.0/languages (added)
-
tags/7.0.0/languages/totalprocessing-card-payments-and-gateway-woocommerce.pot (added)
-
tags/7.0.0/public (added)
-
tags/7.0.0/public/class-totalprocessing-card-payments-and-gateway-woocommerce-public.php (added)
-
tags/7.0.0/public/css (added)
-
tags/7.0.0/public/css/totalprocessing-card-payments-and-gateway-woocommerce-public.css (added)
-
tags/7.0.0/public/index.php (added)
-
tags/7.0.0/public/js (added)
-
tags/7.0.0/public/js/jquery-3.5.1.min.js (added)
-
tags/7.0.0/public/js/totalprocessing-card-payments-and-gateway-woocommerce-public.js (added)
-
tags/7.0.0/public/partials (added)
-
tags/7.0.0/public/partials/totalprocessing-card-payments-and-gateway-woocommerce-public-display.php (added)
-
tags/7.0.0/templates (added)
-
tags/7.0.0/templates/pci-frame-external.php (added)
-
tags/7.0.0/templates/pci-frame-templatev3.php (added)
-
tags/7.0.0/totalprocessing-card-payments-and-gateway-woocommerce.php (added)
-
tags/7.0.0/uninstall.php (added)
-
trunk/admin/partials/admin-options.php (modified) (1 diff)
-
trunk/assets/css/cardsv2-style.css (modified) (1 diff)
-
trunk/assets/js/block (added)
-
trunk/assets/js/block/block.asset.php (added)
-
trunk/assets/js/block/block.css (added)
-
trunk/assets/js/block/block.js (added)
-
trunk/assets/js/block/css (added)
-
trunk/assets/js/block/css/block.css (added)
-
trunk/assets/js/tpJs-cardsv2x.js (modified) (3 diffs)
-
trunk/assets/js/tpJs-cardsv2x_orderpay.js (modified) (3 diffs)
-
trunk/blocks (added)
-
trunk/blocks/class-wc-tp-cards-payments-blocks.php (added)
-
trunk/gateways/open-banking-payment/openbanking.php (modified) (1 diff)
-
trunk/includes/class-totalprocessing-constants.php (modified) (1 diff)
-
trunk/includes/class-tp-payment-gateway.php (modified) (15 diffs)
-
trunk/includes/payment-gateway-faqs-array.php (modified) (1 diff)
-
trunk/includes/tp-payment-gateway-helper-trait.php (modified) (5 diffs)
-
trunk/includes/tp-payment-gateway-subscriptions-trait.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/templates/pci-frame-templatev3.php (modified) (6 diffs)
-
trunk/totalprocessing-card-payments-and-gateway-woocommerce.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
totalprocessing-card-payments/trunk/admin/partials/admin-options.php
r2908434 r3105176 204 204 <div id="collapse<?php echo $k;?>" class="accordion-collapse collapse" data-bs-parent="#faqAccordion"> 205 205 <div class="card-body"> 206 <?php if( is_array( $faq['answer'] ) ):?> 207 <div class="accordion" id="subFaqAccordion"> 208 <?php $kk = 0;foreach( $faq['answer'] AS $kk => $subFaq ):?> 209 <div class="accordion-item"> 210 <h2 class="accordion-header" id="heading<?php echo $kk;?>"> 211 <button type="button" class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#subcollapse<?php echo $kk;?>"><?php echo ($kk+1);?>. <?php echo $subFaq['question'];?></button> 212 </h2> 213 <div id="subcollapse<?php echo $kk;?>" class="accordion-collapse collapse" data-bs-parent="#subFaqAccordion"> 214 <div class="card-body"> 215 <p><?php echo $subFaq['answer'];?></p> 216 </div> 217 </div> 218 </div> 219 <?php endforeach;?> 220 </div> 221 <?php else:?> 206 222 <p><?php echo $faq['answer'];?></p> 223 <?php endif;?> 207 224 </div> 208 225 </div> -
totalprocessing-card-payments/trunk/assets/css/cardsv2-style.css
r2908434 r3105176 1 1 #cnpFrame {width: 100%; border: none;}#cnpSwal {margin-bottom: 0.3rem; margin-top: 1rem;}#cnpNav {display: flex; align-items: center; justify-content: center;}#cnpNav button {font-size: small; margin: 5px; border-radius: 0.25em; font-weight: lighter;} 2 #tpcpv3_inline-loading{display:flex; align-items: center; justify-content: center;} 3 .dot-bricks { 4 position: relative; 5 top: 8px; 6 left: -9999px; 7 width: 12px; 8 height: 12px; 9 border-radius: 2px; 10 background-color: #BDBDBD; 11 color: #BDBDBD; 12 box-shadow: 9991px -16px 0 0 #BDBDBD, 9991px 0 0 0 #BDBDBD, 10007px 0 0 0 #BDBDBD; 13 animation: dot-bricks 2s infinite ease; 14 } 15 @keyframes dot-bricks { 16 0% { 17 box-shadow: 9991px -16px 0 0 #BDBDBD, 9991px 0 0 0 #BDBDBD, 10007px 0 0 0 #BDBDBD; 18 } 19 8.333% { 20 box-shadow: 10007px -16px 0 0 #BDBDBD, 9991px 0 0 0 #BDBDBD, 10007px 0 0 0 #BDBDBD; 21 } 22 16.667% { 23 box-shadow: 10007px -16px 0 0 #BDBDBD, 9991px -16px 0 0 #BDBDBD, 10007px 0 0 0 #BDBDBD; 24 } 25 25% { 26 box-shadow: 10007px -16px 0 0 #BDBDBD, 9991px -16px 0 0 #BDBDBD, 9991px 0 0 0 #BDBDBD; 27 } 28 33.333% { 29 box-shadow: 10007px 0 0 0 #BDBDBD, 9991px -16px 0 0 #BDBDBD, 9991px 0 0 0 #BDBDBD; 30 } 31 41.667% { 32 box-shadow: 10007px 0 0 0 #BDBDBD, 10007px -16px 0 0 #BDBDBD, 9991px 0 0 0 #BDBDBD; 33 } 34 50% { 35 box-shadow: 10007px 0 0 0 #BDBDBD, 10007px -16px 0 0 #BDBDBD, 9991px -16px 0 0 #BDBDBD; 36 } 37 58.333% { 38 box-shadow: 9991px 0 0 0 #BDBDBD, 10007px -16px 0 0 #BDBDBD, 9991px -16px 0 0 #BDBDBD; 39 } 40 66.666% { 41 box-shadow: 9991px 0 0 0 #BDBDBD, 10007px 0 0 0 #BDBDBD, 9991px -16px 0 0 #BDBDBD; 42 } 43 75% { 44 box-shadow: 9991px 0 0 0 #BDBDBD, 10007px 0 0 0 #BDBDBD, 10007px -16px 0 0 #BDBDBD; 45 } 46 83.333% { 47 box-shadow: 9991px -16px 0 0 #BDBDBD, 10007px 0 0 0 #BDBDBD, 10007px -16px 0 0 #BDBDBD; 48 } 49 91.667% { 50 box-shadow: 9991px -16px 0 0 #BDBDBD, 9991px 0 0 0 #BDBDBD, 10007px -16px 0 0 #BDBDBD; 51 } 52 100% { 53 box-shadow: 9991px -16px 0 0 #BDBDBD, 9991px 0 0 0 #BDBDBD, 10007px 0 0 0 #BDBDBD; 54 } 55 } -
totalprocessing-card-payments/trunk/assets/js/tpJs-cardsv2x.js
r3031406 r3105176 162 162 } 163 163 }); 164 } 165 166 tp.finalOrderPaymentProcess = function( response ){ 167 if(tpCardsInProgress === true){ 168 cardsv2Log('form in 3d progress!!'); 169 return; 170 } 171 tpCardsInProgress = false; 172 cardsv2Log('final payment process for order:'); 173 cardsv2Log(response); 174 pciFormSubmit(cardIframeID,"wpwl-container-card"); 164 175 } 165 176 … … 290 301 cardsv2Log(e); 291 302 }); 292 /*$.post(tp.tpCardVars.adminUrl, { action: globalPrefix + 'validate_tp_cardsv2_checkout', resourcePath: args[0]}, function(response) { 293 cardsv2Log(response); 294 if(response.hasOwnProperty("data")){ 295 if(response.data.hasOwnProperty("url")){ 296 window.location = (response.data.url); 297 } else { 298 $('body').trigger("update_checkout"); 299 $('#tpCardsBtnReplace').remove(); 300 $('#place_order').show(); 301 } 302 } else { 303 $('body').trigger("update_checkout"); 304 $('#tpCardsBtnReplace').remove(); 305 $('#place_order').show(); 306 } 307 }).done(function(response){ 308 console.log('done'); 309 console.log(response); 310 }) 311 .fail(function(response){ 312 console.log('failed'); 313 console.log(response); 314 }).always(function(response){ 315 console.log('always'); 316 console.log(response); 317 });*/ 303 } 304 305 function do_log_errors(args){ 306 Promise.resolve( 307 $.ajax({ 308 type: 'POST', 309 url: tp.tpCardVars.adminUrl, 310 data: { action: globalPrefix + 'do_log_errors', errors: args[0], order_id: args[1]}, 311 success: function(response) { 312 cardsv2Log(args[0]); 313 }, 314 error: function(jqXHR, textStatus, errorThrown){ 315 alert( "Error(#3):" + "\n" + 'Message::' + textStatus + '->' + errorThrown + "\n" + 'resource:' + args[0] ); 316 cardsv2Log(jqXHR); 317 cardsv2Log(textStatus); 318 cardsv2Log(errorThrown); 319 }, 320 }) 321 ).then(function(){ 322 //do something 323 }).catch(function(e) { 324 alert( "Error(#3):" + "\n" + 'resource:' + args[0] ); 325 cardsv2Log(e); 326 }); 318 327 } 319 328 … … 344 353 cardsv2Log('checkout endpoint docReady!'); 345 354 cardsv2Log(tp.tpCardVars.pluginId + ' v.' + tp.tpCardVars.pluginVer); 346 //cardsv2Log('wc_checkout_params =>');347 //cardsv2Log(wc_checkout_params);348 //cardsv2Log(tpCardVars);349 355 window.document.addEventListener('parentLogV52', logToParentWindow, false); 350 //var checkout_form = $( 'form.woocommerce-checkout' );351 //checkout_form.on( 'checkout_place_order', tp.tpCardsHandoff );352 //cardsv2Log('selected payment method onLoad =>');353 //cardsv2Log( $('form.woocommerce-checkout').find('input[name^="payment_method"]:checked').val() );354 /*$('body').on('updated_checkout', function() {355 cardsv2Log('checkout was updated!');356 if($('iframe#' + cardIframeID).length === 0){357 cardsv2Log('Checkout Iframe is initiated');358 instantiateCheckoutIdOrder();359 }360 });*/361 356 } 362 357 } )( window.wc_gateway_tp = window.wc_gateway_tp || {}, jQuery ); -
totalprocessing-card-payments/trunk/assets/js/tpJs-cardsv2x_orderpay.js
r3031406 r3105176 53 53 cardsv2Log( err ); 54 54 } 55 /*if( typeof tp.{e.detail.funcs[ i ].name} === 'function' ){56 tp.{e.detail.funcs[ i ].name}( e.detail.funcs[i].args );57 } else {58 cardsv2Log( e.detail.funcs[ i ].name );59 }*/60 55 } 61 56 } … … 300 295 } 301 296 297 function do_log_errors(args){ 298 Promise.resolve( 299 $.ajax({ 300 type: 'POST', 301 url: tp.tpCardVars.adminUrl, 302 data: { action: globalPrefix + 'do_log_errors', errors: args[0], order_id: args[1]}, 303 success: function(response) { 304 cardsv2Log(args[0]); 305 }, 306 error: function(jqXHR, textStatus, errorThrown){ 307 alert( "Error(#3):" + 'Message::' + textStatus + '->' + errorThrown + "\n" + 'resource:' + args[0] ); 308 cardsv2Log(jqXHR); 309 cardsv2Log(textStatus); 310 cardsv2Log(errorThrown); 311 }, 312 }) 313 ).then(function(){ 314 //do something 315 }).catch(function(e) { 316 alert( "Error(#3):" + "\n" + 'resource:' + args[0] ); 317 cardsv2Log(e); 318 }); 319 } 320 302 321 function progress_tp_cardsv2(args){ 303 322 if(args.length === 1){ … … 332 351 cardsv2Log('checkout endpoint docReady!'); 333 352 cardsv2Log(tp.tpCardVars.pluginId + ' v.' + tp.tpCardVars.pluginVer); 334 //cardsv2Log('wc_checkout_params =>');335 //cardsv2Log(wc_checkout_params);336 //cardsv2Log(tpCardVars);337 353 window.document.addEventListener('parentLogV52', logToParentWindow, false); 338 //var checkout_form = $( 'form.woocommerce-checkout' );339 //checkout_form.on( 'checkout_place_order', tp.tpCardsHandoff );340 //cardsv2Log('selected payment method onLoad =>');341 //cardsv2Log( $('form.woocommerce-checkout').find('input[name^="payment_method"]:checked').val() );342 /*$('body').on('updated_checkout', function() {343 cardsv2Log('checkout was updated!');344 if($('iframe#' + cardIframeID).length === 0){345 cardsv2Log('Checkout Iframe is initiated');346 instantiateCheckoutIdOrder();347 }348 });*/349 354 } 350 355 } )( window.wc_gateway_tp = window.wc_gateway_tp || {}, jQuery ); -
totalprocessing-card-payments/trunk/gateways/open-banking-payment/openbanking.php
r3022827 r3105176 153 153 $tp_pluginVer = TP_OPENBANKING_VERSION; 154 154 $prefix = TP_OPENBANKING_PREFIX; 155 wp_register_script( $prefix . 'tp_openbanking', plugin_dir_url( __FILE__ ).'assets/js/open-banking-widget-initiator.js', ['jquery','wp-util'], $tp_pluginVer );156 157 wp_register_script( $prefix . 'tp_fetch', 'https://cdn.jsdelivr.net/npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js' , ['jquery','wp-util'] , true );158 wp_register_script( $prefix . 'tp_swal', 'https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.all.min.js' , ['jquery','wp-util'] , true );159 wp_register_script( $prefix . 'tp_swal_poly1', 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.12.1/polyfill.min.js' , [] , true );160 wp_register_script( $prefix . 'tp_swal_poly2', 'https://cdn.jsdelivr.net/npm/promise-polyfill@8.1.3/dist/polyfill.js' , [] , true );155 wp_register_script( $prefix . 'tp_openbanking', plugin_dir_url( __FILE__ ).'assets/js/open-banking-widget-initiator.js', ['jquery','wp-util'], $tp_pluginVer, array("in_footer" => true) ); 156 157 wp_register_script( $prefix . 'tp_fetch', 'https://cdn.jsdelivr.net/npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js' , ['jquery','wp-util'] , true, array("in_footer" => true) ); 158 wp_register_script( $prefix . 'tp_swal', 'https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.all.min.js' , ['jquery','wp-util'] , true, array("in_footer" => true) ); 159 wp_register_script( $prefix . 'tp_swal_poly1', 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.12.1/polyfill.min.js' , [] , true, array("in_footer" => true) ); 160 wp_register_script( $prefix . 'tp_swal_poly2', 'https://cdn.jsdelivr.net/npm/promise-polyfill@8.1.3/dist/polyfill.js' , [] , true, array("in_footer" => true) ); 161 161 162 162 wp_localize_script( $prefix . 'tp_openbanking', $prefix . 'GlobalVars', [ -
totalprocessing-card-payments/trunk/includes/class-totalprocessing-constants.php
r3031406 r3105176 10 10 11 11 class WC_TotalProcessing_Constants { 12 const VERSION = "5.3.4"; 13 const DEBUG = false; 14 const GLOBAL_PREFIX = "tpcpv3_"; 15 const GATEWAY_ID = "wc_tp_cardsv3"; 16 const GATEWAY_TITLE = "Total Processing Card Payments"; 17 const GATEWAY_DESCRIPTION = "Card payment customisable in your payment flow. Checkout with Credit/Debit Card."; 18 const PROXY_URL = "https://oppwa.totalprocessing.com/"; 19 const DEBUG_CONTACT_EMAIL = "plugins@totalprocessing.com"; 12 const VERSION = "5.4.2"; 13 const DEBUG = false; 14 const GLOBAL_PREFIX = "tpcpv3_"; 15 const GATEWAY_ID = "wc_tp_cardsv3"; 16 const GATEWAY_TITLE = "Total Processing Card Payments"; 17 const GATEWAY_DESCRIPTION = "Card payment customisable in your payment flow. Checkout with Credit/Debit Card."; 18 const PROXY_URL = "https://oppwa.totalprocessing.com/"; 19 const DEBUG_CONTACT_EMAIL = "plugins@totalprocessing.com"; 20 const DISABLE_CHECKOUT_INIT_PAYMENT_CHECK = true; 20 21 21 22 public static function getPluginBaseURL(){ -
totalprocessing-card-payments/trunk/includes/class-tp-payment-gateway.php
r3036898 r3105176 310 310 add_action( 'wp_ajax_' . TP_CONSTANTS::GLOBAL_PREFIX . 'download_debugdata_file', array( $this, 'ajax_download_debugdata_file' ) ); 311 311 312 add_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_before', [$this, 'show_tp_errors'] ); 313 312 314 //check plugin 313 315 if($this->check_plugin()){ … … 578 580 if($this->useModalPayFrames === true){ 579 581 if(is_add_payment_method_page()){ 580 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_registration.js', ['jquery','wp-util'], $tp_pluginVer );582 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_registration.js', ['jquery','wp-util'], $tp_pluginVer, array("in_footer" => true) ); 581 583 } else if(is_wc_endpoint_url( 'order-pay' )){ 582 584 //wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_orderpay.js', ['jquery','wp-util'], $tp_pluginVer ); 583 585 if($this->jsLogging === true){ 584 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_orderpay_logging.js', ['jquery','wp-util'], $tp_pluginVer );586 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_orderpay_logging.js', ['jquery','wp-util'], $tp_pluginVer, array("in_footer" => true) ); 585 587 } else { 586 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_orderpay_logging_off.js', ['jquery','wp-util'], $tp_pluginVer );588 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_orderpay_logging_off.js', ['jquery','wp-util'], $tp_pluginVer, array("in_footer" => true) ); 587 589 } 588 590 } else { 589 591 if($this->jsLogging === true){ 590 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_logging.js', ['jquery','wp-util'], $tp_pluginVer );592 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_logging.js', ['jquery','wp-util'], $tp_pluginVer, array("in_footer" => true) ); 591 593 } else { 592 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_logging_off.js', ['jquery','wp-util'], $tp_pluginVer );594 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2_logging_off.js', ['jquery','wp-util'], $tp_pluginVer, array("in_footer" => true) ); 593 595 } 594 596 } … … 596 598 if( is_wc_endpoint_url( 'order-pay' ) ){ 597 599 $order_id = intval(get_query_var('order-pay')); 598 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2x_orderpay.js' , ['jquery','wp-util'], $tp_pluginVer );600 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2x_orderpay.js' , ['jquery','wp-util'], $tp_pluginVer, array("in_footer" => true) ); 599 601 }else{ 600 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2x.js' , ['jquery','wp-util'], $tp_pluginVer );601 } 602 } 603 wp_register_script( $prefix . 'tp_fetch', 'https://cdn.jsdelivr.net/npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js' , ['jquery','wp-util'] , true );604 wp_register_script( $prefix . 'tp_swal', 'https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.all.min.js' , ['jquery','wp-util'] , true );605 wp_register_script( $prefix . 'tp_swal_poly1', 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.12.1/polyfill.min.js' , [] , true );606 wp_register_script( $prefix . 'tp_swal_poly2', 'https://cdn.jsdelivr.net/npm/promise-polyfill@8.1.3/dist/polyfill.js' , [] , true );602 wp_register_script( $prefix . 'tp_cards', plugin_dir_url( dirname( __FILE__ ) ).'assets/js/tpJs-cardsv2x.js' , ['jquery','wp-util'], $tp_pluginVer, array("in_footer" => true) ); 603 } 604 } 605 wp_register_script( $prefix . 'tp_fetch', 'https://cdn.jsdelivr.net/npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js' , ['jquery','wp-util'] , true, array("in_footer" => true) ); 606 wp_register_script( $prefix . 'tp_swal', 'https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.all.min.js' , ['jquery','wp-util'] , true, array("in_footer" => true) ); 607 wp_register_script( $prefix . 'tp_swal_poly1', 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.12.1/polyfill.min.js' , [] , true, array("in_footer" => true) ); 608 wp_register_script( $prefix . 'tp_swal_poly2', 'https://cdn.jsdelivr.net/npm/promise-polyfill@8.1.3/dist/polyfill.js' , [] , true, array("in_footer" => true) ); 607 609 608 610 wp_localize_script( $prefix . 'tp_cards', $prefix . 'CardVars', [ … … 688 690 $amount = $forceAmount; 689 691 } else { 690 $amount = WC()->cart->get_total(null); 692 if(isset(WC()->cart)){ 693 $amount = WC()->cart->get_total(null); 694 }else{ 695 $amount = 0; 696 } 691 697 } 692 698 if((float)$amount === 0){ … … 819 825 $this->writeLog( '----- genCheckoutIdOrder [failed in Create Checkout ID] -----', null, 'debug' ); 820 826 wp_send_json_error(); 827 } 828 829 /* 830 * This function is instantiated when checkout page loads or payment fragment refreshes 831 */ 832 public function getCheckoutIdOrder(){ 833 $this->writeLog( '----- getCheckoutIdOrder [initiating Create Checkout ID] -----', null, 'debug' ); 834 $responseData = $this->createCheckoutArray(); 835 $checkoutid = null; 836 if($responseData){ 837 if(isset($responseData->id)){ 838 if(isset($responseData->result->code)){ 839 if(in_array($responseData->result->code,['000.200.000','000.200.100','000.200.101'])){ 840 $this->writeLog( '----- getCheckoutIdOrder [success in Create Checkout ID -> '.$responseData->id.'] -----', null, 'debug' ); 841 $checkoutid = $responseData->id; 842 843 } 844 } 845 } 846 } 847 $this->writeLog( '----- genCheckoutIdOrder [failed in Create Checkout ID] -----', null, 'debug' ); 848 849 if(isset(WC()->session)){ 850 WC()->session->set( 'tp_payment_checkout_id', $checkoutid ); 851 } 852 return $checkoutid; 821 853 } 822 854 … … 1053 1085 return $validation; 1054 1086 } 1055 $parseUrl = parse_url($postArr['wp_http_referer']);1087 $parseUrl = wp_parse_url($postArr['wp_http_referer']); 1056 1088 if(!isset($parseUrl['query'])){ 1057 1089 $validation['errors'][] = 'no query args'; … … 1220 1252 $url = $responseResult['redirect']; 1221 1253 } 1254 }elseif( isset( $responseResult['error'] ) ){ 1255 $url = add_query_arg( 'tp_error', 'Payment not completed: ' . $responseResult['error'], $url ); 1222 1256 } 1223 1257 … … 1612 1646 if( WC_SUBSCRIPTIONS_IS_ACTIVE && wcs_is_subscription( $order_id ) && isset($responseData->registrationId)){ 1613 1647 $parent_id = $order->get_parent_id(); 1614 update_post_meta( $parent_id, '_registration_id', $responseData->registrationId ); 1648 $parent_order = wc_get_order( $parent_id ); 1649 $parent_order->update_meta_data( '_registration_id', $responseData->registrationId ); 1650 $parent_order->save(); 1651 1615 1652 $order->update_meta_data( '_registration_id', $responseData->registrationId ); 1616 1653 } … … 1802 1839 public function orderStatusHandler($status,$order){ 1803 1840 $array=[ 1804 'pending' => ['result'=>'success', 'redirect' => false, 'refresh' => false, 'reload' => false, 'pending'=>true, 'process ' => ["order"=>true]],1841 'pending' => ['result'=>'success', 'redirect' => false, 'refresh' => false, 'reload' => false, 'pending'=>true, 'processpayment' => true, 'process' => ["order"=>true]], 1805 1842 //'processing' => ['result'=>'success', 'redirect' => $this->get_return_url( $order ), 'refresh' => false, 'reload' => false], 1806 1843 //'on-hold' => ['result'=>'success', 'redirect' => $this->get_return_url( $order ), 'refresh' => false, 'reload' => false], … … 1827 1864 $isFromOrderPayPage = true; 1828 1865 } 1866 1829 1867 if($order===false){ 1830 1868 $this->writeLog('-----------process_payment [Order does not exists]-----------', null, 'debug'); 1831 wc_add_notice('There was a problem creating your order, please try again.', 'error');1869 throw new \Exception('There was a problem creating your order, please try again.'); 1832 1870 return; 1833 1871 } … … 1847 1885 } 1848 1886 $handler = $this->orderStatusHandler($order_data['status'],$order); 1887 $handler['order_id'] = $order_id; 1849 1888 //reject the failed, cancelled on-hold & success 1850 1889 if( $isFromOrderPayPage && !isset($handler['pending'])){ … … 1881 1920 } 1882 1921 } 1883 $handler['fullPost'] = $_POST; 1922 1884 1923 $updateCheckout = false; 1885 1924 $checkoutId = false; … … 1892 1931 } 1893 1932 } 1933 $checkoutId = $checkoutId !== false ? $checkoutId : WC()->session->get( 'tp_payment_checkout_id', false ); 1934 $handler['checkoutid'] = $checkoutId !== false ? $checkoutId : WC()->session->get( 'tp_payment_checkout_id', false ); 1894 1935 if($checkoutId === false){ 1895 1936 $this->writeLog('-----------process_payment [checkout id missing and create new checkout id] -----------', null,'debug'); 1896 1937 $checkoutId = $this->createCheckoutArray(false,false,$registrationId); 1897 1938 } 1939 1940 $handler['checkoutid2'] = $checkoutId; 1898 1941 if($checkoutId !== false){ 1899 1942 $checkoutCode = '000.200.100'; … … 1924 1967 1925 1968 $this->writeLog('-----------process_payment [after payload is prepared]----------', $payload,'debug'); 1926 1927 if($this->jsLogging === true){ 1928 $handler['payload'] = $payload; 1929 } 1930 1969 1931 1970 $responseUpdate = $this->updateTransactionData($handler['platformbase'],$checkoutId,$payload); 1932 1971 1933 if($this->jsLogging === true){1934 $handler['responseUpdate'] = $responseUpdate;1935 }1936 1972 $this->writeLog('----------process_payment [after transaction data updated]--------', $responseUpdate,'debug'); 1937 1973 if(isset($responseUpdate->result->code)){ … … 2434 2470 return; 2435 2471 } 2472 if( TP_CONSTANTS::DISABLE_CHECKOUT_INIT_PAYMENT_CHECK === true ){ 2473 return; 2474 } 2436 2475 $headers = ['Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8','Authorization' => 'Bearer '.$this->getAccessToken()]; 2437 2476 $arg = [ -
totalprocessing-card-payments/trunk/includes/payment-gateway-faqs-array.php
r2693527 r3105176 2 2 use TotalProcessing\WC_TotalProcessing_Constants AS TP_CONSTANTS; 3 3 return [ 4 [ 5 'question' => "Raising and Issue with our support team.", 6 'answer' => [ 7 [ 8 'question' => "What should I do if the plugin doesn't work properly with my WooCommerce site?", 9 'answer' => "<p>Our plugin is designed to be compatible with a wide variety of sites right upon installation. However, due to the complex nature of WooCommerce integrations, conflicts may arise due to other plugins or unique site configurations. If you encounter any issues, please contact our support team for assistance.</p>", 10 ], 11 [ 12 'question' => "How do you handle troubleshooting for these issues?", 13 'answer' => "<p>In most cases, we will request access to a staging site—an exact copy of your production site—to safely investigate and address the issue. This approach protects your live site from any potential disruptions that might affect your visitors during troubleshooting.</p>", 14 ], 15 [ 16 'question' => "What if I cannot provide access to a staging site?", 17 'answer' => "<p>If providing a staging site isn’t feasible, we will still assist you to the best of our abilities. However, please be aware that without access to a staging site, our ability to thoroughly investigate and resolve the issue may be significantly limited.</p>", 18 ], 19 ], 20 ], 4 21 [ 5 22 'question' => "Can caching affect the gateway processing?", -
totalprocessing-card-payments/trunk/includes/tp-payment-gateway-helper-trait.php
r2908434 r3105176 1 1 <?php 2 2 use TotalProcessing\WC_TotalProcessing_Constants AS TP_CONSTANTS; 3 use Automattic\WooCommerce\Utilities\OrderUtil; 3 4 4 5 trait TotalProcessingGatewayHelperTrait{ … … 112 113 public function getClientOrdersCountForLast6Months( $userId ) { 113 114 global $wpdb; 114 $sql = "SELECT COUNT(1) FROM {$wpdb->prefix}posts p 115 INNER JOIN {$wpdb->prefix}postmeta pm 116 ON p.ID=pm.post_id 117 WHERE post_status IN ('wc-processing', 'wc-completed') 118 AND p.post_date > date_sub(now(),Interval 6 month) 119 AND (meta_key = '_customer_user' AND meta_value=".(int)$userId.")"; 115 116 //Check if HPOS usage is enabled. 117 if ( OrderUtil::custom_orders_table_usage_is_enabled() ) { 118 $sql = "SELECT COUNT(1) FROM {$wpdb->prefix}wc_orders p 119 INNER JOIN {$wpdb->prefix}wc_orders_meta pm 120 ON p.id=pm.order_id 121 WHERE status IN ('wc-processing', 'wc-completed') 122 AND p.date_created_gmt > date_sub(UTC_TIMESTAMP(),Interval 6 month) 123 AND (meta_key = '_customer_user' AND meta_value=".(int)$userId.")"; 124 } else { 125 $sql = "SELECT COUNT(1) FROM {$wpdb->prefix}posts p 126 INNER JOIN {$wpdb->prefix}postmeta pm 127 ON p.ID=pm.post_id 128 WHERE post_status IN ('wc-processing', 'wc-completed') 129 AND p.post_date > date_sub(now(),Interval 6 month) 130 AND (meta_key = '_customer_user' AND meta_value=".(int)$userId.")"; 131 } 132 120 133 $orderCount = $wpdb->get_var( $sql ); 121 134 return $orderCount; … … 346 359 } 347 360 361 $cartHash = ""; 362 if(!empty( $uuid )){ 363 $cartHash = $uuid; 364 }else if(isset(WC()->cart)){ 365 $cartHash = WC()->cart->get_cart_hash(); 366 } 367 368 if(empty($cartHash)){ 369 $cartHash = time(); 370 } 371 348 372 $logger = wc_get_logger(); 349 373 $GLOBALS['logcounter'] = isset( $GLOBALS['logcounter'] ) ? $GLOBALS['logcounter'] + 1 : 1; 350 374 351 375 $context = array( 'source' => TP_CONSTANTS::GATEWAY_ID ); 352 $cartHash = !empty( $uuid ) ? $uuid : WC()->cart->get_cart_hash();353 376 $logMessage = '['.$cartHash.'] Stack #' . $GLOBALS['logcounter'] . " : " . $label . ( $obj != null ? "\n" . wc_print_r( $obj, true ) : '' ); 354 377 … … 697 720 <td colspan="7"> 698 721 <div id="log-viewer"> 699 <pre>'.esc_html( file_get_contents( WC_LOG_DIR . $firstFileHandle ) ).'</pre>722 <pre>'.esc_html( @file_get_contents( WC_LOG_DIR . $firstFileHandle ) ).'</pre> 700 723 </div> 701 724 </td> … … 936 959 } 937 960 } 961 962 public function is_checkout_block() { 963 return WC_Blocks_Utils::has_block_in_page( wc_get_page_id('checkout'), 'woocommerce/checkout' ); 964 } 965 966 public function show_tp_errors(){ 967 if( isset( $_REQUEST['tp_error'] ) && !empty( $_REQUEST['tp_error'] ) ): 968 ?> 969 <ul class="woocommerce-error"> 970 <li><?php echo wp_kses_post( $_REQUEST['tp_error'] ); ?></li> 971 </ul> 972 <?php 973 endif; 974 } 938 975 } -
totalprocessing-card-payments/trunk/includes/tp-payment-gateway-subscriptions-trait.php
r3022827 r3105176 7 7 $subsOrder = wc_get_order( $subsOrderID ); 8 8 $subsParentOrderID = $subsOrder->get_parent_id(); 9 $subsParentOrderRegID = get_post_meta( $subsParentOrderID, '_registration_id', true ); 9 $subsParentOrder = wc_get_order( $subsParentOrderID ); 10 $subsParentOrderRegID = $subsParentOrder->get_meta('_registration_id'); 10 11 if ( 0 == $amount ) { 11 12 $order->payment_complete(); … … 29 30 $RegID = $subscription->get_registration_id(); 30 31 $subsParentOrderID = $subscription->get_parent_id(); 31 update_post_meta( $subsParentOrderID, '_registration_id', $RegID ); 32 $subsParentOrder = wc_get_order($subsParentOrderID); 33 $subsParentOrder->update_meta_data('_registration_id', $RegID ); 34 $subsParentOrder->save(); 35 32 36 $this->writeLog( '----- fn_change_subscription_payment_method [change payment method change process]-----', [$subsOrderID, $RegID, $subsParentOrderID], 'debug', 12344 ); 33 37 } -
totalprocessing-card-payments/trunk/readme.txt
r3036898 r3105176 3 3 Tags: ecommerce, Total processing, e-commerce, commerce, wordpress checkout, woocommerce gateway, payments, payment gateway, woocommerce, credit card, Total and Processing, Total, Processing 4 4 Requires at least: 5.2.0 5 Tested up to: 6.3.16 Stable tag: 6.0.35 Tested up to: 9 6 Stable tag: 7.0.0 7 7 Requires PHP: 7.4 8 8 License: GPLv3 … … 47 47 48 48 == Changelog == 49 50 = 7.0.0 - 20-06-2024 19:48 = 51 52 * Added compatibility support for the latest WooCommerce version. 53 * Included detailed instructions for raising issues in the FAQs section. 54 * Improved design compatibility with WooCommerce block features. 55 * Implemented compatibility fixes for HPOS. 56 * Enhanced the log system to save logs when an iframe loads. 57 * Improved error handling during final transaction validation. 58 * Fixed a query hook that was causing issues. 59 * Updated the FAQs section to display sub-items without affecting the main items. 60 * Added styling to display a loader in WooCommerce block features. 49 61 50 62 = 6.0.3 - 16-02-2024 19:48 = -
totalprocessing-card-payments/trunk/templates/pci-frame-templatev3.php
r3036898 r3105176 90 90 var resourcePathVal = "<?php echo $_GET['resourcePath']; ?>"; 91 91 var order_id_val = "<?php echo ($_GET['order_id'] ?? 0); ?>"; 92 var generalAlertMsg = ' Uncertain Response. Please report this to the merchant before reattempting payment. They will need to verify if this transaction is successful.';92 var generalAlertMsg = 'Error #if100: Uncertain Response. Please report this to the merchant before reattempting payment. They will need to verify if this transaction is successful.'; 93 93 Promise.resolve( 94 94 $.ajax({ … … 104 104 } else { 105 105 alert( "Error(#1):" + generalAlertMsg + "\n" + 'resource:' + resourcePathVal ); 106 postMessageToParent({funcs:[{"name":"do_log_errors","args":[generalAlertMsg, order_id_val]}]}); 106 107 $('body').trigger("update_checkout"); 107 108 $('#tpCardsBtnReplace').remove(); … … 110 111 } else { 111 112 alert( "Error(#2):" + generalAlertMsg + "\n" + 'resource:' + resourcePathVal ); 113 postMessageToParent({funcs:[{"name":"do_log_errors","args":[generalAlertMsg, order_id_val]}]}); 112 114 $('body').trigger("update_checkout"); 113 115 $('#tpCardsBtnReplace').remove(); … … 116 118 }, 117 119 error: function(jqXHR, textStatus, errorThrown){ 118 alert( "Error(#3):" + generalAlertMsg + "\n" + 'Message::' + textStatus + '->' + errorThrown + "\n" + 'resource:' + resourcePathVal ); 120 alert( "Error(#3):" + generalAlertMsg + "\n" + 'Message::' + textStatus + '->' + errorThrown + "\n" + 'resource:' + resourcePathVal ); 121 postMessageToParent({funcs:[{"name":"do_log_errors","args":[generalAlertMsg, order_id_val]}]}); 119 122 console.log(jqXHR); 120 123 console.log(textStatus); … … 222 225 } 223 226 </style> 224 <style id="tprootcss" type="text/css">:root {--main-primary-color: #2372ce;--main-accent-color: #7f54b3; --wpwl-control-background: transparent!important; ; --wpwl-control-border-radius: 0px!important;--wpwl-control-margin-right:4%;--wpwl-switch-buttons-background:#d8d8d8!important;--wpwl-switch-buttons-text-color:#000000!important;}</style>227 <style id="tprootcss" type="text/css">:root {--main-primary-color: #2372ce;--main-accent-color: #7f54b3; --wpwl-control-background: transparent!important; --wpwl-control-border-radius: 0px!important; --wpwl-control-margin-right:4%;--wpwl-switch-buttons-background:#d8d8d8!important;--wpwl-switch-buttons-text-color:#000000!important;}</style> 225 228 <style type="text/css"> 226 229 html, body, fieldset {margin:0!important; padding:0!important; background: var(--main-primary-color); font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; color: var(--main-accent-color);} … … 607 610 function executePayment(argArray){ 608 611 console.log('exec now->'); 609 console.log(paymentContainer); 612 console.log(jQuery('input[name="card.holder"].wpwl-control-cardHolder').val()); 613 jQuery('input[name="card.holder"].wpwl-control-cardHolder').val(''); 614 console.log(jQuery('input[name="card.holder"].wpwl-control-cardHolder').val()); 610 615 wpwl.executePayment(paymentContainer); 611 616 } -
totalprocessing-card-payments/trunk/totalprocessing-card-payments-and-gateway-woocommerce.php
r3036898 r3105176 10 10 * Plugin URI: https://www.totalprocessing.com/woocommerce/cards 11 11 * Description: Accept all major credit and debit cards. Fast, seamless, and flexible. 12 * Version: 6.0.312 * Version: 7.0.0 13 13 * Author: Total Processing Limited 14 14 * Copyright: 2022 Total Processing Limited. … … 18 18 * Text Domain: totalprocessing-card-payments-and-gateway-woocommerce 19 19 * Domain Path: /languages 20 * WC tested up to: 6.1.120 * WC tested up to: 9 21 21 * WC requires at least: 5.6 22 22 */ … … 27 27 } 28 28 29 define( 'TOTALPROCESSING_PAYMENTGATEWAY_PLUGIN_BASEPATH', trailingslashit( plugin_dir_path( __FILE__ ) ) ); 29 30 define( 'TOTALPROCESSING_PAYMENTGATEWAY_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); 30 31 define( 'TOTALPROCESSING_PAYMENTGATEWAY_PLUGIN_BASEURL', plugin_dir_url( __FILE__ ) ); … … 90 91 } 91 92 93 // Registers WooCommerce Blocks integration. 94 add_action( 'woocommerce_blocks_loaded', 'totalprocessing_card_payments_and_gateway_woocommerce_block_support' ); 95 function totalprocessing_card_payments_and_gateway_woocommerce_block_support() { 96 if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) { 97 require_once 'blocks/class-wc-tp-cards-payments-blocks.php'; 98 add_action( 99 'woocommerce_blocks_payment_method_type_registration', 100 function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { 101 $payment_method_registry->register( new Totalprocessing_Card_Payments_And_Gateway_Blocks_Support() ); 102 } 103 ); 104 } 105 } 106 107 /** 108 * Declaring HPOS compatibility 109 */ 110 add_action( 'before_woocommerce_init', function() { 111 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 112 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 113 } 114 } ); 115 92 116 /** 93 117 * Check if WooCommerce is activated
Note: See TracChangeset
for help on using the changeset viewer.