Plugin Directory

Changeset 3360177


Ignore:
Timestamp:
09/11/2025 10:23:34 PM (7 months ago)
Author:
startbutton
Message:

fix - apply correct conversion rates

Location:
startbutton-for-woocommerce
Files:
51 added
19 edited

Legend:

Unmodified
Added
Removed
  • startbutton-for-woocommerce/trunk/changelog.txt

    r3360145 r3360177  
    99* Security improvements
    1010* Bug fixes
     11
     122025-09-11 - version 1.1.1
     13* Bug fixes
  • startbutton-for-woocommerce/trunk/includes/class-wc-gateway-startbutton.php

    r3360145 r3360177  
    380380            if (!empty($api_rates) && !isset($api_rates['error'])) {
    381381        $rates = $api_rates;
     382                error_log('api_rates: ' . print_r($api_rates, true));
    382383            }else{
    383384        $error_message = $api_rates['error'];
     385                error_log('error_message: ' . $error_message);
    384386      }
    385387      // update rate with current time
     
    406408    }
    407409        $api_url = STARTBUTTON_WC_API_URL[$this->environment] . '/transaction/exchange-rate/list?base=' . strtoupper($base_currency);
    408 
     410        error_log('connecting... to ' . $api_url);
    409411        $response = wp_remote_get($api_url, array(
    410             'timeout' => 10,
     412            'timeout' => 30,
    411413            'headers' => array(
    412414                'Authorization' => 'Bearer ' . $this->public_key
     
    428430        $body = wp_remote_retrieve_body($response);
    429431        $rates_data = json_decode($body, true);
    430         // error_log(print_r($rates_data, true));
    431     // error_log('success: ' . $rates_data['success']);
    432     // error_log('data: ' . print_r($rates_data['data'], true));
    433     // error_log('message: ' . $rates_data['message']);
    434432
    435433    // Check if response is valid and has success status
     
    11431141        // Check if we have the required rate
    11441142        if ( isset( $rates[$to_currency] ) ) {
     1143            // error_log('rates[$to_currency]: ' . print_r($rates[$to_currency], true));
    11451144      // rate from API is typically the base currency to 1 unit of the target currency
    1146             $rate = isset( $rates[$to_currency]['rate'] ) ? 1/$rates[$to_currency]['rate'] : 0;
    1147            
     1145            $rate = isset( $rates[$to_currency]['rate'] ) ? $rates[$to_currency]['rate'] : 0;
    11481146            // The new rate is how much of the target currency you get for 1 unit of base currency
    11491147            // So we multiply the price by the rate directly
  • startbutton-for-woocommerce/trunk/readme.txt

    r3360160 r3360177  
    44Requires at least: 6.2
    55Tested up to: 6.7
    6 Stable tag: 1.1.0
     6Stable tag: 1.1.1
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    108108* Bug fixes
    109109
     110= 1.1.1 - September 11, 2025 =
     111* Bug fixes
     112
    110113== Screenshots ==
    111114
  • startbutton-for-woocommerce/trunk/woo-startbutton.php

    r3360145 r3360177  
    44 * Plugin URI: https://startbutton.africa
    55 * Description: Startbutton payment gateway for WooCommerce.
    6  * Version: 1.1.0
     6 * Version: 1.1.1
    77 * Author: Sommysab
    88 * License: GPL-2.0+
     
    2929  'prod' => 'https://api.startbutton.tech',
    3030]);
    31 define( 'STARTBUTTON_WC_VERSION', '1.1.0' );
     31define( 'STARTBUTTON_WC_VERSION', '1.1.1' );
    3232
    3333/**
Note: See TracChangeset for help on using the changeset viewer.