资源简介
代码片段和文件信息
package com.ourslook.qcure.api.pay;
import com.ourslook.qcure.utils.RRException;
import com.ourslook.qcure.utils.annotation.IgnoreAuth;
import com.ourslook.qcure.utils.pay.stripepay.StripePayUtil;
import com.ourslook.qcure.utils.result.XaResult;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.Charge;
import com.stripe.model.Customer;
import com.stripe.model.Refund;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* @author dazr
* @version V1.0
*
* 美国跨境支付stripe 支付相关接口
* @date 2019年6月10日 下午1:00:00
*
* 卡支付:https://stripe.com/docs/sources/cards
* api首页:https://stripe.com/docs/api
*
* mvn jar 搜索:com.stripe stripe-java 即可
*/
@Api(value = “pay_stripe“ description = “美国跨境支付strpe“ position = 10)
@Controller
@CrossOrigin
@RequestMapping(“/api/stripe“)
public class ApiStripeController {
private Logger logger = LoggerFactory.getLogger(getClass());
/**
* 步骤一:客户端初始化代码 创建Source对象
* 文档路径 https://stripe.com/docs/sources/cards#create-source
* 代码片段 https://stripe.com/docs/stripe-js/elements/quickstart
*
*
* 步骤二 Charge the Source 【为Source支付】
* 2.1:Attaching the Source to a Customer 根据客户端source获取客户的详细信息Customer
* 文档路径/代码片段:https://stripe.com/docs/sources/cards#charge-request
* 2.2:Making a charge request to finalize the payment 提出收费要求以完成付款
* 文档路径/代码片段:https://stripe.com/docs/sources/cards#making-a-charge-request-to-finalize-the-payment
*
*
*
* 步骤三 Step 3: Confirm that the charge has succeeded 可以通过自定义回调webhook事件确定是否支付成功
* https://stripe.com/docs/sources/cards#charge-confirmation
* EVENT:charge.succeeded
* EVENT:charge.failed
*
*
* http://127.0.0.1:8001/qcure/api/stripe/creditCardPay
*/
@SuppressWarnings(“all“)
@ApiOperation(value = “信用卡支付“ notes = “Charge the Source【为Source支付】 ,具体分为两步【1: 根据客户端创建的source获取顾客信息 Customer 2:支付成功】;针对:Visa、Mastercard和American Express 支付“)
@ResponseBody
@IgnoreAuth
@RequestMapping(value = “creditCardCharges“ method = RequestMethod.GET)
public XaResult creditCardPay(
@ApiParam(value = “客户端输入了信用卡账号之后创建的source对象详见 文档 【Step 1: Create a Source object】字段名:stripeSourceId“ defaultValue = “src_18eYalAHEMiOZZp1l9ZTjSU0“) @RequestParam(value = “stripeSourceId“ required = true) String stripeSourceId
@ApiParam(value = “email字段名:email请填写自己的email“ defaultValue = “ab601026460@163.com“) @RequestParam(value = “email“ required = false) String email
HttpServletRequest request
) throws Excepti
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-07-03 16:25 stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\
文件 4639 2019-06-16 15:19 stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\stripeClient.html
目录 0 2019-07-03 16:29 __MACOSX\
目录 0 2019-07-03 16:29 __MACOSX\stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\
文件 228 2019-06-16 15:19 __MACOSX\stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\._stripeClient.html
文件 6148 2019-07-03 16:25 stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\.DS_Store
文件 120 2019-07-03 16:25 __MACOSX\stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\._.DS_Store
目录 0 2019-07-03 16:29 stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\JAVA\
文件 483 2019-07-03 16:29 stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\JAVA\mvn.txt
目录 0 2019-07-03 16:29 __MACOSX\stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\JAVA\
文件 474 2019-07-03 16:29 __MACOSX\stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\JAVA\._mvn.txt
文件 8385 2019-07-03 16:19 stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\JAVA\ApiStripeController.java
文件 1880 2019-07-03 16:28 stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\JAVA\StripePayUtil.java
文件 176 2019-07-03 16:28 __MACOSX\stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\JAVA\._StripePayUtil.java
文件 233 2019-07-03 16:25 stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\stripe.txt
文件 317 2019-07-03 16:25 __MACOSX\stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\._stripe.txt
文件 24 2019-06-10 14:28 stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\stripe_backup_code.txt
文件 399 2019-06-10 14:28 __MACOSX\stripe-java-鍥藉鏀粯-鏀寔(visa mastercard alipay weixin绛夌瓑)\._stripe_backup_code.txt
- 上一篇:bria安卓版,最好用的软电话
- 下一篇:httpcore-4.2.5.jar
评论
共有 条评论