kep concept
- resource: REST风格对于资源的一种定义
- payment: 付款
- sale:销售
- fund:资金
- refund:退款
- authorization:授权
- capture:捕获(这里是去获取fund的意思)
原文链接:
https://developer.paypal.com/docs/api/payments/
The payments namespace contains resource collections for payment, sale, refund, authorization, and capture.
payments 是 和支付相关的 resource 的集合。
payments 下面有以下 resource
- payments:付款
- Sale transactions:交易
- Refunds:退款
- Authorization:授权
- Capture:获取
- Orders:订单
- Shared Payments definitions
- Errors
Validation Messages
这些 resource 可以 理解为数据库中的一张表,或者一种实体。可以针对该resource 进行操作。其他都还好理解。
Authorization and Capture 是什么鬼?
查看资料后发现,Authorization 和 Capture 是 信用卡付款的实现方式。
Credit Authorization and Capture 这样就好理解了。
信用卡付款,会涉及这两种 RESOURCE 的操作。
猜想,这两种API在SDK的信用卡付款中会被调用。
关于Credit Authorization和Capture的解释和实现方式,见以下连接:
http://www.paymentsgateway.com.au/what-you-need-to-know/payments-gateway-authorization-and-capture
在线信用卡支付流程:
1. 商家向用户请求,一定金额的支付;
2. 用户授权该笔交易金额; Authorization
3. 商家向该信用卡获取金额; Capture
(资金并非在用户同意授权后就直接打到商家的结算账号上)
payments,sale transactions and Orders 有啥区别?
payments 和 sale transactions 还是很好区分的。
payments 是付款,sale transactions 交易,一个payments可以包含多个transactions。在SDK中,payment OBJECT 包含 transaction 集合。
那么 orders 是什么鬼?订单。有什么用吗?