Skip to content

Commit 30b03a0

Browse files
committed
todos
1 parent 8dc7222 commit 30b03a0

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

src/elements/db/SubscriptionQuery.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ protected function beforePrepare(): bool
957957
// todo: should we check for isSuspended too?
958958
$this->subQuery->leftJoin(
959959
['stripe_invoicedata' => '{{%stripe_invoicedata}}'],
960-
"[[stripe_subscriptions.stripeId]] = [[stripe_invoicedata.subscriptionId",
960+
"[[stripe_subscriptions.stripeId]] = [[stripe_invoicedata.subscriptionId]]",
961961
);
962962

963963
$this->subQuery->andWhere(Db::parseTimestampParam(

src/helpers/Price.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,17 @@ public static function renderCardHtml(PriceElement $price): string
323323
}
324324
}
325325

326-
$meta[Craft::t('stripe', 'Metadata')] = collect($stripePrice['metadata'])
326+
$meta[Craft::t('stripe', 'Metadata')] =
327+
Html::beginTag('div', ['class' => 'pec-metadata']) .
328+
collect($stripePrice['metadata'])
327329
->map(function($value, $key) {
328-
// todo: style me!
329330
return Html::beginTag('div', ['class' => 'fullwidth']) .
330331
Html::tag('em', $key . ': ') .
331332
$value .
332333
Html::endTag('div');
333334
})
334-
->join(' ');
335+
->join(' ') .
336+
Html::endTag('div');
335337
}
336338

337339
$meta[Craft::t('stripe', 'Created at')] = $formatter->asDatetime(

src/helpers/Product.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,17 @@ public static function renderCardHtml(ProductElement $product): string
9494
->join(', ');
9595
break;
9696
case 'metadata':
97-
$meta[Craft::t('stripe', $label)] = collect($value)
97+
$meta[Craft::t('stripe', $label)] =
98+
Html::beginTag('div', ['class' => 'pec-metadata']) .
99+
collect($value)
98100
->map(function($val, $i) {
99-
// todo: style me!
100101
return Html::beginTag('div', ['class' => 'fullwidth']) .
101102
Html::tag('em', $i . ': ') .
102103
$val .
103104
Html::endTag('div');
104105
})
105-
->join(' ');
106+
->join(' ') .
107+
Html::endTag('div');
106108
break;
107109
case 'default_price':
108110
$defaultPrice = $product->getDefaultPrice();
@@ -148,7 +150,7 @@ public static function renderCardHtml(ProductElement $product): string
148150
'id' => $product->id,
149151
]),
150152
'swap' => 'outerHTML',
151-
'trigger' => 'every 15s',
153+
'trigger' => 'every 15m',
152154
],
153155
]);
154156
}

src/helpers/Subscription.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,17 @@ public static function renderCardHtml(SubscriptionElement $subscription): string
129129

130130
$footer = '';
131131
if (count($stripeSubscription) > 0) {
132-
$meta[Craft::t('stripe', 'Metadata')] = collect($stripeSubscription['metadata'])
132+
$meta[Craft::t('stripe', 'Metadata')] =
133+
Html::beginTag('div', ['class' => 'pec-metadata']) .
134+
collect($stripeSubscription['metadata'])
133135
->map(function($value, $key) {
134-
// todo: style me!
135136
return Html::beginTag('div', ['class' => 'fullwidth']) .
136137
Html::tag('em', $key . ': ') .
137138
$value .
138139
Html::endTag('div');
139140
})
140-
->join(' ');
141+
->join(' ') .
142+
Html::endTag('div');
141143

142144
$meta[Craft::t('stripe', 'Created at')] = $formatter->asDatetime($stripeSubscription['created'], Formatter::FORMAT_WIDTH_SHORT);
143145

src/migrations/Install.php

-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ public function createIndexes(): void
232232
$this->createIndex(null, Table::SUBSCRIPTIONDATA, ['stripeId'], true);
233233
$this->createIndex(null, Table::SUBSCRIPTIONDATA, ['customerId']);
234234
$this->createIndex(null, Table::SUBSCRIPTIONDATA, ['latestInvoiceId'], true);
235-
// todo: add for price id?
236235

237236
$this->createIndex(null, Table::CUSTOMERDATA, ['stripeId'], true);
238237
$this->createIndex(null, Table::CUSTOMERDATA, ['email']);

0 commit comments

Comments
 (0)