Skip to content

Commit

Permalink
Merge pull request #33 from iamsayan/develop
Browse files Browse the repository at this point in the history
v1.4.1 added
  • Loading branch information
iamsayan authored Feb 7, 2024
2 parents c252c43 + 7e5b110 commit 06ef6bd
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 28 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog
All notable changes to this project will be documented in this file.

## 1.4.1
Release Date: January 7, 2024

* Fixed: CSS issues.
* Tweak: PHP 8.3 Support.

## 1.4.0
Release Date: January 6, 2024

Expand Down
2 changes: 1 addition & 1 deletion includes/blocks/assets/blocks.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities'), 'version' => '0e052535178266cbf1ab');
<?php return array('dependencies' => array('react', 'react-dom', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities'), 'version' => '4723d4f56e6951dfc10c');
2 changes: 1 addition & 1 deletion includes/blocks/assets/blocks.js

Large diffs are not rendered by default.

48 changes: 42 additions & 6 deletions includes/class-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,42 @@
*/
class UPI_WC_Payment_Gateway extends \WC_Payment_Gateway {

/**
* Unique id for the gateway.
* @var string
*
*/
public $id = 'wc-upi';

protected $instructions;
protected $instructions_mobile;
protected $confirm_message;
protected $thank_you;
protected $payment_status;
protected $name;
protected $vpa;
protected $pay_button;
protected $mc_code;
protected $upi_address;
protected $require_upi;
protected $theme;
protected $transaction_id;
protected $transaction_image;
protected $intent;
protected $download_qr;
protected $qrcode_mobile;
protected $hide_on_mobile;
protected $email_enabled;
protected $email_subject;
protected $email_heading;
protected $additional_content;
protected $default_status;

/**
* Constructor for the gateway.
*/
public function __construct() {

$this->id = 'wc-upi';

$this->icon = apply_filters( 'upiwc_gateway_icon', UPIWC_URL . 'includes/icon/payment.gif' );
$this->has_fields = true;
$this->method_title = __( 'UPI QR Code', 'upi-qr-code-payment-for-woocommerce' );
Expand Down Expand Up @@ -213,7 +243,7 @@ public function init_form_fields() {
'title' => __( 'Thank You Message:', 'upi-qr-code-payment-for-woocommerce' ),
'type' => 'textarea',
'description' => __( 'This displays a message to customer after a successful payment is made.', 'upi-qr-code-payment-for-woocommerce' ),
'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' ),
'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' ),
'desc_tip' => false,
),
'hide_on_mobile' => array(
Expand Down Expand Up @@ -325,21 +355,21 @@ public function init_form_fields() {
'title' => __( 'Instructions:', 'upi-qr-code-payment-for-woocommerce' ),
'type' => 'textarea',
'description' => __( 'Instructions that will be added to the order pay popup on desktop devices.', 'upi-qr-code-payment-for-woocommerce' ),
'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' ),
'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' ),
'desc_tip' => false,
),
'instructions_mobile' => array(
'title' => __( 'Mobile Instructions:', 'upi-qr-code-payment-for-woocommerce' ),
'type' => 'textarea',
'description' => __( 'Instructions that will be added to the order pay popup on mobile devices.', 'upi-qr-code-payment-for-woocommerce' ),
'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' ),
'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' ),
'desc_tip' => false,
),
'confirm_message' => array(
'title' => __( 'Confirm Message:', 'upi-qr-code-payment-for-woocommerce' ),
'type' => 'textarea',
'description' => __( 'This displays a message to customer as payment processing text.', 'upi-qr-code-payment-for-woocommerce' ),
'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' ),
'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' ),
'desc_tip' => false,
),
'email' => array(
Expand Down Expand Up @@ -1028,6 +1058,12 @@ public function render_column( $column_name, $order_object_or_post_id ) {
echo ( ! empty( $content ) ) ? $content : '';
}

/**
* Get UPI ID
*
* @param WC_Order $order Order data.
* @return string
*/
private function get_vpa( $order ) {
$payee_vpa = apply_filters( 'upiwc_payee_vpa', $this->vpa, $order );

Expand Down
2 changes: 1 addition & 1 deletion includes/css/checkout.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions includes/css/checkout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,11 @@

&.block {
padding: 8px 12px;
min-height: 42px;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
min-height: 40px;
}
}

.selectize-control:before{
.selectize-control:before {
content: '@';
position: absolute;
display: block;
Expand Down
2 changes: 1 addition & 1 deletion includes/js/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
return false;
}

let paymentLink = 'pay?pa=' + upiwcData.payee_vpa + '&pn=' + upiwcData.payee_name + '&am=' + upiwcData.order_amount + '&tr=' + upiwcData.order_key.replace( 'wc_order_', '' ) + '&mc=' + upiwcData.mc_code + '&cu=INR&tn=' + upiwcData.payee_name + '+OrderId:' + upiwcData.order_number;
let paymentLink = 'pay?pa=' + upiwcData.payee_vpa + '&pn=' + upiwcData.payee_name + '&am=' + upiwcData.order_amount + '&tr=' + upiwcData.order_key.replace( 'wc_order_', '' ) + '&mc=' + upiwcData.mc_code + '&orgid=000000&mode=01&cu=INR&tn=' + upiwcData.payee_name + '+OrderId:' + upiwcData.order_number;
paymentLink = encodeURI( paymentLink.replace(/\s/g, '') );

$( 'body' ).on( 'contextmenu', '.upiwc-payment-qr-code img', function( e ) {
Expand Down
Loading

0 comments on commit 06ef6bd

Please sign in to comment.