Skip to content

Commit

Permalink
Merge pull request #304 from razorpay/1cc-line-item
Browse files Browse the repository at this point in the history
Bug fix for line item int issue
  • Loading branch information
ChetanGN authored Jun 24, 2022
2 parents 748ffbe + 2191804 commit 58233f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 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.0
Stable tag: 3.9.1
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,9 @@ This is compatible with WooCommerce>=2.4, including the new 3.0 release. It has

== Changelog ==

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

= 3.9.0 =
* Added Cart line item for magic checkout.
* Bug fix in COD min/max amount restriction for magic checkout.
Expand Down
10 changes: 5 additions & 5 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.0
* Stable tag: 3.9.0
* Version: 3.9.1
* Stable tag: 3.9.1
* Author: Team Razorpay
* WC tested up to: 6.4.1
* Author URI: https://razorpay.com
Expand Down Expand Up @@ -885,11 +885,11 @@ 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'] = (int)$item->get_subtotal_tax()*100;
$data['line_items'][$i]['quantity'] = $item->get_quantity();
$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'] = $productDetails['weight'];
$data['line_items'][$i]['weight'] = 0; // Quick fix to handle the int issue from BE
$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 58233f8

Please sign in to comment.