|
18 | 18 | */ |
19 | 19 | class UPI_WC_Payment_Gateway extends \WC_Payment_Gateway { |
20 | 20 |
|
| 21 | + /** |
| 22 | + * Unique id for the gateway. |
| 23 | + * @var string |
| 24 | + * |
| 25 | + */ |
| 26 | + public $id = 'wc-upi'; |
| 27 | + |
| 28 | + protected $instructions; |
| 29 | + protected $instructions_mobile; |
| 30 | + protected $confirm_message; |
| 31 | + protected $thank_you; |
| 32 | + protected $payment_status; |
| 33 | + protected $name; |
| 34 | + protected $vpa; |
| 35 | + protected $pay_button; |
| 36 | + protected $mc_code; |
| 37 | + protected $upi_address; |
| 38 | + protected $require_upi; |
| 39 | + protected $theme; |
| 40 | + protected $transaction_id; |
| 41 | + protected $transaction_image; |
| 42 | + protected $intent; |
| 43 | + protected $download_qr; |
| 44 | + protected $qrcode_mobile; |
| 45 | + protected $hide_on_mobile; |
| 46 | + protected $email_enabled; |
| 47 | + protected $email_subject; |
| 48 | + protected $email_heading; |
| 49 | + protected $additional_content; |
| 50 | + protected $default_status; |
| 51 | + |
21 | 52 | /** |
22 | 53 | * Constructor for the gateway. |
23 | 54 | */ |
24 | 55 | public function __construct() { |
25 | | - |
26 | | - $this->id = 'wc-upi'; |
| 56 | + |
27 | 57 | $this->icon = apply_filters( 'upiwc_gateway_icon', UPIWC_URL . 'includes/icon/payment.gif' ); |
28 | 58 | $this->has_fields = true; |
29 | 59 | $this->method_title = __( 'UPI QR Code', 'upi-qr-code-payment-for-woocommerce' ); |
@@ -213,7 +243,7 @@ public function init_form_fields() { |
213 | 243 | 'title' => __( 'Thank You Message:', 'upi-qr-code-payment-for-woocommerce' ), |
214 | 244 | 'type' => 'textarea', |
215 | 245 | 'description' => __( 'This displays a message to customer after a successful payment is made.', 'upi-qr-code-payment-for-woocommerce' ), |
216 | | - 'default' => __( 'Thank you for your payment. Your transaction has been completed, and your order has been successfully placed. Please check you Email inbox for details. Please check your bank account statement to view transaction details.', 'upi-qr-code-payment-for-woocommerce' ), |
| 246 | + 'default' => __( 'Thank you for your order. Your transaction has been completed, and order has been successfully placed. Please check you Email inbox for details.', 'upi-qr-code-payment-for-woocommerce' ), |
217 | 247 | 'desc_tip' => false, |
218 | 248 | ), |
219 | 249 | 'hide_on_mobile' => array( |
@@ -325,21 +355,21 @@ public function init_form_fields() { |
325 | 355 | 'title' => __( 'Instructions:', 'upi-qr-code-payment-for-woocommerce' ), |
326 | 356 | 'type' => 'textarea', |
327 | 357 | 'description' => __( 'Instructions that will be added to the order pay popup on desktop devices.', 'upi-qr-code-payment-for-woocommerce' ), |
328 | | - 'default' => __( 'Scan the QR Code with any UPI apps like BHIM, Paytm, Google Pay, PhonePe or any Banking UPI app to make payment for this order. After successful payment, enter the UPI Reference ID or Transaction Number and your UPI ID in the next screen and submit the form. We will manually verify this payment against your 12-digits UPI Reference ID or Transaction Number (e.g. 301422121258) and your UPI ID.', 'upi-qr-code-payment-for-woocommerce' ), |
| 358 | + 'default' => __( 'Please scan the QR code with any UPI app to pay for your order. After payment, enter the UPI Reference ID or Transaction Number (e.g. 401422121258) on the next screen. We\'ll manually verify your payment using the provided information.', 'upi-qr-code-payment-for-woocommerce' ), |
329 | 359 | 'desc_tip' => false, |
330 | 360 | ), |
331 | 361 | 'instructions_mobile' => array( |
332 | 362 | 'title' => __( 'Mobile Instructions:', 'upi-qr-code-payment-for-woocommerce' ), |
333 | 363 | 'type' => 'textarea', |
334 | 364 | 'description' => __( 'Instructions that will be added to the order pay popup on mobile devices.', 'upi-qr-code-payment-for-woocommerce' ), |
335 | | - 'default' => __( 'Scan the QR Code with any UPI apps like BHIM, Paytm, Google Pay, PhonePe or any Banking UPI app to make payment for this order. After successful payment, enter the UPI Reference ID or Transaction Number and your UPI ID in the next screen and submit the form. We will manually verify this payment against your 12-digits UPI Reference ID or Transaction Number (e.g. 301422121258) and your UPI ID.', 'upi-qr-code-payment-for-woocommerce' ), |
| 365 | + 'default' => __( 'Please scan the QR code with any UPI app to pay for your order. After payment, enter the UPI Reference ID or Transaction Number (e.g. 401422121258) on the next screen. We\'ll manually verify your payment using the provided information.', 'upi-qr-code-payment-for-woocommerce' ), |
336 | 366 | 'desc_tip' => false, |
337 | 367 | ), |
338 | 368 | 'confirm_message' => array( |
339 | 369 | 'title' => __( 'Confirm Message:', 'upi-qr-code-payment-for-woocommerce' ), |
340 | 370 | 'type' => 'textarea', |
341 | 371 | 'description' => __( 'This displays a message to customer as payment processing text.', 'upi-qr-code-payment-for-woocommerce' ), |
342 | | - 'default' => __( 'Click Confirm, only after amount deducted from your account. We will manually verify your transaction. Are you sure?', 'upi-qr-code-payment-for-woocommerce' ), |
| 372 | + 'default' => __( 'Please ensure that the amount has been deducted from your account before clicking "Confirm". We will manually verify your transaction once submitted.', 'upi-qr-code-payment-for-woocommerce' ), |
343 | 373 | 'desc_tip' => false, |
344 | 374 | ), |
345 | 375 | 'email' => array( |
@@ -1028,6 +1058,12 @@ public function render_column( $column_name, $order_object_or_post_id ) { |
1028 | 1058 | echo ( ! empty( $content ) ) ? $content : '—'; |
1029 | 1059 | } |
1030 | 1060 |
|
| 1061 | + /** |
| 1062 | + * Get UPI ID |
| 1063 | + * |
| 1064 | + * @param WC_Order $order Order data. |
| 1065 | + * @return string |
| 1066 | + */ |
1031 | 1067 | private function get_vpa( $order ) { |
1032 | 1068 | $payee_vpa = apply_filters( 'upiwc_payee_vpa', $this->vpa, $order ); |
1033 | 1069 |
|
|
0 commit comments