需要helpppp ..有点卡住以下问题-
我正在开发Web应用程序并使用Stripe付款,并且只是尝试使用以下代码进行收费。用户输入信用卡信息,它成功创建了令牌。.但是,Stripe Charge始终失败,并出现以下错误。我没有任何互联网连接问题-也许与appengine不接受Stripe的回复有关?
条纹收费链接-https://stripe.com/docs/api/charges/create
:com.stripe.exception.ApiConnectionException:在对条带(https://api.stripe.com)的API请求期间IOException:api.stripe.com请检查您的Internet连接,然后重试。仍然存在,您应该在https://twitter.com/stripestatus上查看Stripe的服务状态,或通过support@stripe.com告知我们。
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
.
.
.
Stripe.apiKey = "sk_test_****************";
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("amount", 999);
chargeParams.put("currency", "usd");
chargeParams.put("description", "Charge for test@gmail.com");
chargeParams.put("source", "tok_visa");
try {
Charge.create(chargeParams); /// <<<-- it fails here, no issue with internet connection.
} catch (StripeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
.
.
.
} //end of doPost
错误日志:
<stderr>: com.stripe.exception.ApiConnectionException: IOException during API request to Stripe (https://api.stripe.com): api.stripe.com Please check your internet connection and try again. If this problem persists,you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com.
at com.stripe.net.LiveStripeResponseGetter.makeUrlConnectionRequest(LiveStripeResponseGetter.java:444)
at com.stripe.net.LiveStripeResponseGetter.getStripeResponse(LiveStripeResponseGetter.java:592)
at com.stripe.net.LiveStripeResponseGetter.rawRequest(LiveStripeResponseGetter.java:501)
at com.stripe.net.LiveStripeResponseGetter.staticRequest(LiveStripeResponseGetter.java:526)
at com.stripe.net.LiveStripeResponseGetter.request(LiveStripeResponseGetter.java:83)
at com.stripe.net.ApiResource.request(ApiResource.java:204)
at com.stripe.model.Charge.create(Charge.java:372)
at com.stripe.model.Charge.create(Charge.java:364)
at com.jagdish.ViewController.doPost(ViewController.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1772)
我正在使用
<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
<version>7.11.0</version>
</dependency>