Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLUG-2874 woocommerce checkout 360 #578

Draft
wants to merge 43 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e42ad04
PLUG-2874 woocommerce checkout 360
abdulwahidsharief Dec 6, 2024
9c15d68
error handling from API
abdulwahidsharief Dec 11, 2024
775240d
cod changes
abdulwahidsharief Dec 11, 2024
0be1c58
added getDisplayConfig
abdulwahidsharief Dec 11, 2024
1c1c803
changes for display config
abdulwahidsharief Dec 12, 2024
8b8c4d4
changed checkout 360 links
abdulwahidsharief Dec 12, 2024
864d26a
["PO-252"]("WooCommerce : add isset validation for webhook payload") …
rohitcbr Dec 12, 2024
6b05b40
updated configuration link
abdulwahidsharief Dec 18, 2024
eb425a2
changed COD logic
abdulwahidsharief Dec 19, 2024
34b8341
added validation checks
abdulwahidsharief Dec 20, 2024
38bbc8b
enclosed conditions
abdulwahidsharief Dec 24, 2024
d3ac4a8
added post installation flag update
abdulwahidsharief Dec 26, 2024
2b6490c
repositioned auto post installation call
abdulwahidsharief Dec 27, 2024
5c413ca
changed config display for COD
abdulwahidsharief Dec 30, 2024
1fdbfe4
1cc changes for cache issue
abdulwahidsharief Jan 2, 2025
6d6764e
changed evaluate call to install call
abdulwahidsharief Jan 2, 2025
587f894
suffixed transient
abdulwahidsharief Jan 2, 2025
9b9dfc6
PO-272 validation for instrumentation
abdulwahidsharief Jan 13, 2025
af2180d
PO-273 added section restriction to load page
abdulwahidsharief Jan 13, 2025
6979d38
return if key_id is empty
abdulwahidsharief Jan 13, 2025
7c702e5
indentation fix
abdulwahidsharief Jan 13, 2025
f505eea
Merge pull request #581 from razorpay/auth-validation-checks
abdulwahidsharief Jan 13, 2025
a6d88e0
Merge branch 'master' into wc-section-limitation
abdulwahidsharief Jan 13, 2025
a8a7dec
Merge pull request #582 from razorpay/wc-section-limitation
abdulwahidsharief Jan 13, 2025
1560bca
PO-274 version bump 4.7.0
abdulwahidsharief Jan 14, 2025
8fb6a1d
Merge pull request #583 from razorpay/version_bump_4.7.0
abdulwahidsharief Jan 14, 2025
ee57388
PLUG-2874 woocommerce checkout 360
abdulwahidsharief Dec 6, 2024
d83e370
error handling from API
abdulwahidsharief Dec 11, 2024
29d8ed4
cod changes
abdulwahidsharief Dec 11, 2024
bf0d2dc
added getDisplayConfig
abdulwahidsharief Dec 11, 2024
a4983cf
changes for display config
abdulwahidsharief Dec 12, 2024
1dca101
changed checkout 360 links
abdulwahidsharief Dec 12, 2024
8cc9a09
updated configuration link
abdulwahidsharief Dec 18, 2024
859752d
changed COD logic
abdulwahidsharief Dec 19, 2024
bac7884
added validation checks
abdulwahidsharief Dec 20, 2024
cad12ae
enclosed conditions
abdulwahidsharief Dec 24, 2024
7c1234b
added post installation flag update
abdulwahidsharief Dec 26, 2024
507b0df
repositioned auto post installation call
abdulwahidsharief Dec 27, 2024
31535fe
changed config display for COD
abdulwahidsharief Dec 30, 2024
2f23b80
1cc changes for cache issue
abdulwahidsharief Jan 2, 2025
303fb02
changed evaluate call to install call
abdulwahidsharief Jan 2, 2025
5bf59b2
suffixed transient
abdulwahidsharief Jan 2, 2025
fecc0f4
Merge branch 'wc_checkout360' of github.com:razorpay/razorpay-woocomm…
abdulwahidsharief Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/api/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function initCartCommon()

}

add_action('setup_extra_setting_fields', 'addMagicCheckoutSettingFields');
add_action('setup_extra_setting_fields_1cc', 'addMagicCheckoutSettingFields');

function addMagicCheckoutSettingFields(&$defaultFormFields)
{
Expand Down
52 changes: 28 additions & 24 deletions includes/razorpay-affordability-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,37 +526,41 @@ function updateAffordabilityWidgetSettings()
woocommerce_update_options(getAffordabilityWidgetSettings());
try
{
if (isset($_POST['woocommerce_razorpay_key_id']) and
empty($_POST['woocommerce_razorpay_key_id']) === false and
isset($_POST['woocommerce_razorpay_key_secret']) and
empty($_POST['woocommerce_razorpay_key_secret']) === false)
{
$api = new Api($_POST['woocommerce_razorpay_key_id'], $_POST['woocommerce_razorpay_key_secret']);
}
else
$checkout360status = (get_option('rzp_checkout360_status') === 'yes') ? true : false;

if ($checkout360status === false)
{
$api = new Api(get_option('woocommerce_razorpay_settings')['key_id'],get_option('woocommerce_razorpay_settings')['key_secret']);
}
if (isset($_POST['woocommerce_razorpay_key_id']) and
empty($_POST['woocommerce_razorpay_key_id']) === false and
isset($_POST['woocommerce_razorpay_key_secret']) and
empty($_POST['woocommerce_razorpay_key_secret']) === false)
{
$api = new Api($_POST['woocommerce_razorpay_key_id'], $_POST['woocommerce_razorpay_key_secret']);
}
else
{
$api = new Api(get_option('woocommerce_razorpay_settings')['key_id'],get_option('woocommerce_razorpay_settings')['key_secret']);
}

$merchantPreferences = $api->request->request('GET', 'accounts/me/features');
$merchantPreferences = $api->request->request('GET', 'accounts/me/features');

if (isset($merchantPreferences) === false or
isset($merchantPreferences['assigned_features']) === false)
{
throw new Exception("Error in Api call.");
}
if (isset($merchantPreferences) === false or
isset($merchantPreferences['assigned_features']) === false)
{
throw new Exception("Error in Api call.");
}

update_option('rzp_afd_enable', 'no');
foreach ($merchantPreferences['assigned_features'] as $preference)
{
if ($preference['name'] === 'affordability_widget' or
$preference['name'] === 'affordability_widget_set')
update_option('rzp_afd_enable', 'no');
foreach ($merchantPreferences['assigned_features'] as $preference)
{
update_option('rzp_afd_enable', 'yes');
break;
if ($preference['name'] === 'affordability_widget' or
$preference['name'] === 'affordability_widget_set')
{
update_option('rzp_afd_enable', 'yes');
break;
}
}
}

}
catch (\Exception $e)
{
Expand Down
Loading
Loading