我尝试遵循相同的文档并配置贝宝提前配置,现在我可以访问贝宝 getway。
实际上我花了几个小时在这里有点棘手。为了了解我在浏览器中遇到的错误,我终于知道了它是由于一些我无法在我的新贝宝控制器类下调用的包。:P
所以你的控制器类看起来像这样
package com.mycompany.controller.paypal;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.broadleafcommerce.core.checkout.service.exception.CheckoutException;
import org.broadleafcommerce.core.payment.service.exception.PaymentException;
import org.broadleafcommerce.core.pricing.service.exception.PricingException;
import org.broadleafcommerce.vendor.paypal.web.controller.BroadleafPayPalController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class PayPalController extends BroadleafPayPalController
{
@RequestMapping({"/paypal/checkout"})
public String paypalCheckout(HttpServletRequest request)
throws PaymentException
{
return super.paypalCheckout(request);
}
@RequestMapping({"/paypal/process"})
public String paypalProcess(HttpServletRequest request, HttpServletResponse response, Model model, @RequestParam String token, @RequestParam("PayerID") String payerID)
throws CheckoutException, PricingException
{
return super.paypalProcess(request, response, model, token, payerID);
}
}
以前我现在正在导入所有软件包,并且我遇到了与您遇到的 paypal 相同的问题。一旦我导入所有的包,它对我来说就像一个魅力。
现在请检查并让我知道您在执行此操作时是否遇到任何错误?
问候, Ankit Patni