Skip to content

Commit

Permalink
Merge pull request #4 from 64robots/feature/add-latest-invoice-to-sub…
Browse files Browse the repository at this point in the history
…scription

Feature/add latest invoice to subscription
  • Loading branch information
jonrobinson authored Jul 20, 2020
2 parents 5d142ba + 0ae7aef commit 7fdea68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Objects/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class Subscription

public $created;

public $latest_invoice_id;

public function __construct($subscription = null)
{
if ($subscription && get_class($subscription) === 'Stripe\Subscription') {
Expand All @@ -49,6 +51,7 @@ public function setFromStripe(StripeSubscription $subscription)
$this->id = $subscription->id;
$this->plan_id = $subscription->plan ? $subscription->plan->id : null;
$this->customer_id = $subscription->customer;
$this->latest_invoice_id = $subscription->latest_invoice;
$this->amount = $subscription->plan ? $subscription->plan->amount * $subscription->quantity : null;

$this->billing = $subscription->billing; // `charge_automatically`
Expand Down

0 comments on commit 7fdea68

Please sign in to comment.