Changeset 3413314
- Timestamp:
- 12/07/2025 03:24:14 AM (4 months ago)
- Location:
- shieldclimb-high-risk-card-payment-gateway/trunk
- Files:
-
- 2 deleted
- 4 edited
-
includes/class-shieldclimb-hostedshieldclimb.php (deleted)
-
includes/class-shieldclimb-mercuryo.php (deleted)
-
includes/class-shieldclimb-revolut.php (modified) (10 diffs)
-
includes/shieldclimb-payment-functions.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
shieldclimb-high-risk-card-payment-gateway.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shieldclimb-high-risk-card-payment-gateway/trunk/includes/class-shieldclimb-revolut.php
r3411577 r3413314 4 4 } 5 5 6 add_action('plugins_loaded', 'init_shieldclimbgateway_revolut _gateway');7 8 function init_shieldclimbgateway_revolut _gateway() {6 add_action('plugins_loaded', 'init_shieldclimbgateway_revolutcom_gateway'); 7 8 function init_shieldclimbgateway_revolutcom_gateway() { 9 9 if (!class_exists('WC_Payment_Gateway')) { 10 10 return; 11 11 } 12 13 12 14 13 class shieldclimb_Instant_Payment_Gateway_Revolut extends WC_Payment_Gateway { … … 112 111 $shieldclimbgateway_revolutcom_callback = add_query_arg(array('order_id' => $order_id, 'nonce' => $shieldclimbgateway_revolutcom_nonce,), rest_url('shieldclimbgateway/v1/shieldclimbgateway-revolutcom/')); 113 112 $shieldclimbgateway_revolutcom_email = urlencode(sanitize_email($order->get_billing_email())); 114 $shieldclimbgateway_revolutcom_final_total = $shieldclimbgateway_revolutcom_total;115 116 if ($shieldclimbgateway_revolutcom_currency === 'USD') { 117 $shieldclimbgateway_revolutcom_minimumcheck = $shieldclimbgateway_revolutcom_total;113 114 if ($shieldclimbgateway_revolutcom_currency === 'USD') { 115 $shieldclimbgateway_revolutcom_final_total = $shieldclimbgateway_revolutcom_total; 116 $shieldclimbgateway_revolutcom_reference_total = (float)$shieldclimbgateway_revolutcom_final_total; 118 117 } else { 119 118 120 $shieldclimbgateway_revolutcom_ minimumcheck_response = wp_remote_get('https://api.shieldclimb.com/control/convert.php?value=' . $shieldclimbgateway_revolutcom_total . '&from=' . strtolower($shieldclimbgateway_revolutcom_currency), array('timeout' => 30));121 122 if (is_wp_error($shieldclimbgateway_revolutcom_ minimumcheck_response)) {119 $shieldclimbgateway_revolutcom_response = wp_remote_get('https://api.shieldclimb.com/control/convert.php?value=' . $shieldclimbgateway_revolutcom_total . '&from=' . strtolower($shieldclimbgateway_revolutcom_currency), array('timeout' => 30)); 120 121 if (is_wp_error($shieldclimbgateway_revolutcom_response)) { 123 122 // Handle error 124 123 shieldclimbgateway_add_notice(__('Payment error:', 'shieldclimb-high-risk-card-payment-gateway') . __('Payment could not be processed due to failed currency conversion process, please try again', 'shieldclimb-high-risk-card-payment-gateway'), 'error'); … … 126 125 } else { 127 126 128 $shieldclimbgateway_revolutcom_ minimumcheck_body = wp_remote_retrieve_body($shieldclimbgateway_revolutcom_minimumcheck_response);129 $shieldclimbgateway_revolutcom_ minimum_conversion_resp = json_decode($shieldclimbgateway_revolutcom_minimumcheck_body, true);130 131 if ($shieldclimbgateway_revolutcom_ minimum_conversion_resp && isset($shieldclimbgateway_revolutcom_minimum_conversion_resp['value_coin'])) {127 $shieldclimbgateway_revolutcom_body = wp_remote_retrieve_body($shieldclimbgateway_revolutcom_response); 128 $shieldclimbgateway_revolutcom_conversion_resp = json_decode($shieldclimbgateway_revolutcom_body, true); 129 130 if ($shieldclimbgateway_revolutcom_conversion_resp && isset($shieldclimbgateway_revolutcom_conversion_resp['value_coin'])) { 132 131 // Escape output 133 $shieldclimbgateway_revolutcom_ minimum_conversion_total = sanitize_text_field($shieldclimbgateway_revolutcom_minimum_conversion_resp['value_coin']);134 $shieldclimbgateway_revolutcom_ minimumcheck = (float)$shieldclimbgateway_revolutcom_minimum_conversion_total;132 $shieldclimbgateway_revolutcom_final_total = sanitize_text_field($shieldclimbgateway_revolutcom_conversion_resp['value_coin']); 133 $shieldclimbgateway_revolutcom_reference_total = (float)$shieldclimbgateway_revolutcom_final_total; 135 134 } else { 136 135 shieldclimbgateway_add_notice(__('Payment error:', 'shieldclimb-high-risk-card-payment-gateway') . __('Payment could not be processed, please try again (unsupported store currency)', 'shieldclimb-high-risk-card-payment-gateway'), 'error'); … … 140 139 } 141 140 142 if ($shieldclimbgateway_revolutcom_ minimumcheck < 15) {143 shieldclimbgateway_add_notice(__('Payment error:', 'shieldclimb-high-risk-card-payment-gateway') . __('Order total for this payment provider must be $ 15USD or more.', 'shieldclimb-high-risk-card-payment-gateway'), 'error');141 if ($shieldclimbgateway_revolutcom_reference_total < 8) { 142 shieldclimbgateway_add_notice(__('Payment error:', 'shieldclimb-high-risk-card-payment-gateway') . __('Order total for this payment provider must be $8 USD or more.', 'shieldclimb-high-risk-card-payment-gateway'), 'error'); 144 143 return null; 145 } 146 144 } 145 147 146 $shieldclimbgateway_revolutcom_gen_wallet = wp_remote_get('https://api.shieldclimb.com/control/wallet.php?address=' . $this->revolutcom_wallet_address .'&callback=' . urlencode($shieldclimbgateway_revolutcom_callback), array('timeout' => 30)); 148 147 … … 166 165 $order->add_meta_data('shieldclimb_revolutcom_callback', $shieldclimbgateway_revolutcom_gen_callback, true); 167 166 $order->add_meta_data('shieldclimb_revolutcom_converted_amount', $shieldclimbgateway_revolutcom_final_total, true); 167 $order->add_meta_data('shieldclimb_revolutcom_expected_amount', $shieldclimbgateway_revolutcom_reference_total, true); 168 168 $order->add_meta_data('shieldclimb_revolutcom_nonce', $shieldclimbgateway_revolutcom_nonce, true); 169 169 $order->save(); … … 184 184 return array( 185 185 'result' => 'success', 186 'redirect' => 'https://' . $this->revolutcom_custom_domain . '/process-payment.php?address=' . $shieldclimbgateway_revolutcom_gen_addressIn . '&amount=' . (float)$shieldclimbgateway_revolutcom_ final_total . '&provider=revolut&email=' . $shieldclimbgateway_revolutcom_email . '¤cy=' . $shieldclimbgateway_revolutcom_currency,186 'redirect' => 'https://' . $this->revolutcom_custom_domain . '/process-payment.php?address=' . $shieldclimbgateway_revolutcom_gen_addressIn . '&amount=' . (float)$shieldclimbgateway_revolutcom_total . '&provider=revolut&email=' . $shieldclimbgateway_revolutcom_email . '¤cy=' . $shieldclimbgateway_revolutcom_currency, 187 187 ); 188 188 } … … 193 193 } 194 194 195 function shieldclimbgateway_add_instant_payment_gateway_revolut ($gateways) {195 function shieldclimbgateway_add_instant_payment_gateway_revolutcom($gateways) { 196 196 $gateways[] = 'shieldclimb_Instant_Payment_Gateway_Revolut'; 197 197 return $gateways; 198 198 } 199 add_filter('woocommerce_payment_gateways', 'shieldclimbgateway_add_instant_payment_gateway_revolut ');199 add_filter('woocommerce_payment_gateways', 'shieldclimbgateway_add_instant_payment_gateway_revolutcom'); 200 200 } 201 201 … … 216 216 $shieldclimbgateway_revolutcomgetnonce = sanitize_text_field($request->get_param( 'nonce' )); 217 217 $shieldclimbgateway_revolutcompaid_txid_out = sanitize_text_field($request->get_param('txid_out')); 218 $shieldclimbgateway_revolutcompaid_value_coin = sanitize_text_field($request->get_param('value_coin')); 219 $shieldclimbgateway_revolutcomfloatpaid_value_coin = (float)$shieldclimbgateway_revolutcompaid_value_coin; 218 220 219 221 // Check if order ID parameter exists … … 237 239 // Check if the order is pending and payment method is 'shieldclimb-revolut' 238 240 if ( $order && $order->get_status() !== 'processing' && $order->get_status() !== 'completed' && 'shieldclimb-revolut' === $order->get_payment_method() ) { 241 $shieldclimbgateway_revolutcomexpected_amount = (float)$order->get_meta('shieldclimb_revolutcom_expected_amount', true); 242 $shieldclimbgateway_revolutcomthreshold = 0.60 * $shieldclimbgateway_revolutcomexpected_amount; 243 if ( $shieldclimbgateway_revolutcomfloatpaid_value_coin < $shieldclimbgateway_revolutcomthreshold ) { 244 // Mark the order as failed and add an order note 245 $order->update_status('failed', __( 'Payment received is less than 60% of the order total. Customer may have changed the payment values on the checkout page.', 'shieldclimb-high-risk-card-payment-gateway' )); 246 /* translators: 1: Transaction ID */ 247 $order->add_order_note(sprintf( __( 'Order marked as failed: Payment received is less than 60%% of the order total. Customer may have changed the payment values on the checkout page. TXID: %1$s', 'shieldclimb-high-risk-card-payment-gateway' ), $shieldclimbgateway_revolutcompaid_txid_out)); 248 return array( 'message' => 'Order status changed to failed due to partial payment.' ); 249 250 } else { 239 251 // Change order status to processing 240 252 $order->payment_complete(); … … 243 255 // Return success response 244 256 return array( 'message' => 'Order marked as paid and status changed.' ); 257 } 245 258 } else { 246 259 // Return error response if conditions are not met -
shieldclimb-high-risk-card-payment-gateway/trunk/includes/shieldclimb-payment-functions.php
r3411577 r3413314 48 48 'shieldclimb-bitnovo' => 10, 49 49 'shieldclimb-guardarian' => 20, 50 'shieldclimb-mercuryo' => 15,51 50 'shieldclimb-sardine' => 30, 52 51 'shieldclimb-transak' => 15, … … 59 58 'shieldclimb-binance' => 15, 60 59 'shieldclimb-utorg' => 50, 60 'shieldclimb-revolut' => 8, 61 61 'shieldclimb-transfi' => 70 62 62 ]; -
shieldclimb-high-risk-card-payment-gateway/trunk/readme.txt
r3411577 r3413314 5 5 Requires at least: 5.8 6 6 Tested up to: 6.9 7 Stable tag: 1.2. 77 Stable tag: 1.2.8 8 8 Requires PHP: 7.2 9 9 WC requires at least: 5.8 … … 105 105 == Changelog == 106 106 107 = V1.2.8 = 108 109 * **Updated**: Payment providers list 110 * **Fixed**: Bug 111 107 112 = V1.2.7 = 108 113 -
shieldclimb-high-risk-card-payment-gateway/trunk/shieldclimb-high-risk-card-payment-gateway.php
r3411577 r3413314 4 4 * Plugin URI: https://shieldclimb.com/high-risk-payment-gateway/ 5 5 * Description: High-Risk Business Card Payment Gateway with Instant Payouts to Your USDC Wallet and Full Chargeback Protection – Includes Automatic Order Processing and Auto-Hide Provider Options by Region and Minimum Balance (For setting up go to > Woocommerce > Setting > Payments tab). 6 * Version: 1.2. 76 * Version: 1.2.8 7 7 * Requires Plugins: woocommerce 8 8 * Requires at least: 5.8 … … 88 88 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-stripe.php'); // Include the payment gateway class 89 89 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-rampnetwork.php'); // Include the payment gateway class 90 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-mercuryo.php'); // Include the payment gateway class91 90 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-transak.php'); // Include the payment gateway class 92 91 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-guardarian.php'); // Include the payment gateway class … … 102 101 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-cryptix.php'); // Include the payment gateway class 103 102 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-customprovider.php'); // Include the payment gateway class 104 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-hostedshieldclimb.php'); // Include the payment gateway class105 103 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-interac.php'); // Include the payment gateway class 106 104 include_once(plugin_dir_path(__FILE__) . 'includes/class-shieldclimb-kryptonim.php'); // Include the payment gateway class
Note: See TracChangeset
for help on using the changeset viewer.