Plugin Directory

Changeset 2836027


Ignore:
Timestamp:
12/19/2022 11:49:02 AM (3 years ago)
Author:
sprinque
Message:

v.1.1.9

Location:
sprinque
Files:
26 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sprinque/tags/1.1.9/assets/css/frontend.css

    r2777074 r2836027  
    579579  border: 1px solid #d9dbf2;
    580580  box-shadow: rgba(217, 219, 242, 0.5) 0px 4px 8px;
     581  max-height: 220px;
     582  overflow-y: scroll;
    581583}
    582584.search-company-result_loaded:not(.search-company-result_selected) {
     
    591593  background: #fff;
    592594  border: 1px solid #d9dbf2;
    593   box-shadow: rgba(217, 219, 242, 0.5) 0px 4px 8px;
     595  box-shadow: rgba(217, 219, 242, 0.5) 0 4px 8px;
     596  max-height: 200px;
     597  overflow-y: scroll;
    594598}
    595599.company-not-found {
     
    702706}
    703707
     708.verify-local-error {
     709  color: red;
     710}
     711
    704712#cancel-order-sprinque {
    705713  margin-bottom: 30px;
  • sprinque/tags/1.1.9/assets/css/frontend.scss

    r2765613 r2836027  
    99  // color: blue;
    1010
    11 }
    12 .founded-companies {
    1311}
    1412.founded-companies .company-item {
  • sprinque/tags/1.1.9/assets/js/frontend.js

    r2828803 r2836027  
    119119        $(inputs).on({
    120120            paste: function(e) {
    121                 console.log('paste1');
    122121                var pastedData = e.originalEvent.clipboardData.getData('text');
    123122                var pastedChars = pastedData.split("");
     
    406405                        } else {
    407406                            showTab('.verifying_your_account');
    408                             autorize_company_payment();
     407                            authorize_company_payment();
    409408                        }
    410409                    } else {
     
    437436                if(response.status === 'true') {
    438437                    showTab('.verifying_your_account');
    439                     autorize_company_payment();
     438                    authorize_company_payment();
    440439                } else {
    441440                    $('.otp-error-code').show();
     
    522521                        } else {
    523522                            showTab('.verifying_your_account');
    524                             autorize_company_payment();
     523                            authorize_company_payment();
    525524                        }
    526525                    } else {
     
    534533    });
    535534
    536     function autorize_company_payment()
     535    function authorize_company_payment()
    537536    {
    538537        var address_line1 = $('#billing_address_1').val();
     
    576575                            $('.cant-complete-autorization').show();
    577576                            $('.verifying_your_account .wpm-loader_my1').hide();
    578                             $('.verify-error').html(response.message);
     577
     578                            if(response.result.error_code === 'auth-credit-exceeded') {
     579                                $('.verify-local-error').show();
     580                            } else {
     581                                $('.verify-error').html(response.message);
     582                            }
    579583                        }
    580584                    }
  • sprinque/tags/1.1.9/include/helper_functions.php

    r2765613 r2836027  
    7575        'GA' => 'Gabon',
    7676        'GM' => 'Gambia',
    77         'GE' => 'Georgia',
    78         'DE' => 'Germany',
     77        'GE' => 'Georgia',*/
     78        'DE' => 'Germany',/*
    7979        'GH' => 'Ghana',
    8080        'GI' => 'Gibraltar',
  • sprinque/tags/1.1.9/include/payment_method.php

    r2828803 r2836027  
    486486            }
    487487
    488             $response = wp_remote_post( $api_url . $route, [
     488            $args = [
    489489                'method'  => $method,
    490490                "timeout" => 100,
     
    493493                    "Accept"       => "application/json",
    494494                    "X-API-KEY-ID" => $this->api_key
    495                 ],
    496                 'body'    => json_encode( $data ),
    497             ] );
     495                ]
     496            ];
     497
     498            if($method == 'POST') {
     499                $args['body'] = json_encode( $data );
     500            }
     501
     502            $response = wp_remote_post( $api_url . $route,  $args);
    498503
    499504            return json_decode( $response['body'], true );
  • sprinque/tags/1.1.9/languages/sprinque-de_DE.po

    r2828803 r2836027  
    2424msgstr "API-Schlüssel"
    2525
    26 # When the order amount is larger than the available credit limit
     26#: templates/frontend/srinque_pay_modal_form.php:91
    2727msgid "AuthCreditExceededError"
    2828msgstr "Die Autorisierungsanfrage überschreitet das verfügbare Kreditlimit"
  • sprinque/tags/1.1.9/languages/sprinque-en_US.po

    r2828803 r2836027  
    3232msgstr "API Key"
    3333
    34 # When the order amount is larger than the available credit limit
     34#: templates/frontend/srinque_pay_modal_form.php:91
    3535msgid "AuthCreditExceededError"
    3636msgstr "Authorization request exceeds the available credit limit"
  • sprinque/tags/1.1.9/languages/sprinque-nl_NL.po

    r2828803 r2836027  
    2424msgstr "API-Sleutel"
    2525
    26 # When the order amount is larger than the available credit limit
     26#: templates/frontend/srinque_pay_modal_form.php:91
    2727msgid "AuthCreditExceededError"
    2828msgstr "Autorisatieverzoek overschrijdt de beschikbare kredietlimiet"
  • sprinque/tags/1.1.9/languages/sprinque.po

    r2828803 r2836027  
    8989msgstr ""
    9090
     91#: templates/frontend/srinque_pay_modal_form.php:91
    9192msgid "AuthCreditExceededError"
    9293msgstr ""
  • sprinque/tags/1.1.9/languages/sprinque.pot

    r2777074 r2836027  
    3333msgstr ""
    3434
     35#: templates/frontend/srinque_pay_modal_form.php:91
     36msgid "AuthCreditExceededError"
     37msgstr ""
     38
    3539#: sprinque.php:392 sprinque.php:418
    3640msgid "Awaiting Review"
  • sprinque/tags/1.1.9/readme.txt

    r2828803 r2836027  
    66Tested up to: 6.0
    77Requires PHP: 5.3
    8 Stable tag: 1.1.8
     8Stable tag: 1.1.9
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5151== Changelog ==
    5252
    53 = 1.1.8 - November 15, 2022 =
     53= 1.1.9 - December 14, 2022 =
     54* Prevent multiple auth calls
     55* Limit height of the search results
     56* Translated auth credit exceeded error
     57* Enable as payment option for Germany
     58* Failed order status when buyer is rejected
     59* Add PHP 8.1.12 support
     60
     61= 1.1.8 - December 5, 2022 =
    5462* Fixed session cache usage
    5563* Manage payment option name from admin
    5664* Added buyer's phone
    5765* Added tracking code (fullstory.com)
     66* Order cancellation
    5867
    5968= 1.1.7 - November 10, 2022 =
  • sprinque/tags/1.1.9/sprinque.php

    r2828803 r2836027  
    55Description: 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.
    66Author: Sprinque
    7 Version: 1.1.8
     7Version: 1.1.9
    88Text Domain: sprinque
    99Domain Path: /languages
     
    196196            $country = WC()->customer->get_billing_country();
    197197
    198             if ( $country != 'NL' && $country != 'BE') {
     198            if ( $country != 'NL' && $country != 'BE' && $country != 'DE') {
    199199                if (isset( $gateways['wpm_srinque_pay'])) {
    200200                    unset( $gateways['wpm_srinque_pay'] );
     
    402402            // Change order Status
    403403            foreach ( $orders as $order ) {
    404                 if ( $webhook['credit_qualification']['credit_decision'] == 'APPROVED' ) {
     404                if ( $webhook['credit_qualification']['credit_decision'] == 'APPROVED' OR $webhook['credit_qualification']['credit_decision'] == 'REJECTED' ) {
    405405                    $order = wc_get_order( $order->ID );
    406406                    $order_id_from_sequential_plugin = $order->get_order_number();
     
    423423
    424424                    // Save API Result to Order
     425                    if ($webhook['credit_qualification']['credit_decision'] == 'APPROVED') {
     426                        $status = 'processing';
     427                    }
     428                    elseif ($webhook['credit_qualification']['credit_decision'] == 'REJECTED') {
     429                        $status = 'failed';
     430                        $order = new WC_Order( $order->ID );
     431                        $order->update_status($status);
     432                        $order->save();
     433                    }
     434
    425435                    if (isset($result['transaction_id'])) {
    426436                        update_post_meta( $order->ID, 'transaction_id', $result['transaction_id'] );
    427437                        update_post_meta( $order->ID, 'merchant_order_id', $order->ID );
    428438                        $order = new WC_Order( $order->ID );
    429                         $order->update_status( 'processing' );
     439                        $order->update_status($status);
    430440                        $order->save();
    431441                    }
     
    457467        ];
    458468
    459         if($data != '' && $data != NULL) {
     469        if($data != '' && $data != NULL && $method == 'POST') {
    460470            $post_data['body'] = json_encode( $data );
    461471        }
  • sprinque/tags/1.1.9/templates/frontend/srinque_pay_modal_form.php

    r2808913 r2836027  
    9595                    <div class="cant-complete-autorization" style="display: none;">
    9696                        <div class="verify-error"></div>
     97                        <div class="verify-local-error"><?php _e( "AuthCreditExceededError", 'sprinque' ); ?></div>
    9798                        <div class="pagination-btns">
    9899                            <button type="button" class="wpm-btn wpm-btn_outline-primary white_btn_pay to_select_companies"><?php _e( "Go Back", 'sprinque' ); ?></button>
  • sprinque/trunk/assets/css/frontend.css

    r2777074 r2836027  
    579579  border: 1px solid #d9dbf2;
    580580  box-shadow: rgba(217, 219, 242, 0.5) 0px 4px 8px;
     581  max-height: 220px;
     582  overflow-y: scroll;
    581583}
    582584.search-company-result_loaded:not(.search-company-result_selected) {
     
    591593  background: #fff;
    592594  border: 1px solid #d9dbf2;
    593   box-shadow: rgba(217, 219, 242, 0.5) 0px 4px 8px;
     595  box-shadow: rgba(217, 219, 242, 0.5) 0 4px 8px;
     596  max-height: 200px;
     597  overflow-y: scroll;
    594598}
    595599.company-not-found {
     
    702706}
    703707
     708.verify-local-error {
     709  color: red;
     710}
     711
    704712#cancel-order-sprinque {
    705713  margin-bottom: 30px;
  • sprinque/trunk/assets/css/frontend.scss

    r2765613 r2836027  
    99  // color: blue;
    1010
    11 }
    12 .founded-companies {
    1311}
    1412.founded-companies .company-item {
  • sprinque/trunk/assets/js/frontend.js

    r2828803 r2836027  
    119119        $(inputs).on({
    120120            paste: function(e) {
    121                 console.log('paste1');
    122121                var pastedData = e.originalEvent.clipboardData.getData('text');
    123122                var pastedChars = pastedData.split("");
     
    406405                        } else {
    407406                            showTab('.verifying_your_account');
    408                             autorize_company_payment();
     407                            authorize_company_payment();
    409408                        }
    410409                    } else {
     
    437436                if(response.status === 'true') {
    438437                    showTab('.verifying_your_account');
    439                     autorize_company_payment();
     438                    authorize_company_payment();
    440439                } else {
    441440                    $('.otp-error-code').show();
     
    522521                        } else {
    523522                            showTab('.verifying_your_account');
    524                             autorize_company_payment();
     523                            authorize_company_payment();
    525524                        }
    526525                    } else {
     
    534533    });
    535534
    536     function autorize_company_payment()
     535    function authorize_company_payment()
    537536    {
    538537        var address_line1 = $('#billing_address_1').val();
     
    576575                            $('.cant-complete-autorization').show();
    577576                            $('.verifying_your_account .wpm-loader_my1').hide();
    578                             $('.verify-error').html(response.message);
     577
     578                            if(response.result.error_code === 'auth-credit-exceeded') {
     579                                $('.verify-local-error').show();
     580                            } else {
     581                                $('.verify-error').html(response.message);
     582                            }
    579583                        }
    580584                    }
  • sprinque/trunk/include/helper_functions.php

    r2765613 r2836027  
    7575        'GA' => 'Gabon',
    7676        'GM' => 'Gambia',
    77         'GE' => 'Georgia',
    78         'DE' => 'Germany',
     77        'GE' => 'Georgia',*/
     78        'DE' => 'Germany',/*
    7979        'GH' => 'Ghana',
    8080        'GI' => 'Gibraltar',
  • sprinque/trunk/include/payment_method.php

    r2828803 r2836027  
    486486            }
    487487
    488             $response = wp_remote_post( $api_url . $route, [
     488            $args = [
    489489                'method'  => $method,
    490490                "timeout" => 100,
     
    493493                    "Accept"       => "application/json",
    494494                    "X-API-KEY-ID" => $this->api_key
    495                 ],
    496                 'body'    => json_encode( $data ),
    497             ] );
     495                ]
     496            ];
     497
     498            if($method == 'POST') {
     499                $args['body'] = json_encode( $data );
     500            }
     501
     502            $response = wp_remote_post( $api_url . $route,  $args);
    498503
    499504            return json_decode( $response['body'], true );
  • sprinque/trunk/languages/sprinque-de_DE.po

    r2828803 r2836027  
    2424msgstr "API-Schlüssel"
    2525
    26 # When the order amount is larger than the available credit limit
     26#: templates/frontend/srinque_pay_modal_form.php:91
    2727msgid "AuthCreditExceededError"
    2828msgstr "Die Autorisierungsanfrage überschreitet das verfügbare Kreditlimit"
  • sprinque/trunk/languages/sprinque-en_US.po

    r2828803 r2836027  
    3232msgstr "API Key"
    3333
    34 # When the order amount is larger than the available credit limit
     34#: templates/frontend/srinque_pay_modal_form.php:91
    3535msgid "AuthCreditExceededError"
    3636msgstr "Authorization request exceeds the available credit limit"
  • sprinque/trunk/languages/sprinque-nl_NL.po

    r2828803 r2836027  
    2424msgstr "API-Sleutel"
    2525
    26 # When the order amount is larger than the available credit limit
     26#: templates/frontend/srinque_pay_modal_form.php:91
    2727msgid "AuthCreditExceededError"
    2828msgstr "Autorisatieverzoek overschrijdt de beschikbare kredietlimiet"
  • sprinque/trunk/languages/sprinque.po

    r2828803 r2836027  
    8989msgstr ""
    9090
     91#: templates/frontend/srinque_pay_modal_form.php:91
    9192msgid "AuthCreditExceededError"
    9293msgstr ""
  • sprinque/trunk/languages/sprinque.pot

    r2777074 r2836027  
    3333msgstr ""
    3434
     35#: templates/frontend/srinque_pay_modal_form.php:91
     36msgid "AuthCreditExceededError"
     37msgstr ""
     38
    3539#: sprinque.php:392 sprinque.php:418
    3640msgid "Awaiting Review"
  • sprinque/trunk/readme.txt

    r2828803 r2836027  
    66Tested up to: 6.0
    77Requires PHP: 5.3
    8 Stable tag: 1.1.8
     8Stable tag: 1.1.9
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5151== Changelog ==
    5252
    53 = 1.1.8 - November 15, 2022 =
     53= 1.1.9 - December 14, 2022 =
     54* Prevent multiple auth calls
     55* Limit height of the search results
     56* Translated auth credit exceeded error
     57* Enable as payment option for Germany
     58* Failed order status when buyer is rejected
     59* Add PHP 8.1.12 support
     60
     61= 1.1.8 - December 5, 2022 =
    5462* Fixed session cache usage
    5563* Manage payment option name from admin
    5664* Added buyer's phone
    5765* Added tracking code (fullstory.com)
     66* Order cancellation
    5867
    5968= 1.1.7 - November 10, 2022 =
  • sprinque/trunk/sprinque.php

    r2828803 r2836027  
    55Description: 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.
    66Author: Sprinque
    7 Version: 1.1.8
     7Version: 1.1.9
    88Text Domain: sprinque
    99Domain Path: /languages
     
    196196            $country = WC()->customer->get_billing_country();
    197197
    198             if ( $country != 'NL' && $country != 'BE') {
     198            if ( $country != 'NL' && $country != 'BE' && $country != 'DE') {
    199199                if (isset( $gateways['wpm_srinque_pay'])) {
    200200                    unset( $gateways['wpm_srinque_pay'] );
     
    402402            // Change order Status
    403403            foreach ( $orders as $order ) {
    404                 if ( $webhook['credit_qualification']['credit_decision'] == 'APPROVED' ) {
     404                if ( $webhook['credit_qualification']['credit_decision'] == 'APPROVED' OR $webhook['credit_qualification']['credit_decision'] == 'REJECTED' ) {
    405405                    $order = wc_get_order( $order->ID );
    406406                    $order_id_from_sequential_plugin = $order->get_order_number();
     
    423423
    424424                    // Save API Result to Order
     425                    if ($webhook['credit_qualification']['credit_decision'] == 'APPROVED') {
     426                        $status = 'processing';
     427                    }
     428                    elseif ($webhook['credit_qualification']['credit_decision'] == 'REJECTED') {
     429                        $status = 'failed';
     430                        $order = new WC_Order( $order->ID );
     431                        $order->update_status($status);
     432                        $order->save();
     433                    }
     434
    425435                    if (isset($result['transaction_id'])) {
    426436                        update_post_meta( $order->ID, 'transaction_id', $result['transaction_id'] );
    427437                        update_post_meta( $order->ID, 'merchant_order_id', $order->ID );
    428438                        $order = new WC_Order( $order->ID );
    429                         $order->update_status( 'processing' );
     439                        $order->update_status($status);
    430440                        $order->save();
    431441                    }
     
    457467        ];
    458468
    459         if($data != '' && $data != NULL) {
     469        if($data != '' && $data != NULL && $method == 'POST') {
    460470            $post_data['body'] = json_encode( $data );
    461471        }
  • sprinque/trunk/templates/frontend/srinque_pay_modal_form.php

    r2808913 r2836027  
    9595                    <div class="cant-complete-autorization" style="display: none;">
    9696                        <div class="verify-error"></div>
     97                        <div class="verify-local-error"><?php _e( "AuthCreditExceededError", 'sprinque' ); ?></div>
    9798                        <div class="pagination-btns">
    9899                            <button type="button" class="wpm-btn wpm-btn_outline-primary white_btn_pay to_select_companies"><?php _e( "Go Back", 'sprinque' ); ?></button>
Note: See TracChangeset for help on using the changeset viewer.