而在春季啓動應用IM整合貝寶讓這個問題春天的PayPal API方面的問題
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
***************************
APPLICATION FAILED TO START
***************************
Description:
Field apiContext in com.bookstore.service.impl.PaypalService required a bean of type 'com.paypal.base.rest.APIContext' that could not be found.
Action:
Consider defining a bean of type 'com.paypal.base.rest.APIContext' in your configuration.
我主要的樣子
@SpringBootApplication
@EnableAutoConfiguration
@Configuration
@ComponentScan
public class BookstoreAngularApplication implements CommandLineRunner {
錯誤點的地方,我已經使用的API方面的服務paypal
import com.paypal.api.payments.Transaction;
import com.paypal.base.rest.APIContext;
import com.paypal.base.rest.PayPalRESTException;
@Autowired
private APIContext apiContext;
public Payment createPayment(
Double total,
String currency,
PaypalPaymentMethod method,
PaypalPaymentIntent intent,
String description,
String cancelUrl,
String successUrl) throws PayPalRESTException{
Amount amount = new Amount();
amount.setCurrency(currency);
amount.setTotal(total.toString());
Transaction transaction = new Transaction();
transaction.setDescription(description);
transaction.setAmount(amount);
List<Transaction> transactions = new ArrayList<>();
transactions.add(transaction);
Payer payer = new Payer();
payer.setPaymentMethod(method.toString());
Payment payment = new Payment();
payment.setIntent(intent.toString());
payment.setPayer(payer);
payment.setTransactions(transactions);
RedirectUrls redirectUrls = new RedirectUrls();
redirectUrls.setCancelUrl(cancelUrl);
redirectUrls.setReturnUrl(successUrl);
payment.setRedirectUrls(redirectUrls);
return payment.create(apiContext);
}
public Payment executePayment(String paymentId, String payerId) throws PayPalRESTException{
Payment payment = new Payment();
payment.setId(paymentId);
PaymentExecution paymentExecute = new PaymentExecution();
paymentExecute.setPayerId(payerId);
return payment.execute(apiContext, paymentExecute);
}
我有項目運行貝寶sdk工作正常,但是當我將它添加到我的應用程序im生病荷蘭國際集團的PayPal API方面的這個錯誤
我已經配置它們,並在Appproperties中添加了鍵並將它們命名爲檢查我的更新樓上的請求 – tero17
但現在是什麼錯誤消息?它仍然是一樣的嗎? – Rafa
他們從開始@Rafa – tero17