Linksfield Developer
OverviewCube APIsOld version
OverviewCube APIsOld version
  1. Mall APIs
  • CSSS APIs
    • Overview
    • Internationalization
    • Status code
    • Sign code Example
    • SIM
      • Get all SIM cards info
      • Get real-time info about one SIM card
      • Get the SIM Cards in use
    • Usage
      • Example Query the traffic usage of a single SIM card
      • Batch querying SIM card usage
      • Example Query the daily usage
      • Batch querying the usage in a specified month
    • Plan
      • Get data plan
      • Order data plan
      • Bulk order package
      • Renew your data plan
      • Query the package order information
      • To enable the order
      • Cancel an unenabled package order
      • End package orders early
      • [不推荐]停机/暂停流量套餐订单
      • [不推荐]复机/重新启动流量套餐订单
      • 【不推荐】分页批量(查询)同步设备可订购套餐
    • SMS
      • Send SMS
    • Customized
      • Order OTA Plan
      • Query the remaing data by MNO side
  • Notification
    • Notification Overview
    • Notification status code
    • 流量使用量API预警
      POST
    • 短信下行回调
      POST
    • 短信上行回调
      POST
    • 短信上行回调(区分文本二进制)
      POST
    • Plan Order Status Change notification (IMSI)
      POST
  • Mall APIs
    • Mall全局说明
    • Mall业务流程
    • Mall签名代码示例
    • APP调用Stripe的SDK示例说明
    • Vshop
      • 卡片登录验证
      • 获取可购套餐商品列表
      • 创建用户订单
      • 查询自动续费记录
      • 关闭自动续费
      • 查询正在使用、未启用订单
      • 获取生效中的自动续费
      • 关闭自动续费
      • 用户下单(第三方支付)
    • Payment
      • 获取stripe单次支付权限
      • 获取Stripe订阅支付权限
      • 创建Stripe订阅/自动续费
      • 支付结果查询
      • 支付结果确认
    • Notification
      • 消息推送
  • eSIM QR Mall APIs
    • Introduction
    • Pre - order
      POST
    • v1.1/payment/webhook
      POST
    • User login
      POST
    • My eSIM Detail
      POST
    • Pre - order v1.2
      POST
  1. Mall APIs

APP调用Stripe的SDK示例说明

示例说明#

本文档仅供参考,实际请以Stripe官方开发者文档为准
 Stripe iOS SDK下载地址
Stripe SDK Version:20.0.0  (最新版本api请参考对应版本)

流程说明#

1.
通过STPPaymentCardTextField创建支付输入框cardTextField
2.
调取收银台/Payment接口/stripePay 或/stripeAutoPay,获取publicKey和clientSecret
3.
使用publicKey初始化Stripe
  Stripe.setDefaultPublishableKey(publicKey) 
5.
使用卡信息创建对象STPPaymentMethodParams的实例
     let cardParams = cardTextField.cardParams
     let paymentMethodParams = STPPaymentMethodParams(card: cardParams, billingDetails: nil, metadata: nil)
8.
使用clientSecret创建对象STPPaymentIntentParams的实例
 let paymentIntentParams = STPPaymentIntentParams(clientSecret: clientSecret)
 paymentIntentParams.paymentMethodParams = paymentMethodParams
11.
通过stripe的confirmPayment方法开始执行付款操作
// Submit the payment
let paymentHandler = STPPaymentHandler.shared()
paymentHandler.confirmPayment(withParams: paymentIntentParams, authenticationContext: self) { [weak self] (status, paymentIntent, error) in
//返回支付结果,根据结果执行后续流程
}
Modified at 2022-10-04 23:23:51
Previous
Mall签名代码示例
Next
卡片登录验证
Built with