Plugin Directory

Changeset 3460557


Ignore:
Timestamp:
02/13/2026 07:48:05 AM (4 weeks ago)
Author:
knitpay
Message:

v9.1.0.0-beta.1:
BA Book Everything: Added Support in Knit Pay Pro.
Razorpay: Updated Curlec URLs.

Location:
knit-pay/trunk
Files:
7 added
9 edited

Legend:

Unmodified
Added
Removed
  • knit-pay/trunk/extensions/bookingpress/src/Helper.php

    r3448567 r3460557  
    6565
    6666    /**
    67      * Get value from object.
     67     * Get value from array.
    6868     *
    69      * @param object $object Object.
     69     * @param array $array Array.
    7070     * @param string $key   Key.
    7171     * @return string|null
  • knit-pay/trunk/extensions/camptix/src/Gateway.php

    r3448567 r3460557  
    493493        $transaction_id = $camptix->get_post_meta_from_payment_token( $payment_token, 'tix_transaction_id' );
    494494        $reason         = filter_input( INPUT_POST, 'tix_refund_request_reason', FILTER_SANITIZE_STRING );
    495        
     495
    496496        $result = [
    497497            'status'                     => CampTix_Plugin::PAYMENT_STATUS_REFUND_FAILED,
  • knit-pay/trunk/extensions/knit-pay-payment-link/src/Gateway.php

    r3448567 r3460557  
    1010use Pronamic\WordPress\Pay\Payments\Payment;
    1111use KnitPay\Utils;
     12use KnitPay\CustomSettingFields;
    1213
    1314/**
     
    6364            'knit_pay_payment_link_currency',
    6465            __( 'Currency', 'knit-pay-lang' ),
    65             [ $this, 'select_currency' ],
     66            [ 'KnitPay\\CustomSettingFields', 'select_currency' ],
    6667            'knit_pay_payment_link',
    6768            'knit_pay_create_payment_link',
     
    7778            'knit_pay_payment_link_amount',
    7879            __( 'Amount *', 'knit-pay-lang' ),
    79             [ $this, 'input_field' ],
     80            [ 'KnitPay\\CustomSettingFields', 'input_field' ],
    8081            'knit_pay_payment_link',
    8182            'knit_pay_create_payment_link',
     
    9495            'knit_pay_payment_link_payment_description',
    9596            __( 'Payment For', 'knit-pay-lang' ),
    96             [ $this, 'input_field' ],
     97            [ 'KnitPay\\CustomSettingFields', 'input_field' ],
    9798            'knit_pay_payment_link',
    9899            'knit_pay_create_payment_link',
     
    109110            'knit_pay_payment_link_payment_ref_id',
    110111            __( 'Reference Id', 'knit-pay-lang' ),
    111             [ $this, 'input_field' ],
     112            [ 'KnitPay\\CustomSettingFields', 'input_field' ],
    112113            'knit_pay_payment_link',
    113114            'knit_pay_create_payment_link',
     
    123124            'knit_pay_payment_link_customer_name',
    124125            __( 'Customer Name', 'knit-pay-lang' ),
    125             [ $this, 'input_field' ],
     126            [ 'KnitPay\\CustomSettingFields', 'input_field' ],
    126127            'knit_pay_payment_link',
    127128            'knit_pay_create_payment_link',
     
    138139            'knit_pay_payment_link_customer_email',
    139140            __( 'Customer Email', 'knit-pay-lang' ),
    140             [ $this, 'input_field' ],
     141            [ 'KnitPay\\CustomSettingFields', 'input_field' ],
    141142            'knit_pay_payment_link',
    142143            'knit_pay_create_payment_link',
     
    153154            'knit_pay_payment_link_customer_phone',
    154155            __( 'Customer Phone', 'knit-pay-lang' ),
    155             [ $this, 'input_field' ],
     156            [ 'KnitPay\\CustomSettingFields', 'input_field' ],
    156157            'knit_pay_payment_link',
    157158            'knit_pay_create_payment_link',
     
    168169            'knit_pay_payment_link_config_id',
    169170            __( 'Payment Gateway Configuration', 'knit-pay-lang' ),
    170             [ $this, 'select_configuration' ],
     171            [ 'KnitPay\\CustomSettingFields', 'select_configuration' ],
    171172            'knit_pay_payment_link',
    172173            'knit_pay_create_payment_link',
     
    177178            ]
    178179        );
    179     }
    180 
    181     /**
    182      * Input Field.
    183      *
    184      * @param array $args Arguments.
    185      * @return void
    186      */
    187     public function input_field( $args ) {
    188         $args['id']   = $args['label_for'];
    189         $args['name'] = $args['label_for'];
    190 
    191         $element = new Element( 'input', $args );
    192         $element->output();
    193 
    194         self::print_description( $args );
    195     }
    196 
    197     /**
    198      * Input page.
    199      *
    200      * @param array $args Arguments.
    201      * @return void
    202      */
    203     public function select_configuration( $args ) {
    204         $args['id']   = $args['label_for'];
    205         $args['name'] = $args['label_for'];
    206 
    207         $configurations    = Plugin::get_config_select_options();
    208         $configurations[0] = __( '— Default Gateway —', 'knit-pay-lang' );
    209 
    210         $element = new Element( 'select', $args );
    211 
    212         $selected_config_id = Utils::get_gateway_config_id();
    213         if ( empty( $selected_config_id ) ) {
    214             $selected_config_id = get_option( 'pronamic_pay_config_id' );
    215         }
    216 
    217         foreach ( $configurations as $key => $label ) {
    218             $option = new Element( 'option', [ 'value' => $key ] );
    219 
    220             $option->children[] = $label;
    221 
    222             if ( $selected_config_id === (string) $key ) {
    223                 $option->attributes['selected'] = 'selected';
    224             }
    225 
    226             $element->children[] = $option;
    227         }
    228 
    229         $element->output();
    230 
    231         self::print_description( $args );
    232     }
    233 
    234     /**
    235      * Input page.
    236      *
    237      * @param array $args Arguments.
    238      * @return void
    239      */
    240     public function select_currency( $args ) {
    241         $currency_default = Currency::get_instance( 'INR' );
    242 
    243         $args['id']   = $args['label_for'];
    244         $args['name'] = $args['label_for'];
    245 
    246         $element = new Element( 'select', $args );
    247 
    248         foreach ( Currencies::get_currencies() as $currency ) {
    249             $option = new Element( 'option', [ 'value' => $currency->get_alphabetic_code() ] );
    250 
    251             $label = $currency->get_alphabetic_code();
    252 
    253             $symbol = $currency->get_symbol();
    254 
    255             if ( null !== $symbol ) {
    256                 $label = sprintf( '%s (%s)', $label, $symbol );
    257             }
    258 
    259             $option->children[] = $label;
    260 
    261             if ( $currency_default->get_alphabetic_code() === $currency->get_alphabetic_code() ) {
    262                 $option->attributes['selected'] = 'selected';
    263             }
    264 
    265             $element->children[] = $option;
    266         }
    267 
    268         $element->output();
    269 
    270         self::print_description( $args );
    271     }
    272 
    273     public static function print_description( $args ) {
    274         if ( isset( $args['description'] ) ) {
    275             printf(
    276                 '<p class="pronamic-pay-description description">%s</p>',
    277                 \wp_kses(
    278                     $args['description'],
    279                     [
    280                         'a'    => [
    281                             'href'   => true,
    282                             'target' => true,
    283                         ],
    284                         'br'   => [],
    285                         'code' => [],
    286                     ]
    287                 )
    288             );
    289         }
    290180    }
    291181
  • knit-pay/trunk/gateways/razorpay/src/Integration.php

    r3455714 r3460557  
    33namespace KnitPay\Gateways\Razorpay;
    44
    5 use Pronamic\WordPress\DateTime\DateTime;
    65use KnitPay\Gateways\IntegrationOAuthClient;
    76use Pronamic\WordPress\Pay\Core\IntegrationModeTrait;
    87use Pronamic\WordPress\Pay\Payments\Payment;
    9 use Pronamic\WordPress\Pay\Payments\PaymentStatus;
    10 use WP_Query;
    118use KnitPay\Utils;
    129
     
    170167        }
    171168
    172         return \sprintf( 'https://dashboard.razorpay.com/app/orders/%s', $payment->get_meta( 'razorpay_order_id' ) );
     169        $config              = $this->get_config( $payment->get_config_id() );
     170        $dashboard_order_url = 'https://dashboard.razorpay.com/app/orders/%s';
     171        if ( 'my' === $config->country ) {
     172            $dashboard_order_url = 'https://dashboard.curlec.com/app/orders/%s';
     173        }
     174        return \sprintf( $dashboard_order_url, $payment->get_meta( 'razorpay_order_id' ) );
    173175    }
    174176
     
    244246
    245247        // Country.
     248        $supported_countries = [
     249            'in'             => 'India',
     250            'in-import-flow' => 'Non-Indian (Import flow)',
     251        ];
     252        if ( $this->is_auth_basic_enabled() ) {
     253            $supported_countries['my'] = 'Malaysia (Curlec)';
     254            $supported_countries['sg'] = 'Singapore';
     255            $supported_countries['us'] = 'United States of America';
     256        }
    246257        $fields[] = [
    247258            'section'     => 'general',
     
    249260            'title'       => __( 'Country', 'knit-pay-lang' ),
    250261            'type'        => 'select',
    251             'options'     => [
    252                 'in'             => 'India',
    253                 'in-import-flow' => 'Non-Indian (Import flow)',
    254             ],
     262            'options'     => $supported_countries,
    255263            'default'     => 'in',
    256264            'description' => __( 'Import Flow is a payment solution designed for International (non-Indian) businesses to accept payments from Indian customers without any additional paperwork or registration.', 'knit-pay-lang' ),
  • knit-pay/trunk/include.php

    r3448567 r3460557  
    1616        if ( is_readable( $file ) ) {
    1717            require_once $file;
     18        } elseif ( is_readable( KNITPAY_DIR . 'includes' . DIRECTORY_SEPARATOR . $match[2] . '.php' ) ) {
     19            require_once KNITPAY_DIR . 'includes' . DIRECTORY_SEPARATOR . $match[2] . '.php';
    1820        }
    1921    }
  • knit-pay/trunk/includes/Utils.php

    r3448567 r3460557  
    1515 */
    1616class Utils {
    17     public static function get_country_name( ?Country $country ) {
    18         if ( ! isset( $country ) ) {
     17    public static function get_country_name( $country ) {
     18        if ( empty( $country ) ) {
    1919            return '';
    20         }
    21 
    22         if ( ! empty( $country->get_name() ) ) {
     20        } elseif ( is_string( $country ) && strlen( $country ) == 2 ) {
     21            $country_obj = new Country();
     22            $country_obj->set_code( $country );
     23            $country = $country_obj;
     24        } elseif ( ! empty( $country->get_name() ) ) {
    2325            return $country->get_name();
    2426        }
     
    281283    }
    282284
    283     public static function get_state_name( ?Region $region, ?Country $country ) {
    284         if ( null === $region ) {
     285    /**
     286     * Get the state name from the state code and country code.
     287     */
     288    public static function get_state_name( $region, $country ) {
     289        if ( empty( $region ) ) {
    285290            return '';
    286         } elseif ( ! function_exists( 'WC' ) ) {
    287             return $region->get_code();
    288         } elseif ( null === $country ) {
    289             return $region->get_code();
    290         }
    291         $country_code = $country->get_code();
    292         $state_code   = empty( $region->get_code() ) ? $region->get_value() : $region->get_code();
     291        } elseif ( $region instanceof Region ) {
     292            $state_code = empty( $region->get_code() ) ? $region->get_value() : $region->get_code();
     293        } elseif ( is_string( $region ) ) {
     294            $state_code = $region;
     295        } else {
     296            return '';
     297        }
     298
     299        if ( empty( $country ) ) {
     300            return $state_code;
     301        } elseif ( $country instanceof Country ) {
     302            $country_code = $country->get_code();
     303        } elseif ( is_string( $country ) ) {
     304            $country_code = $country;
     305        }
    293306
    294307        $countries      = WC()->countries; // Get an instance of the WC_Countries Object
  • knit-pay/trunk/includes/custom-payment-methods.php

    r3458322 r3460557  
    3232        $payment_methods['debit_card']  = 'Debit Card';
    3333        $payment_methods['net_banking'] = 'NetBanking';
    34         $payment_methods['fpx'] = 'FPX';
     34        $payment_methods['fpx']         = 'FPX';
    3535   
    3636        $payment_methods['ebs']           = 'EBS';
  • knit-pay/trunk/knit-pay.php

    r3458322 r3460557  
    55 * Description: Seamlessly integrates 500+ payment gateways, including Cashfree, Instamojo, Razorpay, Paypal, Stripe, UPI QR, and SSLCommerz, with over 100 WordPress plugins.
    66 *
    7  * Version: 9.0.2.2
     7 * Version: 9.1.0.0-beta.1
    88 * Requires at least: 6.2
    99 * Requires PHP: 8.1
     
    147147            ]
    148148        );
     149        $integrations[] = new \KnitPay\Extensions\BaBookEverything\Extension();
    149150
    150151        // Uncanny Automator.
  • knit-pay/trunk/readme.txt

    r3458322 r3460557  
    194194* Paymob
    195195* Dodo Payments
     196* Kashier
     197* PayTabs
    196198* and many more...
    197199
     
    286288* Travel Tour Booking by GoodLayers | TourMaster
    287289* WP Travel
     290* BA Book Everything (Try it for free with **Knit Pay - Pro**)
    288291* Hotel Booking Lite By MotoPress (Try it for free with **Knit Pay - Pro**)
    289292* WP Hotel Booking (Contact us for this premium addon.)
    290293* WP Hotelier (Contact us for this premium addon.)
    291 * BA Book Everything (Contact us for this premium addon.)
    292294* Chauffeur Taxi Booking System (Contact us for this premium addon.)
    293295* WP Booking System (Contact us for this premium addon.)
Note: See TracChangeset for help on using the changeset viewer.