Skip to content

Commit

Permalink
Stripe 2019-10-17
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Jun 21, 2024
1 parent f5c1559 commit ee20948
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion classes/TestStripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getSubscription($args) {
'latest_invoice' => [],
'customer' => [
'id' => 'cus_123',
'account_balance' => 0,
'balance' => 0,
'default_source' => [],
'invoice_settings' => [
'default_payment_method' => [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

$quota_status = $subscription->quota_status();
$account_balance = $subscription->stripe->customer->account_balance;
$balance = $subscription->stripe->customer->balance;
if ($subscription->upcoming) {
if ($subscription->upcoming->total < 0) {
# Going to be credited
$account_balance += $subscription->upcoming->total;
$balance += $subscription->upcoming->total;
}
}

Expand Down Expand Up @@ -58,8 +58,8 @@
your next invoice date is <?= date('d/m/Y', $subscription->stripe->current_period_end) ?>.
<?php } ?>

<?php if ($account_balance) { ?>
<br>Your account has a balance of £<?= number_format(-$account_balance / 100, 2); ?>.
<?php if ($balance) { ?>
<br>Your account has a balance of £<?= number_format(-$balance / 100, 2); ?>.
<?php } ?>
</p>

Expand Down

0 comments on commit ee20948

Please sign in to comment.