diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/ShopifyWebhooksController.java b/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/ShopifyWebhooksController.java index 493c61d22..8145a3407 100644 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/ShopifyWebhooksController.java +++ b/src/main/java/au/com/royalpay/payment/manage/shopify/hooks/ShopifyWebhooksController.java @@ -9,6 +9,7 @@ import au.com.royalpay.payment.manage.shopify.store.domain.entity.ShopifyStore; import au.com.royalpay.payment.manage.shopify.store.domain.service.ShopifyStoreService; import au.com.royalpay.payment.manage.shopify.support.ShopifyEndpoint; import au.com.royalpay.payment.manage.shopify.support.ShopifyHttpUtils; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -75,7 +76,7 @@ public class ShopifyWebhooksController { throw new ShopifyRequestVerifyException("Unauthorized"); } - ShopifyShopRedactCommand shopifyShopRedactCommand = JSONObject.parseObject(requestBody, ShopifyShopRedactCommand.class); + ShopifyShopRedactCommand shopifyShopRedactCommand = JSON.parseObject(requestBody, ShopifyShopRedactCommand.class); ShopifyStore shopifyShop = shopifyStoreService.getByShopifyShop(shopifyShopRedactCommand.getShop_domain()); if (shopifyShop == null) { return; diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/support/HmacVerificationUtil.java b/src/main/java/au/com/royalpay/payment/manage/shopify/support/HmacVerificationUtil.java index 9a27d5464..992b0252e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/support/HmacVerificationUtil.java +++ b/src/main/java/au/com/royalpay/payment/manage/shopify/support/HmacVerificationUtil.java @@ -62,7 +62,7 @@ public class HmacVerificationUtil { } private static boolean isHex(String str) { - return str != null && str.toUpperCase(Locale.ROOT).matches("^[0-9A-F]$"); + return str != null && str.toUpperCase(Locale.ROOT).matches("^[0-9A-F]+$"); } private static byte[] hmac(String input, String key, HmacAlgorithms algorithm) {