承接 mmollick/laravel-stripe 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mmollick/laravel-stripe

Composer 安装命令:

composer require mmollick/laravel-stripe

包简介

README 文档

README

Integrates the Stripe PHP library with Laravel 4 via a ServiceProvider, config, and Blade extensions.

This is originally a fork from the abodeo/laravel-stripe package

Installation

Include laravel-stripe as a dependency in composer.json:

"mmollick/laravel-stripe": "dev-master"

Run composer install to download the dependency.

Add the ServiceProvider to your provider array within app/config/app.php:

'providers' => array(

    'MMollick\LaravelStripe\LaravelStripeServiceProvider'

)

Finally, publish the configuration files via php artisan config:publish abodeo/laravel-stripe.

Configuration

It is advisable to keep all of your sensitive configuration out of your configuration files. Instead, utilize Laravel's "dot files" to keep them out of source control and making them easily overridable on dev environments.

If you have not setup a "dot file", read Laravel's "Protecting Sensitive Configuration for detailed setup instructions. To quickly get up an running, simply create a .env.php file in the same directory as you apps composer.json file. Then add your Stripe API credentials to it.

<?php
return array(
  'stripe' => array(
    'api_key' => 'my-api-key',
    'publishable_key' => 'my-pub-key',
    'api_version' => null,
  )
);

If you insist on keeping your API credentials in your config, you can set your API Key and Publishable Key in app/config/packages/abodeo/laravel-stripe/stripe.php:

<?php
return array(
  'api_key' => 'my-api-key',
  'publishable_key' => 'my-pub-key',
  'api_version' => null,
);

Usage

You may use the Stripe PHP Library as normal within your application. The Stripe API will automatically be configured with your API Key, so you do not need to set it yourself.

In your Blade views, you may output your Stripe Publishable Key using the @stripeKey Blade extension:

<script src="https://checkout.stripe.com/v2/checkout.js" class="stripe-button"
          data-key="@stripeKey"
          data-amount="5000" data-description="One year's subscription"></script>

统计信息

  • 总下载量: 4.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-07-07