edouardkombo/ek-stripe-payment-bundle

为Symfony2提供最先进的Stripe支付插件。

dev-master 2014-07-27 07:21 UTC

This package is not auto-updated.

Last update: 2024-09-24 02:32:12 UTC


README

关于

EKSTripePaymentBundle 是为 Symfony2 提供的最先进的 Stripe PHP API。它可以帮助您

  • 通过 Stripe 表单进行即时支付
  • 创建客户
  • 创建计划
  • 订阅计划并取消订阅
  • 永远不会在您的服务器内部存储信用卡号

此插件基于 CABIN 设计模式。

要求

需要 PHP 版本 5.3 或更高。

安装

在您的 composer.json 中注册插件

{
    "require": {
        "edouardkombo/ek-stripe-payment-bundle": "dev-master"
    }
}

现在,安装供应商

php composer.phar install

在您的 app/appKernel.php 中注册 MultiStepFormsBundle 命名空间

new EdouardKombo\EkStripePaymentBundle\EkStripePaymentBundle(),

文档

将配置参数复制到 app/config/config.yml

ek_stripe_payment:   
    current_environment:    'test'  #test or live allowed
    default_currency:       'EUR'    
    api_url:                'https://api.stripe.com/v1'
    charges_suburl:         '/charges'
    customers_suburl:       '/customers'
    plans_suburl:           '/plans'
    subscriptions_suburl:   '/subscriptions'
    invoices_suburl:        '/invoices'    
    api_checkout_url:       'https://checkout.stripe.com/checkout.js'
    api_version:            '2014-01-31'
    test:
        secret_api:         'sk_test_xxxxxxxxxxxxxxxxxxxxxxxx'
        publishable_api:    'pk_test_xxxxxxxxxxxxxxxxxxxxxxxx'
    live:
        secret_api:         'sk_live_xxxxxxxxxxxxxxxxxxxxxxxx'
        publishable_api:    'pk_live_xxxxxxxxxxxxxxxxxxxxxxxx'

然后,将路由复制到 app/config/routing.yml

ek_stripe_payment:
    resource: "@EkStripePaymentBundle/Resources/config/routing.yml"
    prefix:   /{_locale}/payment

要查看具体示例,以下是一些您可以使用该插件测试的链接

https:///app_dev.php/{your_locale}/payment/card #List of payment buttons for instant payment and subscriptions
https:///app_dev.php/{your_locale}/payment/plan #Create a plan

您只需查看:Controller/StripeController.php 文件。

注意:此插件发展迅速,但您现在可以使用它进行生产。

贡献

每个项目都有其特定的特性。请随意帮助我将此插件与您的需求结合起来。如果您想帮助我改进此插件,请确保它符合 PSR 编码标准。最简单的贡献方式是在仓库的分支或您自己的分支上工作,而不是在已安装的版本上。

问题

可以通过Github问题跟踪器提交错误报告和功能请求。

如需更多信息,请直接联系我:edouard.kombo@gmail.com