Card Element vs. Payment Element

同属 Stripe.js v3,但新旧不同

较旧

Card Element

elements.create('card')
一个单一的卡信息输入框(卡号 + 有效期 + CVC 合并)。 样式由开发者控制,只支持信用卡/借记卡,不支持 Apple Pay、Google Pay 等。

较新

Payment Element

elements.create('payment')
一体化支付面板,自动展示当前账户 / 地区可用的所有支付方式(卡、 Apple Pay、Google Pay、SEPA…)。样式与交互由 Stripe 托管。

点击上方按钮创建 PaymentIntent 并加载支付面板

两者核心区别

维度 Card Element(旧) Payment Element(新)
组件名elements.create('card')elements.create('payment')
支付方式仅信用卡 / 借记卡卡 + Apple Pay + Google Pay + SEPA 等多种
UI 控制开发者自定义样式Stripe 托管,自动适配
初始化方式无需 clientSecret 即可挂载需先创建 PaymentIntent 获得 clientSecret
确认方式confirmCardPayment()confirmPayment()
Stripe 推荐度仍支持,逐步过渡当前首推

← 返回首页(Card Element)  ·  Stripe.js v2 演示