use parent shopify integration

master
Yixian 2 years ago
parent 9c09129010
commit 12de9f4856

@ -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.beans.LoginInfo;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; 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.ShopifyAccessToken;
import au.com.royalpay.shopify.entity.ShopifyPermissionURL; import au.com.royalpay.shopify.entity.ShopifyPermissionURL;
import au.com.royalpay.shopify.service.ShopifyAuthService; import au.com.royalpay.shopify.service.ShopifyAuthService;
@ -29,9 +30,8 @@ public class ShopifyMerchantAuthApplication {
@Value("${shopify.version:2022-01}") @Value("${shopify.version:2022-01}")
private String apiVersion; private String apiVersion;
@Value("${shopify.auth.apiKey}") @Autowired
private String apiKey; private ShopifyAuthProvider authProvider;
private static final String PAYMENT_SETTING_URL = "https://%s/services/payments_partners/gateways/%s/settings"; private static final String PAYMENT_SETTING_URL = "https://%s/services/payments_partners/gateways/%s/settings";
@Autowired @Autowired
@ -104,7 +104,7 @@ public class ShopifyMerchantAuthApplication {
throw new BadRequestException("Payment app setting error"); 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); return accessToken.setRedirectUrl(redirectUrl);
} }

Loading…
Cancel
Save