Changeset 2778366
- Timestamp:
- 08/31/2022 03:44:01 PM (4 years ago)
- Location:
- sprinque
- Files:
-
- 11 edited
-
assets/banner-1544x500.png (modified) (previous)
-
assets/icon-256x256.png (modified) (previous)
-
trunk/assets/js/frontend.js (modified) (8 diffs)
-
trunk/include/payment_method.php (modified) (4 diffs)
-
trunk/languages/sprinque-de_DE.mo (modified) (previous)
-
trunk/languages/sprinque-de_DE.po (modified) (3 diffs)
-
trunk/languages/sprinque-nl_NL.mo (modified) (previous)
-
trunk/languages/sprinque-nl_NL.po (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/sprinque.php (modified) (11 diffs)
-
trunk/templates/frontend/srinque_pay_modal_form.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sprinque/trunk/assets/js/frontend.js
r2777074 r2778366 144 144 var orderPayed = false; 145 145 146 $("body").on("click", "#place_order", function(event) { 147 if(!orderPayed && $('#payment_method_wpm_srinque_pay').length && $('#payment_method_wpm_srinque_pay').is(':checked')) { 148 149 var errorFound = false; 150 $( ".woocommerce-billing-fields .validate-required" ).each(function( index ) { 151 if($(this).find('input.input-text').length && $(this).find('input.input-text').val().length === 0) { 152 $(this).addClass('woocommerce-invalid').addClass('woocommerce-invalid-required-field'); 153 errorFound = true; 154 } 155 }); 156 157 if(errorFound) { 158 return; 159 } 160 161 event.preventDefault(); 162 163 get_companies_list(); 164 showPopup('#wpm-modal-form'); 165 } 166 }); 167 146 168 setInterval(function() { 147 if(!$('#srinque_pay').length) {148 $('#place_order').after('<button type="button" class="button alt" id="srinque_pay">Place order</button>');149 }150 if(!orderPayed && $('#payment_method_wpm_srinque_pay').length && $('#payment_method_wpm_srinque_pay').is(':checked')) {151 $('#srinque_pay').show();152 $('#place_order').hide();153 } else {154 $('#srinque_pay').hide();155 $('#place_order').show();156 }157 169 if($('#address_company_pay').length && $('#address_company_pay').val().length > 0 && 158 170 $('#city_company_pay').length && $('#city_company_pay').val().length > 0 && … … 160 172 $('#register_buyer_company').prop('disabled', false); 161 173 } 162 $('.wc_payment_method.payment_method_wpm_srinque_pay label').html(admin.method_title); 163 $('.payment_box.payment_method_wpm_srinque_pay p').html(admin.method_description); 174 175 if($('.wc_payment_method.payment_method_wpm_srinque_pay label').html() !== admin.method_title) { 176 $('.wc_payment_method.payment_method_wpm_srinque_pay label').html(admin.method_title); 177 } 178 if($('.payment_box.payment_method_wpm_srinque_pay p').html() !== admin.method_description) { 179 $('.payment_box.payment_method_wpm_srinque_pay p').html(admin.method_description); 180 } 164 181 }, 100); 165 182 166 183 setInterval(function() { 167 $('.company-not-found').html(admin.not_found_companies); 168 $('#cant-find-business').html(admin.cant_find_business); 169 $('#add-manually-business').html(admin.add_manually_business); 184 if($('.company-not-found').html() !== admin.not_found_companies) { 185 $('.company-not-found').html(admin.not_found_companies); 186 } 187 if($('#cant-find-business').html() !== admin.cant_find_business) { 188 $('#cant-find-business').html(admin.cant_find_business); 189 } 190 if($('#add-manually-business').html() !== admin.add_manually_business) { 191 $('#add-manually-business').html(admin.add_manually_business); 192 } 170 193 }, 500); 171 194 … … 195 218 }); 196 219 197 $("body").on("click", "#srinque_pay", function(event) {198 if($('#payment_method_wpm_srinque_pay').length && $('#payment_method_wpm_srinque_pay').is(':checked') && !orderPayed) {199 var errorFound = false;200 $( ".woocommerce-billing-fields .validate-required" ).each(function( index ) {201 if($(this).find('input.input-text').length && $(this).find('input.input-text').val().length === 0) {202 $(this).addClass('woocommerce-invalid').addClass('woocommerce-invalid-required-field');203 errorFound = true;204 }205 });206 207 if(errorFound) {208 $("#place_order").trigger("click");209 return;210 }211 212 get_companies_list();213 showPopup('#wpm-modal-form');214 }215 });216 217 220 $("body").on("change", "#select_country_pay", function(event) { 218 221 $('.error-confirm-order').hide(); … … 270 273 $('#company_name_pay').val(company_name); 271 274 $('#billing_company').val(company_name); 272 $('#selected-company-name').val(company_reg_code);273 275 $('#reg_number_pay').val(company_reg_code); 274 276 $('#confirm-company-order').prop('disabled', false); … … 314 316 315 317 $('#confirm-company-order').prop('disabled', true); 316 $('#selected-company-name').val('');317 318 $('.search-company-result').removeClass('search-company-result_loading search-company-result_loaded').html(''); 318 319 … … 532 533 var zip_code = $('#billing_postcode').val(); 533 534 var country_code = $('#select_country_pay').val(); 535 var email = $('#billing_email').val(); 534 536 535 537 $('.cant-complete-autorization').hide(); … … 546 548 'zip_code': zip_code, 547 549 'country_code': country_code, 550 'email': email, 548 551 'nonce': admin.nonce 549 552 }, … … 614 617 } 615 618 616 get_companies_list(); 619 if($('#select_country_pay').length && $('#company_name_pay').length) { 620 get_companies_list(); 621 } 617 622 }); -
sprinque/trunk/include/payment_method.php
r2777074 r2778366 121 121 $this->testmode = 'yes' === $this->get_option( 'testmode' ); 122 122 $this->api_key = $this->get_option( 'api_key' ); 123 $this->order_prefix = $this->get_option( 'order_prefix' ); 123 124 124 125 // Actions 125 126 add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); 126 add_action( 'woocommerce_thankyou_' . $this->id, array( $this, 'thankyou_page' ) );127 128 // Customer Emails129 add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );130 127 131 128 // Visual Hooks … … 325 322 public function sprinque_authorize_company_order() { 326 323 // Create ID for future created order 327 $_SESSION['order_id'] = time() ;324 $_SESSION['order_id'] = time().$this->order_prefix; 328 325 329 326 // Get Buyer ID from Logged user … … 345 342 'country_code' => sanitize_text_field( $_POST['country_code'] ) 346 343 ], 344 'issued_by' => sanitize_text_field( $_POST['email'] ) 347 345 ]; 348 346 … … 516 514 'default' => '', 517 515 'desc_tip' => true, 516 ), 517 'order_prefix' => array( 518 'title' => __( 'Order ID Prefix', 'sprinque' ), 519 'type' => 'text', 520 'description' => __( 'Add Prefix after Order ID number for invoices', 'sprinque' ), 521 'default' => '', 522 'desc_tip' => true, 518 523 ) 519 524 ) ); 520 }521 522 /**523 * Output for the order received page.524 */525 public function thankyou_page() {526 if ( $this->instructions ) {527 echo esc_html(wpautop( wptexturize( $this->instructions ) ));528 }529 }530 531 /**532 * Add content to the WC emails.533 */534 public function email_instructions( $order, $sent_to_admin, $plain_text = false ) {535 if ( $this->instructions && ! $sent_to_admin && $this->id === $order->payment_method && $order->has_status( 'processing' ) ) {536 echo esc_html(wpautop( wptexturize( $this->instructions ) ) . PHP_EOL);537 }538 525 } 539 526 -
sprinque/trunk/languages/sprinque-de_DE.po
r2777074 r2778366 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2022-08-06 20:54+0000\n" 6 "PO-Revision-Date: 2022-08-2 3 15:38+0000\n"6 "PO-Revision-Date: 2022-08-29 15:41+0000\n" 7 7 "Last-Translator: \n" 8 8 "Language-Team: German\n" … … 115 115 #: include/payment_method.php:515 116 116 msgid "" 117 "Find it in your Profile at the Srinque. Overview > My Account > API Keys and URLs" 118 msgstr "" 119 "Du findest ihn in deinem Profil bei Sprinque. Übersicht > Mein Konto > API-Schlüssel und URLs" 117 "Find it in your Profile at the Srinque. Overview > My Account > API Keys and " 118 "URLs" 119 msgstr "" 120 "Du findest ihn in deinem Profil bei Sprinque. Übersicht > Mein Konto > API-" 121 "Schlüssel und URLs" 120 122 121 123 #: templates/frontend/srinque_pay_modal_form.php:82 … … 249 251 "a decision is made. <br>We will notify you by email once the review is " 250 252 "complete." 251 msgstr "Die Genehmigung kann bis zu 24 Stunden dauern. Deine Bestellung ist erst bestätigt, wenn eine Entscheidung getroffen wurde. Wir werden dich per E-Mail benachrichtigen, sobald die Prüfung abgeschlossen ist." 253 msgstr "" 254 "Die Genehmigung kann bis zu 24 Stunden dauern. Deine Bestellung ist erst " 255 "bestätigt, wenn eine Entscheidung getroffen wurde. Wir werden dich per E-" 256 "Mail benachrichtigen, sobald die Prüfung abgeschlossen ist." 252 257 253 258 #: templates/frontend/srinque_pay_modal_form.php:64 -
sprinque/trunk/languages/sprinque-nl_NL.po
r2777074 r2778366 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2022-08-06 20:54+0000\n" 6 "PO-Revision-Date: 2022-08-2 3 15:37+0000\n"6 "PO-Revision-Date: 2022-08-29 15:41+0000\n" 7 7 "Last-Translator: \n" 8 8 "Language-Team: Dutch\n" … … 115 115 #: include/payment_method.php:515 116 116 msgid "" 117 "Find it in your Profile at the Srinque. Overview > My Account > API Keys and URLs" 118 msgstr "" 119 "Vind het in je profiel onder Sprinque. Overzicht > mijn account > API sleutel en URLs" 117 "Find it in your Profile at the Srinque. Overview > My Account > API Keys and " 118 "URLs" 119 msgstr "" 120 "Vind het in je profiel onder Sprinque. Overzicht > mijn account > API " 121 "sleutel en URLs" 120 122 121 123 #: templates/frontend/srinque_pay_modal_form.php:82 … … 184 186 #: templates/frontend/srinque_pay_modal_form.php:9 185 187 msgid "Please select your business" 186 msgstr "Selecteer uwbedrijf"188 msgstr "Selecteer je bedrijf" 187 189 188 190 #: templates/frontend/srinque_pay_modal_form.php:50 … … 215 217 #: templates/frontend/srinque_pay_modal_form.php:79 216 218 msgid "Resend Code" 217 msgstr " Code opnieuw verzenden"219 msgstr "Verstuur de code nogmaals" 218 220 219 221 #: templates/frontend/srinque_pay_modal_form.php:12 … … 246 248 "a decision is made. <br>We will notify you by email once the review is " 247 249 "complete." 248 msgstr "Dit kan 24 uur duren. Je besetelling is nog niet bevestigd tot de beslissing is gemaakt. <br> We sturen je een bericht zodra de beoordeling voltooid is." 250 msgstr "" 251 "Je verzoek om op factuur te betalen wordt behandeld. Dit kan 24 uur duren. " 252 "Je besetelling is nog niet bevestigd tot beoordeling is afgerond. <br> We " 253 "sturen je een bericht zodra de beoordeling voltooid is." 249 254 250 255 #: templates/frontend/srinque_pay_modal_form.php:64 -
sprinque/trunk/readme.txt
r2777074 r2778366 2 2 3 3 Contributors: Sprinque 4 Tags: sprinque, payment sprinque, api sprinque, company sprinque4 Tags: B2B payments, B2B BNPL, net payment terms 5 5 Requires at least: 3.5.0 6 6 Tested up to: 6.0 7 7 Requires PHP: 5.3 8 Stable tag: 1.0. 68 Stable tag: 1.0.7 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 14 14 == Description == 15 No admin. No hassle. No risk. 16 Sprinque for WordPress is a plugin that allows you to offer your business buyers net payment terms (15, 30, 60, 90 days) and thereby grow conversion and retention. Business buyers can select to pay by invoice and pay up to 90 days later, while you get paid instantly and without incurring additional risk. 17 Built to integrate seamlessly with your WordPress webshop, Sprinque will appear in the checkout as a payment method for business buyers. When business buyers choose to pay by invoice, Sprinque conducts a real-time fraud and risk assessment. Approved buyers will be given a credit limit and payment term, which can be used for multiple purchases. This will increase conversion and incentivize business buyers to return. 18 Sprinque also offers your buyers convenient ways to pay for their invoices, when payment is due. We are exclusively focused on payment services for B2B transactions with the sole purpose of helping businesses grow safely in a digital world. 15 19 16 Sprinque Payments - demand payments by company 20 == Beyond a standard payment method == 21 Sprinque is on a mission to help businesses grow safely in a digital world. With our fraud and risk engine, we’re able to safely assign a net payment term to new and existing buyers online - all in real time and without adding friction to the buyer. 22 Business buyers are used to getting payment terms in the offline world and by leveraging this practice in your webshop, you’ll be able to convert more business buyers and increase retention. 23 Our automatic and real-time assessment replaces manual and time-consuming fraud and credit risk assessment, reducing operational and financial complexity. In order to extend payment terms to your business buyers, you don’t need to become a credit risk specialist, we’ll take care of this. 24 Sprinque takes away the risk of late payments and defaults for all payments we’ve approved. By paying you instantly when receiving the final invoice via API, we take away the risk of extending payment terms and improve your cash flow. 25 Visit our website [sprinque.com](https://sprinque.com) for more information or mail to [support@sprinque.com](mailto:support@sprinque.com) 26 27 == Screenshots == 28 1. Enter billing details of the buyer. 29 2. Buyer selects and pays with pay by invoice, provided by Sprinque. 30 3. Buyer enters registration details. 31 4. Sprinque verifies the email address of the buyer. 32 5. Real time verification of the buyer's account. 33 6. Order is successfully confirmed. 34 7. Sprinque sends white-label payment reminders to the buyer. 17 35 18 36 == Installation == 37 1. In your admin panel, go to Plugins > Add New. 38 2. Click Upload Plugin and Choose File, then select the plugin’s .zip file. 39 3. Click Install Now. 40 4. Click Activate to use your new plugin right away. 19 41 20 1. In your admin panel, go to Plugins > Add New. 21 2. Click Upload Plugin and Choose File, then select the plugin's .zip file. Click Install Now. 22 3. Click Activate to use your new plugin right away. 42 == Want to learn more? Get in touch == 43 Contact us via [support@sprinque.com](mailto:support@sprinque.com) or visit [our website](https://www.sprinque.com/ "https://www.sprinque.com/"). 23 44 24 45 == Frequently Asked Questions == … … 29 50 30 51 == Changelog == 52 53 = 1.0.7 - August 31, 2022 = 54 * Updated logic around place order button 55 * Added order ID prefix (actually postfix) 56 * Updated docs and translations 57 * Improved plugin speed (way translations are applied) 31 58 32 59 = 1.0.6 - August 26, 2022 = -
sprinque/trunk/sprinque.php
r2777074 r2778366 5 5 Description: Sprinque for WordPress is a plugin that allows you to offer your business buyers net payment terms (15, 30, 60, 90 days) and thereby grow conversion and retention. 6 6 Author: Sprinque 7 Version: 1.0. 67 Version: 1.0.7 8 8 Text Domain: sprinque 9 9 Domain Path: /languages … … 12 12 define( 'PLUGIN_SRINQUE_DIR', __DIR__ ); 13 13 define( 'PLUGIN_SRINQUE_PATH', plugins_url( '', __FILE__ ) ); 14 15 14 16 15 load_plugin_textdomain( 'sprinque', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); … … 56 55 $order_refunds = $order->get_refunds(); 57 56 $transaction_id = get_post_meta( $order_id, 'transaction_id' ) ? get_post_meta( $order_id, 'transaction_id', true ) : false; 57 58 $settings = get_option( 'woocommerce_wpm_srinque_pay_settings', true ); 58 59 59 60 // Loop through the order refunds array … … 73 74 'action' => 'generate_wpo_wcpdf', 74 75 'document_type' => 'invoice', 75 'order_ids' => $order->get_id() ,76 'order_ids' => $order->get_id().$settings['order_prefix'], 76 77 'order_key' => $order->get_order_key(), 77 78 ), admin_url( 'admin-ajax.php' ) ); … … 177 178 $transaction_id = get_post_meta( $order_id, 'transaction_id' ) ? get_post_meta( $order_id, 'transaction_id', true ) : false; 178 179 180 $settings = get_option( 'woocommerce_wpm_srinque_pay_settings', true ); 181 179 182 // Create PDF Link for Invoice 180 183 $pdf_url = add_query_arg( array( 181 184 'action' => 'generate_wpo_wcpdf', 182 185 'document_type' => 'invoice', 183 'order_ids' => $order->get_id() ,186 'order_ids' => $order->get_id().$settings['order_prefix'], 184 187 'order_key' => $order->get_order_key(), 185 188 ), admin_url( 'admin-ajax.php' ) ); … … 231 234 $order = wc_get_order( $order_id ); 232 235 236 $settings = get_option( 'woocommerce_wpm_srinque_pay_settings', true ); 237 233 238 // Create PDF Link for Invoice 234 239 $pdf_url = add_query_arg( array( 235 240 'action' => 'generate_wpo_wcpdf', 236 241 'document_type' => 'invoice', 237 'order_ids' => $order->get_id() ,242 'order_ids' => $order->get_id().$settings['order_prefix'], 238 243 'order_key' => $order->get_order_key(), 239 244 ), admin_url( 'admin-ajax.php' ) ); … … 322 327 ) ); 323 328 329 $settings = get_option( 'woocommerce_wpm_srinque_pay_settings', true ); 330 324 331 // Change order Status 325 332 foreach ( $orders as $order ) { … … 329 336 // Prepare Data to Send 330 337 $data = [ 331 'merchant_order_id' => $order->get_id() ,338 'merchant_order_id' => $order->get_id().$settings['order_prefix'], 332 339 'order_amount' => $order->get_total(), 333 340 'shipping_address' => [ … … 337 344 'country_code' => $order->get_billing_country() 338 345 ], 346 'issued_by' => $order->get_billing_email() 339 347 ]; 340 348 … … 425 433 public function include_scripts_and_styles() { 426 434 // Register styles 427 wp_enqueue_style( 'wpm_srinque_pay', PLUGIN_SRINQUE_PATH . '/assets/css/frontend.css', false, '1.0. 84', 'all' );435 wp_enqueue_style( 'wpm_srinque_pay', PLUGIN_SRINQUE_PATH . '/assets/css/frontend.css', false, '1.0.91', 'all' ); 428 436 429 437 // Register scripts 430 wp_enqueue_script( 'wpm_srinque_pay', PLUGIN_SRINQUE_PATH . '/assets/js/frontend.js', array( 'jquery' ), '1.0. 84', 'all' );438 wp_enqueue_script( 'wpm_srinque_pay', PLUGIN_SRINQUE_PATH . '/assets/js/frontend.js', array( 'jquery' ), '1.0.91', 'all' ); 431 439 wp_localize_script( 'wpm_srinque_pay', 'admin', array( 432 440 'ajaxurl' => admin_url( 'admin-ajax.php' ), … … 438 446 'add_manually_business' => __( "Add buyer manually", 'sprinque' ), 439 447 'fields_not_filled' => __( "Not all required fields are filled", 'sprinque' ), 440 'loading' => __( "Loading...", 'sprinque' ) 448 'loading' => __( "Loading...", 'sprinque' ), 449 'place_order' => __( "Place order", 'sprinque' ), 441 450 ) ); 442 451 } -
sprinque/trunk/templates/frontend/srinque_pay_modal_form.php
r2771284 r2778366 27 27 <input type="text" id="reg_number_pay" placeholder="<?php _e( "Registration number", 'sprinque' ); ?>"> 28 28 </div> 29 30 <input type="hidden" id="selected-company-name"> 29 31 30 <button class="wpm-btn wpm-btn_primary wpm-btn_mt wpm-btn_block" type="button" id="confirm-company-order" disabled><?php _e( "Confirm", 'sprinque' ); ?></button> 32 31 <div class="error-confirm-order" style="display: none;"><?php _e( "Not all required fields is filled", 'sprinque' ); ?></div>
Note: See TracChangeset
for help on using the changeset viewer.