Skip to content

Commit

Permalink
Add support for different currencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbitron committed Feb 25, 2017
1 parent 2c344f8 commit 4b511da
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/Console/Commands/CreateStripePlans.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace Gilbitron\Laravel\Spark\Console\Commands;

use Stripe;
use Illuminate\Console\Command;
use Laravel\Cashier\Cashier;
use Laravel\Spark\Spark;
use Stripe;

class CreateStripePlans extends Command
{
Expand Down Expand Up @@ -62,14 +63,15 @@ protected function createStripePlans($plans)
$this->line('Stripe plan ' . $plan->id . ' already exists');
} else {
Stripe\Plan::create([
'id' => $plan->id,
'name' => Spark::$details['product'] . ' ' . $plan->name . ' ($' . $plan->price .
' ' . $plan->interval . ')',
'amount' => $plan->price * 100,
'interval' => str_replace('ly', '', $plan->interval),
'currency' => 'usd',
'statement_descriptor' => Spark::$details['vendor'],
'trial_period_days' => $plan->trialDays,
'id' => $plan->id,
'name' => Spark::$details['product'] . ' ' . $plan->name . ' (' .
Cashier::usesCurrencySymbol() . $plan->price . ' ' . $plan->interval .
')',
'amount' => $plan->price * 100,
'interval' => str_replace('ly', '', $plan->interval),
'currency' => Cashier::usesCurrency(),
'statement_descriptor' => Spark::$details['vendor'],
'trial_period_days' => $plan->trialDays,
]);

$this->info('Stripe plan created: ' . $plan->id);
Expand Down

0 comments on commit 4b511da

Please sign in to comment.