#john307-BillingPortal

1 messages · Page 1 of 1 (latest)

past palm
#

Hi there, the code that you are using creates a checkout session instead of a customer portal session.

tender shuttle
#

Hi thanks for your reply

#

Thats what I have used

past palm
#

You might want to remove params LineItems, Mode, SuccessUrl and CancelUrl, these are for Checkout session.

tender shuttle
#

After removing those here's what I got
"error": "Missing required param: success_url."

Then after adding success_url
`var options = new SessionCreateOptions
{
Customer = "cus_xxx",
SuccessUrl = "https://example.com/success",
CancelUrl = "https://example.com/cancel"
};
var service = new SessionService();
service.Create(options);

return Ok(service.Create(options))`;

It throws
"error": "You must pass either subscription_dataorline_itemsormode."

past palm
#

Can you remove SuccessUrl and CancelUrl, and add in ReturnUrl instead?

tender shuttle
#

error CS0117: 'SessionCreateOptions' does not contain a definition for 'ReturnUrl'

past palm
#

did you import the SessionCreationOptions from Stripe.BillingPortal namespace?

tender shuttle
#

Thats what I have missed I thought they share same namespace, good spot!

#

Thats all for now very thankful for your help

past palm
#

Cool, happy to know the problem is resolved!

tender shuttle
#

Hey I still have some questions sorry

#

Can we use Stripe Billing to create payment or subscription ?

past palm
#

That's the job of Checkout Session, not Billing Portal Session.