首页>代码>基于SSM开发校园在线点餐系统,包括前后台>/基于SSM-校园在线点餐系统/源码/school-order/src/main/java/com/cxs/biyesheji/config/PaypalConfig.java
package com.cxs.biyesheji.config; import com.paypal.base.rest.APIContext; import com.paypal.base.rest.OAuthTokenCredential; import com.paypal.base.rest.PayPalRESTException; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import java.util.HashMap; import java.util.Map; /** * @author 伍诚泽 * @date 2020/2/25 * Use for */ @Configuration @ComponentScan("com.cxs.biyesheji") @PropertySource("classpath:paypal.properties") public class PaypalConfig { @Value("${paypal.client.app}") private String clientId; @Value("${paypal.client.secret}") private String clientSecret; @Value("${paypal.mode}") private String mode; @Bean public Map<String, String> paypalSdkConfig(){ Map<String, String> sdkConfig = new HashMap<>(); sdkConfig.put("mode", mode); return sdkConfig; } @Bean public OAuthTokenCredential authTokenCredential(){ return new OAuthTokenCredential(clientId, clientSecret, paypalSdkConfig()); } @Bean public APIContext apiContext() throws PayPalRESTException { APIContext apiContext = new APIContext(authTokenCredential().getAccessToken()); apiContext.setConfigurationMap(paypalSdkConfig()); return apiContext; } }
最近下载更多
qtingchh LV3
5月3日
微信网友_6927932988952576 LV12
3月30日
SZEPEZS LV8
3月15日
廖业贵 LV18
2月24日
admin_z LV22
2月5日
打烊1234 LV2
1月26日
全栈小陈 LV4
1月21日
一勺枣糕 LV3
1月11日
全栈小白 LV34
2023年12月21日
2775645521 LV5
2023年10月12日
最近浏览更多
qtingchh LV3
5月3日
微信网友_6507988172591104 LV1
5月1日
kenhomeliu LV29
4月30日
2821484071 LV1
4月26日
玖零定制问题修复 LV34
4月4日
微信网友_6927932988952576 LV12
3月30日
wanglinddad LV54
3月28日
xiaozhi丶 LV14
3月24日
vluobo LV1
3月19日
SZEPEZS LV8
3月15日