#dev123-portal

1 messages · Page 1 of 1 (latest)

tiny night
#

Hi there, can you share with me the request ID?

vapid sorrel
#

Thank you for trying helping me

#

I found the problem : I was on an bad file....🤒 So It was old test code. Now I have this message :

#

ok, now I have a blank page, let's me see deeper

#

The reason is that I don't use endpoint but this :

#

echo '<form action="create-portal-session.php" name="aboClientF" method="POST">';
echo '<input type="hidden" id="session-id" name="session_id" value="'.$_SESSION['session_id'].'" >';
// echo '<button id="checkout-and-portal-button" type="submit">Manage your billing information</button>';
echo '<span class="boutonsWebmaster" onClick="document.aboClientF.submit();">Gérez votre abonnement</span>';
echo '</form>';

#

Do you know how can I do to redirect in a blank stripe page instead includig in mine ? I want to say how to redirect action="create-portal-session.php" to stripe ? hope you unserstand what I mean

#

Do you have any idea ? The create-portal-session.php is embedded in my code, so the browser says: billing.stripe.com doesn't all connexion. How can I force to redirect to stripe ? Thank for any idea

thorny sundial
#

Hey @vapid sorrel! Taking over from Jack – just catching up

vapid sorrel
#

Hello ynnoj, thank trying help me !

#

I'am trying to create a client portal for subscirption

#

sorry but where can I check if the portal was created ?

#

I mean from dashboard

thorny sundial
#

There's no record of the Billing Portal sessions in the Dashboard (other than the logs). They're short lived so aren't really persisted anywhere

vapid sorrel
#

ok thank,

#

here the req ID :

req_afg5cWELfWzliV

thorny sundial
#

Taking a look

vapid sorrel
#

here the code of the button :

            echo '<form action="create-portal-session.php" name="aboClientF" method="POST">';
                  // echo '<input type="hidden" id="session-id" name="session_id" value="'.$_SESSION['session_id'].'" >';
                  echo '<button  id="checkout-and-portal-button" type="submit">Manage your billing information</button>';
                // echo '<span class="boutonsWebmaster" onClick="document.aboClientF.submit();">Gérez votre abonnement</span>';
            echo '</form>';
#

and the code of : create-portal-session.php :

try {
$checkout_session = \Stripe\Checkout\Session::retrieve($_POST['session_id']);
$return_url = $YOUR_DOMAIN;

// Authenticate your user.
$session = \Stripe\BillingPortal\Session::create([
'customer' => $checkout_session->customer,
'return_url' => $return_url,
]);
header("HTTP/1.1 303 See Other");
header("Location: " . $session->url);
}
catch (Error $e) {
http_response_code(500);
echo json_encode(['error' => $e->getMessage()]);
}

thorny sundial
#

Is there some kind of error in your application?

vapid sorrel
#

I guess something with frame and target, or ip...Let's me have a test on my domain and not on localhost/dev. Few minutes please, I need a ☕ ...

#

before testing

thorny sundial
#

Can you share the error? Is there a specific reason for using the 303 status code?

vapid sorrel
#

if you mean header("HTTP/1.1 303 See Other"); in create-portal-session.php it is a copied code from examples. Should I remove it ?

thorny sundial
#

Now you've shared that screenshot that suggests seems kind of configuration issue blocking billing.stripe.com on your localhost

vapid sorrel
#

Yes I have got it working !

#

I replace the button like this :

onClick="window.open('create-portal-session.php', '_blank');

#

So now I have understand I have to create a webhhok, isn't ?

#

So now I have understand I have to create a webhook, isn't ?

#

I will try create a webhook, and if necessary open a new thread,

#

Hope it will not necessary 😉 ,

#

for moment I Have to go out. I will try webhook this afternoon,

#

Thank you very much for your help,

#

even It was on my code, you help me to understand

thorny sundial
#

Nice! What do you need the webhook for?

vapid sorrel
#

I understand it is an event that notify the client about each payment ? isn't ?

#

So I just want the client been notified to pay each month

#

Do you confirm ?

#

Or it is not necessary yet ?

#

Sorry for this question, but I am beginner with stripe and I am french, sometimes is not obvious reading all docs and having a perfect comprehension

#

So does I need a webhook for notifications are send automatically ?

thorny sundial
vapid sorrel
#

the two...

#

They should have a notification with a link to pay each month -3 days

thorny sundial
#

Can you please share the Subscription ID?

vapid sorrel
#

yes, it is a product ID
prod_Kdqi8JaOGdSsjr

thorny sundial
#

Have you not created a subscription with the product/price?

vapid sorrel
#

Sorry, I don't think I have created it. Where is it in dashBoard please ?

thorny sundial
#

Yeah so with a correctly configured subscription you don't need to prompt your customers to pay

#

The recurring payments are just automatically collected as per the billing interval

vapid sorrel
#

ha! ok, good,

#

But I see that it is not posiblme having this in test ? isn't ?

thorny sundial
#

How do you mean?

vapid sorrel
#

ok ,let my previous message,

#

I have to implement something like this ?

$stripe->subscriptions->create([
'customer' => 'cus_KeEL4hnqzUyuo3',
'items' => [
['price' => 'price_1JyZ1YGPrFXOX5m0WAFgkVOs'],
],
]);

thorny sundial
#

Yes, exactly!

vapid sorrel
#

ok, fantastic, ....

#

I will check all of this this afternoon as I have to go...

#

It is more clear for me now, I want to thank you again, and all the team, you do a good job !

#

I will try by myself, and ask you only if I have some big problems....Hop it would not be necessary😉

#

Thank you again, I must leave👋

thorny sundial
#

Good luck! We'll be here if you need help