#WhySoAsync-customer-portal

1 messages · Page 1 of 1 (latest)

cursive laurel
#

Hi again! Hmm, not familiar with Electron...

kind badge
#

Hi, yea i saw some redirect url there, and i cannot send an url if the app is done on Electron, is not on browser

cursive laurel
#

Yeah the customer portal is a hosted page that relies on a redirect.

kind badge
#

Also about webhooks, i was doing expand: ['data.latest_invoice.payment_intent.payment_method', 'data.default_payment_method'] to get the card data, if i need to put it in DB i hope there is the same data on subscription.update webhook message

#

Maybe i can put a iframe?

cursive laurel
#

I don't believe we allow for it to be placed in an iframe but I haven't actually tried that myself

cursive laurel
kind badge
#

subscriptionsItems.push({
subscriptionId: subscription.id,
subscriptionName: subscription.plan.interval === 'month' ? 'Monthly' : 'Yearly',
status: subscription.status,
created: subscription.created,
start_date: subscription.start_date,
current_period_end: subscription.current_period_end,
current_period_start: subscription.current_period_start,
product: subscription.plan.id,
cancel_at_period_end: subscription.cancel_at_period_end,
cancel_at: subscription.cancel_at,
card: {
paymentMethod: subscription.default_payment_method.id,
brand: card.brand,
exp_month: card.exp_month,
exp_year: card.exp_year,
country: card.country,
last4: card.last4
},
billingDetails
});

these ones

cursive laurel
#

Yeah you can get that information from a cusotmer.subscription.updated webhook. Is that what you are asking?

#

That said, you can't expand with a Webhook.

kind badge
#

yea, i want this data to store it in DB

cursive laurel
#

You would receive the Webhook and then retrieve the Sub with whatever you want to expand immediately after.

kind badge
#

got it, so i can get the data on customer.subscription.updated and update the DB with all this data there

cursive laurel
#

The card information you will need to use a retrieve for.

#

But the rest will be on the customer.subscription.updated hook

kind badge
#

nice !

#

also how can i create a subscription that will invoice in 2-3 minutes?

#

so i can test retry and other stuff?

cursive laurel
#

So you can create the sub and then use that endpoint to immediately charge the invoice.

kind badge
#

oh nicee

cursive laurel
#

If you are using collection_method: charge_automatically then the initial payment will be attempted immediately.

#

But with send_invoice you can use the above endpoint to finalize/pay

kind badge
#

as i see i'm not using at all collection method

#

anywhere

cursive laurel
#

It defaults to charge_automatically