diff --git a/woo-razorpay.php b/woo-razorpay.php index 94eec85b..65c044f2 100644 --- a/woo-razorpay.php +++ b/woo-razorpay.php @@ -1142,6 +1142,7 @@ protected function createRazorpayOrderId($orderId, $sessionKey) } catch (Exception $e) { + rzpLogInfo("rzp order error " . $e->getMessage()); return $e; } @@ -1239,7 +1240,7 @@ private function getOrderCreationData($orderId) } $data = array( - 'receipt' => $orderId, + 'receipt' => (string)$orderId, 'amount' => (int) round($order->get_total() * 100), 'currency' => $this->getOrderCurrency($order), 'payment_capture' => ($this->getSetting('payment_action') === self::AUTHORIZE) ? 0 : 1, @@ -1309,16 +1310,16 @@ public function orderArg1CC($data, $order) $data['line_items'][$i]['type'] = $type; $data['line_items'][$i]['sku'] = $product->get_sku(); - $data['line_items'][$i]['variant_id'] = $item->get_variation_id(); - $data['line_items'][$i]['product_id'] = $product->get_id(); + $data['line_items'][$i]['variant_id'] = (string)$item->get_variation_id(); + $data['line_items'][$i]['product_id'] = (string)$product->get_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]['quantity'] = (int)$item->get_quantity(); $data['line_items'][$i]['name'] = mb_substr($item->get_name(), 0, 125, "UTF-8"); $data['line_items'][$i]['description'] = mb_substr($item->get_name(), 0, 250,"UTF-8"); $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(); + $data['line_items'][$i]['image_url'] = (string)($productImage? wp_get_attachment_url( $productImage ) : ""); + $data['line_items'][$i]['product_url'] = (string)$product->get_permalink(); $i++; }