Bean クラス - CartItemBean が二重になっている状況に陥っています。
public double getTotalCost() {
return dblTotalCost;
また、SetExpressCheckOutService クラスでは、金額を文字列に入れる必要があります。
String amount = "";
CartItemBean details = new CartItemBean();
amount = details.getTotalCost();
try {
//calling the service, setting up the checkoutpage
String token = setExpressCheckoutService.setExpressCheckout(userId, amount,
currencyCode, returnURL, cancelURL, paymentAction);
log.info("Url to redirect to: https://www.sandbox.paypal.com
/webscr?cmd=_express-checkout&useraction=commit&token=" + token);
} catch (PayPalException e) {
// Log the exception
log.log(Level.WARNING, "Paypal exception", e);
}
}
このような問題を克服する方法を誰かが教えてくれることを願っています。
ありがとう。