From 12de9f4856a5fa1046ee55f789e557fb987b5cce Mon Sep 17 00:00:00 2001 From: Yixian Date: Thu, 5 May 2022 15:18:22 +0800 Subject: [PATCH] use parent shopify integration --- .../application/ShopifyMerchantAuthApplication.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/application/ShopifyMerchantAuthApplication.java b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/application/ShopifyMerchantAuthApplication.java index fcdde71e1..fc0eb098b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/application/ShopifyMerchantAuthApplication.java +++ b/src/main/java/au/com/royalpay/payment/manage/shopify/auth/domain/application/ShopifyMerchantAuthApplication.java @@ -11,6 +11,7 @@ import au.com.royalpay.payment.manage.shopify.store.domain.service.ShopifyStoreS import au.com.royalpay.payment.manage.signin.beans.LoginInfo; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.tools.exceptions.BadRequestException; +import au.com.royalpay.shopify.config.ShopifyAuthProvider; import au.com.royalpay.shopify.entity.ShopifyAccessToken; import au.com.royalpay.shopify.entity.ShopifyPermissionURL; import au.com.royalpay.shopify.service.ShopifyAuthService; @@ -29,9 +30,8 @@ public class ShopifyMerchantAuthApplication { @Value("${shopify.version:2022-01}") private String apiVersion; - @Value("${shopify.auth.apiKey}") - private String apiKey; - + @Autowired + private ShopifyAuthProvider authProvider; private static final String PAYMENT_SETTING_URL = "https://%s/services/payments_partners/gateways/%s/settings"; @Autowired @@ -104,7 +104,7 @@ public class ShopifyMerchantAuthApplication { throw new BadRequestException("Payment app setting error"); } - String redirectUrl = String.format(PAYMENT_SETTING_URL, shop, apiKey); + String redirectUrl = String.format(PAYMENT_SETTING_URL, shop, authProvider.getNewestAuthConfig().getClientSecret()); return accessToken.setRedirectUrl(redirectUrl); }