ruudk / payment-stripe-bundle

此包已被弃用,不再维护。未建议替换包。

一个提供对Stripe API访问的Symfony2 Bundle。基于JMSPaymentCoreBundle。

安装次数 12,527

依赖者: 0

建议者: 0

安全: 0

星标: 7

关注者: 4

分支: 8

公开问题: 0

类型:symfony-bundle

2.0.0 2016-07-19 08:35 UTC

This package is auto-updated.

Last update: 2022-02-01 12:35:18 UTC


README

一个提供对Stripe API访问的Symfony2 Bundle。基于JMSPaymentCoreBundle。

安装

步骤1:使用Composer安装包

php composer.phar require symfony/event-dispatcher:^2.8
php composer.phar require ruudk/payment-stripe-bundle

步骤2:启用bundle

在kernel中启用bundle

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...

        new Ruudk\Payment\StripeBundle\RuudkPaymentStripeBundle(),
    );
}

步骤3:配置

将以下内容添加到您的config.yml中

ruudk_payment_stripe:
    api_key:  Your API key
    logger:   true/false   # Default true
    methods:
      - checkout

请确保为每个启用的支付方式在predefined_data中设置description

$form = $this->getFormFactory()->create('jms_choose_payment_method', null, array(
    'amount'   => $order->getAmount(),
    'currency' => 'EUR',
    'predefined_data' => array(
        'stripe_checkout' => array(
            'description' => 'My product',
        ),
    ),
));

有关更多信息,请参阅JMSPaymentCoreBundle文档