Skip to content

Commit

Permalink
Adds Subscription id pass-through for useChckoutPricing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissrogers committed Jan 3, 2024
1 parent f3dbeae commit c4643cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/use-checkout-pricing.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ export default function useCheckoutPricing (initialInputs, handleError = throwEr

function addSubscriptions(subscriptions, checkoutPricing) {
const { subscriptionPricings } = subscriptions.reduce(
({ checkoutPricing, subscriptionPricings }, { plan, tax, addons = [], quantity }) => {
({ checkoutPricing, subscriptionPricings }, { id, plan, tax, addons = [], quantity }) => {
let subscriptionPricing;
if (restInputs.currency) {
subscriptionPricing = recurly.Pricing.Subscription().currency(restInputs.currency).plan(plan, { quantity });
subscriptionPricing = recurly.Pricing.Subscription({ id }).currency(restInputs.currency).plan(plan, { quantity });
} else {
subscriptionPricing = recurly.Pricing.Subscription().plan(plan, { quantity });
subscriptionPricing = recurly.Pricing.Subscription({ id }).plan(plan, { quantity });
}

if (addons.length) {
Expand Down

0 comments on commit c4643cd

Please sign in to comment.