#WhySoAsync-customer-portal
1 messages · Page 1 of 1 (latest)
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
Yeah the customer portal is a hosted page that relies on a redirect.
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?
I don't believe we allow for it to be placed in an iframe but I haven't actually tried that myself
Not sure what you mean by this? What info are you looking for about the subscription update?
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
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.
yea, i want this data to store it in DB
You would receive the Webhook and then retrieve the Sub with whatever you want to expand immediately after.
got it, so i can get the data on customer.subscription.updated and update the DB with all this data there
The card information you will need to use a retrieve for.
But the rest will be on the customer.subscription.updated hook
nice !
also how can i create a subscription that will invoice in 2-3 minutes?
so i can test retry and other stuff?
You can force payment on an invoice via https://stripe.com/docs/api/invoices/pay
So you can create the sub and then use that endpoint to immediately charge the invoice.
oh nicee
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
It defaults to charge_automatically