Plugin Directory

Changeset 3478157


Ignore:
Timestamp:
03/09/2026 01:17:43 PM (44 hours ago)
Author:
knitpay
Message:

v9.2.2.3:
Paytm: Updated API URLs.
Knit Pay UPI: Added support for SMS Payment Link in template 5.

Location:
knit-pay/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • knit-pay/trunk/gateways/PaymentMethods.php

    r3458322 r3478157  
    1111
    1212    const UPI_COLLECT = 'upi_collect';
     13
     14    const SMS_PAYMENT_LINK = 'sms_payment_link';
    1315
    1416    /**
  • knit-pay/trunk/gateways/paytm/src/API.php

    r3470121 r3478157  
    2121    public function get_endpoint() {
    2222        if ( $this->test_mode ) {
    23             return 'https://securegw-stage.paytm.in/';
     23            return 'https://securestage.paytmpayments.com/';
    2424        }
    25         return 'https://securegw.paytm.in/';
     25        return 'https://secure.paytmpayments.com/';
    2626    }
    2727
  • knit-pay/trunk/gateways/paytm/src/Gateway.php

    r3470121 r3478157  
    22namespace KnitPay\Gateways\Paytm;
    33
     4use Exception;
     5use KnitPay\Gateways\PaymentMethods;
     6use KnitPay\Utils as KnitPayUtils;
     7use PaytmChecksum;
    48use Pronamic\WordPress\Pay\Core\Gateway as Core_Gateway;
     9use Pronamic\WordPress\Pay\Core\PaymentMethod;
    510use Pronamic\WordPress\Pay\Payments\Payment;
    611use Pronamic\WordPress\Pay\Payments\PaymentStatus;
    7 use Exception;
    8 use PaytmChecksum;
    9 use Pronamic\WordPress\Pay\Core\PaymentMethod;
    10 use KnitPay\Utils as KnitPayUtils;
    11 use KnitPay\Gateways\PaymentMethods;
    1212
    1313/**
     
    110110
    111111        // Create an array having all required parameters for creating checksum.
    112         // @see https://developer.paytm.com/docs/api/initiate-transaction-api/
     112        // @see https://www.paytmpayments.com/docs/api/initiate-transaction-api
    113113        $paytmParams = [];
    114114
  • knit-pay/trunk/gateways/upi-qr/src/Gateway.php

    r3448567 r3478157  
    406406    }
    407407
     408    private function mask_phone_number( $phone ) {
     409        if ( empty( $phone ) ) {
     410            return '';
     411        }
     412
     413        // Remove any non-numeric characters
     414        $phone_digits = preg_replace( '/[^0-9]/', '', $phone );
     415
     416        if ( strlen( $phone_digits ) < 4 ) {
     417            return str_repeat( '*', strlen( $phone_digits ) );
     418        }
     419
     420        // Show first 2 and last 2 digits, mask the middle
     421        $masked = substr( $phone_digits, 0, 2 ) . str_repeat( '*', strlen( $phone_digits ) - 4 ) . substr( $phone_digits, -2 );
     422
     423        return $masked;
     424    }
     425
    408426    public function enqueue_scripts() {
    409427        \wp_register_script(
  • knit-pay/trunk/gateways/upi-qr/src/css/template5.css

    r3448567 r3478157  
    225225
    226226/* UPI ID Instructions Section */
    227 .upi-instructions {
     227.payment-instructions {
    228228    padding: 32px 24px;
    229229    text-align: center;
     
    765765    }
    766766
    767     .upi-instructions {
     767    .payment-instructions {
    768768        padding: 24px 20px;
    769769    }
  • knit-pay/trunk/gateways/upi-qr/src/view/payment-page.php

    r3448567 r3478157  
    3636        $order_id        = $payment->get_source_id();
    3737        $customer_upi_id = $payment->get_meta( 'customer_upi_id' );
     38        $payment_method  = $payment->get_payment_method();
    3839       
    3940        $amount                  = $payment->get_total_amount()->format_i18n( '%1$s%2$s' );
  • knit-pay/trunk/gateways/upi-qr/src/view/template5.php

    r3448567 r3478157  
    2626        </div>
    2727
    28         <!-- Conditional Section: UPI Instructions OR QR Code -->
    29         <?php if ( isset( $customer_upi_id ) && ! empty( $customer_upi_id ) ) { ?>
     28        <!-- Conditional Section: UPI Collect Instructions OR SMS Payment Link OR QR Code -->
     29        <?php if ( 'sms_payment_link' === $payment_method ) { ?>
     30            <!-- SMS Payment Link Instructions Section -->
     31            <div class="payment-instructions">
     32                <div class="instruction-icon dashicons dashicons-testimonial"></div>
     33
     34                <h3 class="instruction-title">Payment Link Sent!</h3>
     35
     36                <div class="instruction-steps">
     37                    <div class="instruction-step">
     38                        <div class="step-number">1</div>
     39                        <div class="step-text">Check your phone for the SMS</div>
     40                    </div>
     41                    <div class="instruction-step">
     42                        <div class="step-number">2</div>
     43                        <div class="step-text">Open the payment link received</div>
     44                    </div>
     45                    <div class="instruction-step">
     46                        <div class="step-number">3</div>
     47                        <div class="step-text">Complete the payment securely</div>
     48                    </div>
     49                </div>
     50
     51                <div class="upi-id-display">
     52                    <div class="upi-id-label">SMS sent to:</div>
     53                    <div class="upi-id-value"><?php echo $this->mask_phone_number( $payment->get_billing_address()->get_phone() ); ?></div>
     54                </div>
     55
     56                <div class="waiting-indicator">
     57                    <div class="spinner"></div>
     58                    <span>Waiting for payment confirmation...</span>
     59                </div>
     60            </div>
     61        <?php } elseif ( isset( $customer_upi_id ) && ! empty( $customer_upi_id ) ) { ?>
    3062            <!-- UPI ID Instructions Section -->
    31             <div class="upi-instructions">
     63            <div class="payment-instructions">
    3264                <div class="instruction-icon dashicons dashicons-smartphone"></div>
    3365
     
    115147        }
    116148
    117         if ( ( ! isset( $customer_upi_id ) || empty( $customer_upi_id ) ) && $is_android ) {
     149        if ( ( ! isset( $customer_upi_id ) || empty( $customer_upi_id ) ) && 'sms_payment_link' !== $payment_method && $is_android ) {
    118150            ?>
    119151            <div class="payment-methods">
  • knit-pay/trunk/knit-pay.php

    r3478090 r3478157  
    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.2.2.2
     7 * Version: 9.2.2.3
    88 * Requires at least: 6.2
    99 * Requires PHP: 8.1
  • knit-pay/trunk/readme.txt

    r3478090 r3478157  
    55Tested up to: 7.0
    66Requires PHP: 8.1
    7 Stable tag: 9.2.2.2
     7Stable tag: 9.2.2.3
    88License: GPL-3.0-or-later
    99
Note: See TracChangeset for help on using the changeset viewer.