File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,25 @@ function razorpay_link($params)
212212 $ checkoutUrl = 'https://checkout.razorpay.com/v1/checkout.js ' ;
213213 $ callbackUrl = (substr ($ params ['systemurl ' ], -1 ) === '/ ' ) ? $ params ['systemurl ' ] . 'modules/gateways/razorpay/razorpay.php?merchant_order_id= ' . $ invoiceId : $ params ['systemurl ' ] . '/modules/gateways/razorpay/razorpay.php?merchant_order_id= ' . $ invoiceId ;
214214
215- $ razorpayOrderId = createRazorpayOrderId ($ params );
215+ $ rzpOrderMapping = new RZPOrderMapping (razorpay_MetaData ()['DisplayName ' ]);
216+
217+ try
218+ {
219+ $ existingRazorpayOrderId = $ rzpOrderMapping ->getRazorpayOrderID ($ invoiceId );
220+ }
221+ catch (Exception $ e )
222+ {
223+ logTransaction (razorpay_MetaData ()['DisplayName ' ], $ e ->getMessage (), "Unsuccessful - Fetch Order " );
224+ }
225+
226+ if (isset ($ existingRazorpayOrderId ) === false )
227+ {
228+ $ razorpayOrderId = createRazorpayOrderId ($ params );
229+ }
230+ else
231+ {
232+ $ razorpayOrderId = $ existingRazorpayOrderId ;
233+ }
216234
217235 return <<<EOT
218236<form name="razorpay-form" id="razorpay-form" action=" $ callbackUrl" method="POST">
You can’t perform that action at this time.
0 commit comments