#robo-checkout-testclock

1 messages · Page 1 of 1 (latest)

wide shardBOT
merry spear
#

👋 TestClocks are for testing Subscriptions specifically. They aren't aimed to work with Checkout or PaymentLink so I'd never test them together and I don't really get everything you're trying to describe or say.
In the first place I don't get why you are using PaymentLink this way with a client reference id. Why aren't you directly creating the Checkout Session at that point?

#

robo-checkout-testclock

#

I reread your paragraph 3 times but still don't understand what any of that means just yet. A Subscription knows ~nothing about the Checkout Session or the client_reference_id in any way. I think you got all the objects possibly mixed up?

merry spear
#

@ancient gate do you have more questions?

ancient gate
#

yes i do. give me a few minutes.

#

Yes I do, I need to know if I'm using stripe wrong.
I have an app where people can subscribe to a service to get additional features.
So within my app each user has an organization_id.
If they choose to subscribe, I have chosen Stripe to handle the transactions for me.
In Stripe, I will/have created a subscription that defines how much I want to be paid and how often.
Stripe provides a url that I can give my app user to subscribe to my service. Because I need to link who is subscribing to my users organization_id, I am using the ?client_reference_id parameter.
I believe this parameter is sent back to my webhook through the checkoutSessionCompleted event (at least that is the only event that I know of).
My intention is to retrieve client_reference_id from that event and insert it into the customers metadata object.
I believe doing so will enable me to capture Invoice.* events and be able to link that payment back to my app's user.
I also believe that having the customer metadata contain the client_reference_id, it will allow me to look at the customerSubscription.* events and know which of my app's users pauses, resumed, or canceled the subscription.
That is my intent.
I was hoping that the test clock would enable me to verify those events are being trapped correctly and that my app is responding correctly.
To me this seems like a pretty standard design pattern that would be required for any subscription.

merry spear
#

Stripe provides a url that I can give my app user to subscribe to my service. Because I need to link who is subscribing to my users organization_id, I am using the ?client_reference_id parameter.
But why are you using PaymentLinks for this, that's what I don't get unfortunately. PaymentLinks are more used for like you sell a book for $19.99 and you tweet that link for anyone to pay.
If you have your customer on your website/app ready to pay you should be integrating with Checkout directly

#

Are you still around @ancient gate ?

ancient gate
#

yeah, I stepped away.

#

Oh, I didn't know there was a difference between payment and checkout. All I knew was I created a subscription on the stripe website and it gave me a link that I could direct my users to.

#

and I gues, I'm trying to make that work

#

It seemed correct to me. The payment link select type says products or subscriptions, I want a subscription. The data that it wants is in line with what I would expect for a subscription...

merry spear
#

All I knew was I created a subscription on the stripe website and it gave me a link that I could direct my users to.
yeah that's a completely misunderstanding right now. A Subscription is a specific Stripe object with the id sub_123 and represents someone configuration to pay you say $10/month each month.
What you seem to have created is a PaymentLink with the id plink_123 and a URL like buy.stripe.com/.... which is a URL you can send to many of your customers to have them start a Subscription for $X/month

#

those are completely different. The first one is for one customer, the second one is like a "factory to create many Subscriptions"

ancient gate
#

So under the stripe model if I have a thousand users of my app and 500 wanted to subscribe, I would need to create a separate subscription object for each but they would all share the same product. Ok That seems to be in line with what I see in the test clock setup. And I suppose since I am creating a customer subscription I can include he client_reference_id. So the main reason why I'm using Stripe or for that matter any payment service is because I don't want to deal with credit card numbers etc. How do I get my user to a Stripe screen where they enter payment info etc?

merry spear
ancient gate
#

Thanks, I'll look over, give it a try and ask a new question when it comes up. Thanks

merry spear
#

What's important is you can't really mix test clocks and Checkout today, as a developer you don't really need to, you test things separately to make sure they work fine