driveop/stripe-bundle

Stripe API 的简单 Symfony 扩展包。

安装: 138

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 2

开放问题: 0

类型:symfony-bundle

1.1.4 2020-10-08 17:40 UTC

This package is auto-updated.

Last update: 2024-09-09 02:24:27 UTC


README

Stripe API 的简单 Symfony 扩展包。

仅 SMS/WhatsApp!

设置

步骤 1: 使用 composer 下载 DriveOpStripeBundle

在您的 composer.json 中添加 Stripe 扩展包

{
    "require": {
        "driveop/stripe-bundle": "^1.0"
    }
}

现在,运行以下命令让 composer 下载扩展包

$ php composer.phar update "driveop/stripe-bundle"

步骤 2: 启用扩展包

在 kernel 中启用扩展包

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new DriveOp\StripeBundle\DriveOpStripeBundle()
    );
}

步骤 3: 添加配置

# app/config/config.yml
driveop:
        stripe:
            stripe_private_key:    %stripe_private_key%

用法

使用服务

<?php
        $stripeClient = $this->get('stripe_client');
?>

##示例

###创建客户 & 订阅

<?php 
    $customer = $stripeClient->createCustomer($token, $email, $name, $phone);

    // Store customer information

    $subsciption = $stripeClient->createSubscription($customerId, $planId);

    // Store subscription information

?>