Skip to content

Commit

Permalink
Merge pull request #567 from razorpay/magic_inline_script
Browse files Browse the repository at this point in the history
[PLUGIN1CC-3814] Sending config integration value in magic inline script
  • Loading branch information
ChetanGN authored Aug 6, 2024
2 parents ba0b5e8 + 0563b80 commit 603e6b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -3027,8 +3027,10 @@ function enqueueScriptsFor1cc()

wp_register_script( '1cc_razorpay_config', '' );
wp_enqueue_script( '1cc_razorpay_config' );
wp_add_inline_script( '1cc_razorpay_config', '!function(){var o=document.querySelector("meta[name=rzp_merchant_key]");o&&(window.Razorpay||(window.Razorpay={}),"object"==typeof window.Razorpay&&(window.Razorpay.config||(window.Razorpay.config={}),window.Razorpay.config.merchant_key=o.getAttribute("value")))}();');

wp_add_inline_script(
"1cc_razorpay_config",
'!function(){var o=document.querySelector("meta[name=rzp_merchant_key]");o&&(window.Razorpay||(window.Razorpay={}),"object"==typeof window.Razorpay&&(window.Razorpay.config||(window.Razorpay.config={}),window.Razorpay.config.integration="magic-wooc",window.Razorpay.config.merchant_key=o.getAttribute("value")))}();',
);
wp_register_script('1cc_razorpay_checkout', RZP_CHECKOUTJS_URL, null, null);
wp_enqueue_script('1cc_razorpay_checkout');
wp_register_style(RZP_1CC_CSS_SCRIPT, plugin_dir_url(__FILE__) . 'public/css/1cc-product-checkout.css', null, null);
Expand Down

0 comments on commit 603e6b9

Please sign in to comment.