Plugin Directory

Changeset 3230995


Ignore:
Timestamp:
01/29/2025 05:18:55 AM (14 months ago)
Author:
mintpay
Message:

Fix on 0 cashback stores

Location:
mintpay/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mintpay/trunk/index.php

    r3226591 r3230995  
    44 * Plugin URI: https://mintpay.lk
    55 * Description: WooCommerce plugin of Mintpay. Sri Lanka's first buy now pay later platform, that allows consumers to split their payment into 3 interst-free installments.
    6  * Version: 2.0.5
     6 * Version: 2.0.6
    77 * Author: Mintpay (Private) Limited
    88 * Author URI: https://mintpay.lk
  • mintpay/trunk/price-breakdown/index.php

    r3226591 r3230995  
    2020} );
    2121
    22 function mintpay_generate_education_url($price = '') {
    23     $cashback_value = get_option( 'mintpay_cashback_value', 0 );
    24 
     22function mintpay_generate_education_url($price = 0.0) {
     23    $cashback_value = (float) get_option('mintpay_cashback_value', 0);
     24    $cashback_value = (is_numeric($cashback_value) && $cashback_value > 0) ? $cashback_value : 0;
     25
     26    $price = is_numeric($price) ? (float) $price : 0.0;
     27   
    2528    $base_url = 'https://mintpay.lk/education';
    26     if (empty($price) && empty($cashback_value)) {
     29
     30    if ($price <= 0 && $cashback_value <= 0) {
    2731        return $base_url;
    2832    }
    29     return sprintf('%s?price=%s&cashback=%s', $base_url, $price * 3 * 100, $cashback_value * 100);
     33
     34    return sprintf('%s?price=%s&cashback=%s',
     35        $base_url,
     36        number_format($price * 3 * 100, 0, '', ''),
     37        number_format($cashback_value * 100, 0, '', '')
     38    );
    3039}
    3140
  • mintpay/trunk/readme.txt

    r3226591 r3230995  
    55Tested up to: 6.5.5
    66WC tested up to: 8.9.2
    7 Stable tag: 2.0.5
     7Stable tag: 2.0.6
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    6767= 2.0.5 =
    6868* [Fix] - Same URL Generation on Shopify and Wordpress
     69= 2.0.6 =
     70* [Fix] - Fix on 0 cashback stores
    6971
    7072== External Services ==
Note: See TracChangeset for help on using the changeset viewer.