bagisto-payment-method-development
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePayment Method Development
支付方法开发
Overview
概述
Creating custom payment methods in Bagisto allows you to integrate any payment gateway or processor with your store. Whether you need local payment methods, cryptocurrency payments, or specialized payment flows, custom payment methods provide the flexibility your business requires.
For our tutorial, we'll create a Custom Stripe Payment method that demonstrates all the essential concepts you need to build any type of payment solution.
在Bagisto中创建自定义支付方法,可让您将任意支付网关或处理器与店铺集成。无论您需要本地支付方式、加密货币支付还是特殊支付流程,自定义支付方法都能为您的业务提供所需的灵活性。
在本教程中,我们将创建一个自定义Stripe支付方法,展示构建任何类型支付解决方案所需的所有核心概念。
When to Apply
适用场景
Activate this skill when:
- Creating new payment methods
- Integrating payment gateways (Stripe, PayPal, Razorpay, etc.)
- Adding payment options to checkout
- Modifying existing payment configurations
- Creating admin configuration for payment methods
在以下场景中启用此技能:
- 创建新的支付方法
- 集成支付网关(Stripe、PayPal、Razorpay等)
- 在结账流程中添加支付选项
- 修改现有支付配置
- 为支付方法创建后台管理配置
Bagisto Payment Architecture
Bagisto支付架构
Bagisto's payment system is built around a flexible method-based architecture that separates configuration from business logic.
Bagisto的支付系统基于灵活的方法型架构构建,将配置与业务逻辑分离。
Core Components
核心组件
| Component | Purpose | Location |
|---|---|---|
| Payment Methods Configuration | Defines payment method properties | |
| Payment Classes | Contains payment processing logic | |
| System Configuration | Admin interface forms | |
| Service Provider | Registers payment method | |
| 组件 | 用途 | 位置 |
|---|---|---|
| 支付方法配置 | 定义支付方法属性 | |
| 支付类 | 包含支付处理逻辑 | |
| 系统配置 | 后台管理界面表单 | |
| 服务提供者 | 注册支付方法 | |
Key Features
核心特性
- Flexible Payment Processing: Support for redirects, APIs, webhooks, or custom flows.
- Configuration Management: Admin-friendly settings interface.
- Multi-channel Support: Different settings per sales channel.
- Security Ready: Built-in CSRF protection and secure handling.
- Extensible Architecture: Easy integration with third-party gateways.
- 灵活的支付处理:支持重定向、API、Webhook或自定义流程。
- 配置管理:便于后台操作的设置界面。
- 多渠道支持:每个销售渠道可设置不同配置。
- 安全就绪:内置CSRF保护与安全处理机制。
- 可扩展架构:轻松集成第三方网关。
Reference files — load only what the current task needs
参考文件——仅加载当前任务所需内容
| File | Load when |
|---|---|
| implementation.md | Building a payment method — the step-by-step guide |
| payment-api.md | The base payment class and the methods to override |
| reference.md | Built-in methods, best practices, a complex integration example, package layout, testing, pitfalls |
REQUIRED SUB-SKILL: Use bagisto-change-verification before calling any change done.
| 文件 | 加载场景 |
|---|---|
| implementation.md | 构建支付方法——分步指南 |
| payment-api.md | 基础支付类及需重写的方法 |
| reference.md | 内置方法、最佳实践、复杂集成示例、包结构、测试、常见陷阱 |
必备子技能:在完成任何更改前,使用bagisto-change-verification进行验证。