|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|