@ emulers/ stripe (英语)
Frape API与客户的模拟,支付方法,客户会话,支付意向,收费,产品,价格,以及离职会话. 包括一个主机取出页面和提供网页.
部分 模拟 ——为CI和无网络沙盒提供本地出入口替换服务.
安装
npm install @emulators/stripe
终点
客户
POST /v1/customers——创建客户GET /v1/customers/:id——取回客户POST /v1/customers/:id- 更新客户DELETE /v1/customers/:id- 删除客户GET /v1/customers- 名单客户
支付方法
GET /v1/payment_methods- 清单支付方法
客户会话
POST /v1/customer_sessions——创建客户会话
支付意向
POST /v1/payment_intents- 建立付款意向GET /v1/payment_intents/:id——收回付款意向POST /v1/payment_intents/:id- 更新付款意向POST /v1/payment_intents/:id/confirm- 确认付款意向POST /v1/payment_intents/:id/cancel- 取消付款意向GET /v1/payment_intents- 清单付款意向
收费
GET /v1/charges/:id——取回电费GET /v1/charges- 清单收费
产品
POST /v1/products——创建产品GET /v1/products/:id——取回产品GET /v1/products- 清单产品
价格
POST /v1/prices——创价GET /v1/prices/:id- 收回价格GET /v1/prices- 清单价格
退出会话
POST /v1/checkout/sessions——创建退出会话GET /v1/checkout/sessions/:id——检索会话POST /v1/checkout/sessions/:id/expire过期的会话GET /v1/checkout/sessions- 列表会话( filter bycustomer, (中文(简体) ),status, (中文(简体) ),payment_status(中文(简体) )GET /checkout/:id——主机取出页面(HTML)POST /checkout/:id/complete——完整支付流程
网络呼号
将事件交付到配置的 Webhook URL :
- 配置有秘密的 Webhooks 包括
Stripe-Signature: t=<timestamp>,v1=<signature>,签名<timestamp>.<raw body> checkout.session.completed——当退出会话完成时checkout.session.expired——退出会话到期后
种子配置
stripe:
customers:
- name: Test Customer
email: [email protected]
products:
- name: Pro Plan
prices:
- product: Pro Plan
unit_amount: 2000
currency: usd
recurring:
interval: month