Skip to content

Commit

Permalink
Merge pull request #307 from razorpay/1cc-line-item
Browse files Browse the repository at this point in the history
1cc line item char limit fix
  • Loading branch information
ChetanGN authored Jun 29, 2022
2 parents dbf7c8c + 656f30a commit 0b725e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: razorpay
Tags: razorpay, payments, india, woocommerce, ecommerce
Requires at least: 3.9.2
Tested up to: 5.9
Stable tag: 3.9.1
Stable tag: 3.9.2
Requires PHP: 5.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -41,6 +41,10 @@ This is compatible with WooCommerce>=2.4, including the new 3.0 release. It has

== Changelog ==

= 3.9.2 =
* Bug fix cart line item char limit issue for magic checkout.
* Bug fix callback issue in order placed through admin panel.

= 3.9.1 =
* Bug fix cart line item int issue for magic checkout.

Expand Down
10 changes: 4 additions & 6 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Plugin Name: Razorpay for WooCommerce
* Plugin URI: https://razorpay.com
* Description: Razorpay Payment Gateway Integration for WooCommerce
* Version: 3.9.1
* Stable tag: 3.9.1
* Version: 3.9.2
* Stable tag: 3.9.2
* Author: Team Razorpay
* WC tested up to: 6.4.1
* Author URI: https://razorpay.com
Expand Down Expand Up @@ -885,11 +885,9 @@ public function orderArg1CC($data, $order)
$data['line_items'][$i]['variant_id'] = $item->get_variation_id();
$data['line_items'][$i]['price'] = (empty($productDetails['price'])=== false) ? round(wc_get_price_excluding_tax($product)*100) + round($item->get_subtotal_tax()*100 / $item->get_quantity()) : 0;
$data['line_items'][$i]['offer_price'] = (empty($productDetails['sale_price'])=== false) ? (int) $productDetails['sale_price']*100 : $productDetails['price']*100;
$data['line_items'][$i]['tax_amount'] = 0; // Quick fix to handle the int issue from BE
$data['line_items'][$i]['quantity'] = (int)$item->get_quantity();
$data['line_items'][$i]['name'] = $item->get_name();
$data['line_items'][$i]['description'] = $item->get_name();
$data['line_items'][$i]['weight'] = 0; // Quick fix to handle the int issue from BE
$data['line_items'][$i]['name'] = substr($item->get_name(), 0, 125);
$data['line_items'][$i]['description'] = substr($item->get_name(), 0, 250);
$productImage = $product->get_image_id()?? null;
$data['line_items'][$i]['image_url'] = $productImage? wp_get_attachment_url( $productImage ) : null;
$data['line_items'][$i]['product_url'] = $product->get_permalink();
Expand Down

0 comments on commit 0b725e2

Please sign in to comment.