Skip to content

Commit

Permalink
[OBOL] Add package amount
Browse files Browse the repository at this point in the history
  • Loading branch information
that-guy-iain committed Oct 8, 2024
1 parent 33e7fcd commit 499052c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Obol/Model/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class Price

private ?Metric $metric = null;

private ?int $packageAmount = null;

public function isIncludingTax(): bool
{
return $this->includingTax;
Expand Down Expand Up @@ -195,4 +197,14 @@ public function setMetric(?Metric $metric): void
{
$this->metric = $metric;
}

public function getPackageAmount(): ?int
{
return $this->packageAmount;
}

public function setPackageAmount(?int $packageAmount): void
{
$this->packageAmount = $packageAmount;
}
}
1 change: 1 addition & 0 deletions src/Obol/Provider/Stripe/PriceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public function populatePrice(\Stripe\Price $stripePrice): Price
$price->setTierMode(TierMode::fromString($stripePrice->tiers_mode));
$price->setBillingType(BillingType::fromStripe($stripePrice->billing_scheme));
$price->setUsageType(UsageType::fromStripe($stripePrice->recurring?->usage_type));
$price->setPackageAmount($stripePrice->transform_quantity?->divide_by);

if ($stripePrice->recurring?->meter) {
/** @var Meter $stripeMeter */
Expand Down

0 comments on commit 499052c

Please sign in to comment.