#stripe_connect_platform - Payment Links

1 messages ยท Page 1 of 1 (latest)

granite coyote
elfin girder
#

Ok is this something a standard Stripe account holder can add when they create the payment link? Or, do we have to create the payment link in our UI via the payment link API to pass in client_reference_id

#

Can we let the standard Stripe account holder make his own links in his own Stripe dash and just - if they connect our app - update his payment links to pass in this param? Or is that unwise - we should just create the entire UI to create payment links in our app

granite coyote
#

Let's back up a bit, I want to make sure I fully understand the problem you're trying to solve. Without getting into specifics, can you describe the core issue at a high level?

elfin girder
#

Customer pays.
Customer is redirected to a website where a form appears to create a password.
It works with our custom Stripe Checkout codee.
It does not work with Stripe Payment Link.

#

We want to find a way for it to work with Stripe Payment Links and I don't know if that is even possible.

granite coyote
#

Okay, can you describe how it work with Stripe Checkout now?

elfin girder
#

I personally don't want to re-create the wheel so i would love our customers to be able to create a payment link in Stripe's pretty UI with the preview and all the bells and whistles of the dashboard.

#

My engineer who wrote is it smarter than me but I think after the Customer and Subscription are created in Stripe, we create a Member obj in our db and create a unique token and pass that token into the dynamic redirect URL so when the customer redirects back to example.com/?token=abc we can auth and then we dynamically pop up a form with a pre-filled email field that is disabled since it is the purchaser email and we allow the newly created Member to create a password. They can then log in and do cool stuff inclusive of getting to Stripe Customer Portal.

#

But with payment links, the Stripe account owner is creating a link and the redirect URL is just example.com

granite coyote
#

When you say you want people to create Payment Links in Stripe's UI, I'm not sure I understand what you want them to do there exactly. What piece of information would they have to include there?

elfin girder
#

obj

#

Our customers are Stripe acccount holders

granite coyote
#

The redirect URL can be set to anything.

#

As long as it's a valid URL I mean.

elfin girder
#

They are being prompted to create payment links

#

They are non-technical so they like the idea of a link rather than the 150+ lines of code we generate for them for the past 6 years.

#

But the token at the end of the URL is only created instantly after the invoice.payment_succeeds

#

So that is the issue.

#

Customers want payment links but are having a bad experience with them.

#

We are trying to get them to work as well for our customers as our 100+ lines of Stripe Checkout Session code but I am stuck on how to auth the person after being redirected back to the website when the payment starts with a link rather than our checkout code.

#

Ok, let me translate to engineer

#

session_hash = {
success_url: THIS
}

granite coyote
#

Sorry, I'm not following. Let's look at the Payment Links interface in the Dashboard. I can put any URL I want in this box:

#

So I'm not understanding the issue you're having. People can add whatever parameter they want there.

elfin girder
#

"#{redirect_url}?session_id={CHECKOUT_SESSION_ID}&app_site_id=#{@site.app_site_id}&livemode=#{livemode.to_s}

#

What we currently do is this:
session = Stripe::Checkout::Session.create(session_hash{stripe_account: @site.stripe_user_id
})

#

And in that session we pass in the success_url but it is dynamic. It contains the CHECKOUT_SESSION_ID

#

So the customer is redirected to a special URL with the CHECKOUT_SESSION_ID and bunch of other things. How do we do that with a payment link?

#

The Checkout Session ID is a dynamic thing that can't be hard-coded. That is the issue.
Does that make sense?

#

Can we pass something into client_reference_id that would work?

granite coyote
elfin girder
#

OK, that is with the Payment Link API yes?

granite coyote
#

It's with Payment Links period.

#

API or Dashboard.

elfin girder
#

Sorry, we are a Stripe Connect Platform (hence the name) so....

#

the issue is always.

#

A.) Have the standard Stripe Account holder use the Stripe dashboard to do some task
B.) Use the API to do some task or build our own UI

#

So you are saying A works and the standard Stripe account holder can create a redirect URL like in the image you sent but pass in something that will add tthe Checkout Session ID to the URL?

granite coyote
#

Yeah. To be clear, the URL in the screenshot below sends me to a URL like this one when I complete payment: https://example.com/?checkoutSession=cs_test_a1wW2N8hVbgDcLpSjeSrJJobgO882AUep7KIX9tk5qYeb0z5fUD3svhszh

#

I just created a Payment Link via the Dashboard to confirm it works exactly as described above.

#

Will that approach solve the problem for you?

elfin girder
#

eureka!

#

Yeah, I think that will work beautifully.
So I think the flow is:
1.) standard Stripe customer creates a payment link in the Stripe dashboard.
2.) We use our UI to dynamically create a redirect URL. standard Stripe customer updates the payment link with the custom redirect_url we provide.
OR
I just decide to rebuild a UI to create payment links and we just put in the correct redirect without all the copying and pasting and get the application fee for doing the legwork
Those both work.
OK thank you for all the help explaining this to me!!!!!!!!

granite coyote
#

Happy to help! Glad we found a solution!

elfin girder
#

Is it possible to pass in a livemode variable?
livemode={LIVEMODE} or just the session ID. We don't know whether to retrieve it with test or live keys.

coral sigil
#

hi there, could you elaborate more on what you're trying to retrieve?

elfin girder
#

Any other params allowed besides {CHECKOUT_SESSION_ID}

#

maybe {LIVEMODE} ??? ๐Ÿ™‚

coral sigil
#

you don't need {LIVEMODE}

#

the checkout session id looks like cs_live_xxx or cs_test_xxx

#

you can tell if it's live or test from that id

elfin girder
#

ha! genius!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#

THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!