Changeset 3460557
- Timestamp:
- 02/13/2026 07:48:05 AM (4 weeks ago)
- Location:
- knit-pay/trunk
- Files:
-
- 7 added
- 9 edited
-
extensions/ba-book-everything (added)
-
extensions/ba-book-everything/src (added)
-
extensions/ba-book-everything/src/BaBookEverythingDependency.php (added)
-
extensions/ba-book-everything/src/Extension.php (added)
-
extensions/ba-book-everything/src/Gateway.php (added)
-
extensions/ba-book-everything/src/Helper.php (added)
-
extensions/bookingpress/src/Helper.php (modified) (1 diff)
-
extensions/camptix/src/Gateway.php (modified) (1 diff)
-
extensions/knit-pay-payment-link/src/Gateway.php (modified) (10 diffs)
-
gateways/razorpay/src/Integration.php (modified) (4 diffs)
-
include.php (modified) (1 diff)
-
includes/CustomSettingFields.php (added)
-
includes/Utils.php (modified) (2 diffs)
-
includes/custom-payment-methods.php (modified) (1 diff)
-
knit-pay.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
knit-pay/trunk/extensions/bookingpress/src/Helper.php
r3448567 r3460557 65 65 66 66 /** 67 * Get value from object.67 * Get value from array. 68 68 * 69 * @param object $object Object.69 * @param array $array Array. 70 70 * @param string $key Key. 71 71 * @return string|null -
knit-pay/trunk/extensions/camptix/src/Gateway.php
r3448567 r3460557 493 493 $transaction_id = $camptix->get_post_meta_from_payment_token( $payment_token, 'tix_transaction_id' ); 494 494 $reason = filter_input( INPUT_POST, 'tix_refund_request_reason', FILTER_SANITIZE_STRING ); 495 495 496 496 $result = [ 497 497 'status' => CampTix_Plugin::PAYMENT_STATUS_REFUND_FAILED, -
knit-pay/trunk/extensions/knit-pay-payment-link/src/Gateway.php
r3448567 r3460557 10 10 use Pronamic\WordPress\Pay\Payments\Payment; 11 11 use KnitPay\Utils; 12 use KnitPay\CustomSettingFields; 12 13 13 14 /** … … 63 64 'knit_pay_payment_link_currency', 64 65 __( 'Currency', 'knit-pay-lang' ), 65 [ $this, 'select_currency' ],66 [ 'KnitPay\\CustomSettingFields', 'select_currency' ], 66 67 'knit_pay_payment_link', 67 68 'knit_pay_create_payment_link', … … 77 78 'knit_pay_payment_link_amount', 78 79 __( 'Amount *', 'knit-pay-lang' ), 79 [ $this, 'input_field' ],80 [ 'KnitPay\\CustomSettingFields', 'input_field' ], 80 81 'knit_pay_payment_link', 81 82 'knit_pay_create_payment_link', … … 94 95 'knit_pay_payment_link_payment_description', 95 96 __( 'Payment For', 'knit-pay-lang' ), 96 [ $this, 'input_field' ],97 [ 'KnitPay\\CustomSettingFields', 'input_field' ], 97 98 'knit_pay_payment_link', 98 99 'knit_pay_create_payment_link', … … 109 110 'knit_pay_payment_link_payment_ref_id', 110 111 __( 'Reference Id', 'knit-pay-lang' ), 111 [ $this, 'input_field' ],112 [ 'KnitPay\\CustomSettingFields', 'input_field' ], 112 113 'knit_pay_payment_link', 113 114 'knit_pay_create_payment_link', … … 123 124 'knit_pay_payment_link_customer_name', 124 125 __( 'Customer Name', 'knit-pay-lang' ), 125 [ $this, 'input_field' ],126 [ 'KnitPay\\CustomSettingFields', 'input_field' ], 126 127 'knit_pay_payment_link', 127 128 'knit_pay_create_payment_link', … … 138 139 'knit_pay_payment_link_customer_email', 139 140 __( 'Customer Email', 'knit-pay-lang' ), 140 [ $this, 'input_field' ],141 [ 'KnitPay\\CustomSettingFields', 'input_field' ], 141 142 'knit_pay_payment_link', 142 143 'knit_pay_create_payment_link', … … 153 154 'knit_pay_payment_link_customer_phone', 154 155 __( 'Customer Phone', 'knit-pay-lang' ), 155 [ $this, 'input_field' ],156 [ 'KnitPay\\CustomSettingFields', 'input_field' ], 156 157 'knit_pay_payment_link', 157 158 'knit_pay_create_payment_link', … … 168 169 'knit_pay_payment_link_config_id', 169 170 __( 'Payment Gateway Configuration', 'knit-pay-lang' ), 170 [ $this, 'select_configuration' ],171 [ 'KnitPay\\CustomSettingFields', 'select_configuration' ], 171 172 'knit_pay_payment_link', 172 173 'knit_pay_create_payment_link', … … 177 178 ] 178 179 ); 179 }180 181 /**182 * Input Field.183 *184 * @param array $args Arguments.185 * @return void186 */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 void202 */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 void239 */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 }290 180 } 291 181 -
knit-pay/trunk/gateways/razorpay/src/Integration.php
r3455714 r3460557 3 3 namespace KnitPay\Gateways\Razorpay; 4 4 5 use Pronamic\WordPress\DateTime\DateTime;6 5 use KnitPay\Gateways\IntegrationOAuthClient; 7 6 use Pronamic\WordPress\Pay\Core\IntegrationModeTrait; 8 7 use Pronamic\WordPress\Pay\Payments\Payment; 9 use Pronamic\WordPress\Pay\Payments\PaymentStatus;10 use WP_Query;11 8 use KnitPay\Utils; 12 9 … … 170 167 } 171 168 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' ) ); 173 175 } 174 176 … … 244 246 245 247 // 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 } 246 257 $fields[] = [ 247 258 'section' => 'general', … … 249 260 'title' => __( 'Country', 'knit-pay-lang' ), 250 261 'type' => 'select', 251 'options' => [ 252 'in' => 'India', 253 'in-import-flow' => 'Non-Indian (Import flow)', 254 ], 262 'options' => $supported_countries, 255 263 'default' => 'in', 256 264 '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 16 16 if ( is_readable( $file ) ) { 17 17 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'; 18 20 } 19 21 } -
knit-pay/trunk/includes/Utils.php
r3448567 r3460557 15 15 */ 16 16 class 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 ) ) { 19 19 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() ) ) { 23 25 return $country->get_name(); 24 26 } … … 281 283 } 282 284 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 ) ) { 285 290 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 } 293 306 294 307 $countries = WC()->countries; // Get an instance of the WC_Countries Object -
knit-pay/trunk/includes/custom-payment-methods.php
r3458322 r3460557 32 32 $payment_methods['debit_card'] = 'Debit Card'; 33 33 $payment_methods['net_banking'] = 'NetBanking'; 34 $payment_methods['fpx'] = 'FPX';34 $payment_methods['fpx'] = 'FPX'; 35 35 36 36 $payment_methods['ebs'] = 'EBS'; -
knit-pay/trunk/knit-pay.php
r3458322 r3460557 5 5 * Description: Seamlessly integrates 500+ payment gateways, including Cashfree, Instamojo, Razorpay, Paypal, Stripe, UPI QR, and SSLCommerz, with over 100 WordPress plugins. 6 6 * 7 * Version: 9. 0.2.27 * Version: 9.1.0.0-beta.1 8 8 * Requires at least: 6.2 9 9 * Requires PHP: 8.1 … … 147 147 ] 148 148 ); 149 $integrations[] = new \KnitPay\Extensions\BaBookEverything\Extension(); 149 150 150 151 // Uncanny Automator. -
knit-pay/trunk/readme.txt
r3458322 r3460557 194 194 * Paymob 195 195 * Dodo Payments 196 * Kashier 197 * PayTabs 196 198 * and many more... 197 199 … … 286 288 * Travel Tour Booking by GoodLayers | TourMaster 287 289 * WP Travel 290 * BA Book Everything (Try it for free with **Knit Pay - Pro**) 288 291 * Hotel Booking Lite By MotoPress (Try it for free with **Knit Pay - Pro**) 289 292 * WP Hotel Booking (Contact us for this premium addon.) 290 293 * WP Hotelier (Contact us for this premium addon.) 291 * BA Book Everything (Contact us for this premium addon.)292 294 * Chauffeur Taxi Booking System (Contact us for this premium addon.) 293 295 * WP Booking System (Contact us for this premium addon.)
Note: See TracChangeset
for help on using the changeset viewer.