#Andres2792-PaymentLink

1 messages · Page 1 of 1 (latest)

fallen reef
tough stirrup
#

Sure! req_pMia0Drt0vw4nU and req_QNiwHlNbqhGFnz

fallen reef
#

I'm trying to test this on my end

tough stirrup
#

Sure @fallen reef ans that's the exact doc I was using :)

tough stirrup
#

@fallen reef any update here mate?

fallen reef
#

Hmm, I was unable to reproduce it.

#

It's working as expected on my end

#

Let me compare the two requests

tough stirrup
#

Awesome @fallen reef maybe i passed a wrong attribute... Not sure :(

fallen reef
#

I'm passing the exact same parameters:

line_items: { 0: { quantity: "1", price: "price_1LMzxgGHtciddFoAknHSieXO" } } }

tough stirrup
#

Would it be a library issue?

#

But I'm pretty sure I was using the last release

#

And I'm really crazy here cuz I tried to do this via Ruby and I got NameErros via console and code

#

The endpoint didn't worked for me. Any payment link call on ruby worked :/

somber swan
#

Hi there 👋 taking over

Give me a few minutes to get caught up.

tough stirrup
#

Awesome @somber swan ty for the help mate! Really appreciate it :)

somber swan
#

Ah, so it looks like Stripe is not being initialized properly. Or, possibly, it's outside the scope of the code that's trying to run Stripe::PaymentLink.create()

#

Do you have require 'stripe' somewhere that the function call can access?

tough stirrup
#

Yeah I set that on the beginning

#

Globally

somber swan
#

Something else is going wrong, because the error you're receiving says "uninitialized constant Stripe", so it's either not getting initialized or it's getting initialized somewhere that the function call doesn't have access.

tough stirrup
#

Jmm I will flush the library and try again

#

Yeah that's odd and that's why I bothered u all here :/

#

Sorry for that

somber swan
#

No that's totally okay! That's what we're here for.

#

If you still aren't able to get it up and running, let us know and we can try to advise on what to do next

tough stirrup
#

Hey @somber swan it worked! Idk why it got stuck but I just flushed and required the gem again and it works

#

Ty so much :) I really appreciate the help!

#

But now I'll see if I can change the price on ruby

somber swan
#

Amazing! Love to see it

tough stirrup
#

Same issue when trying to update the already created payment link but now on ruby @somber swan

somber swan
#

What's the error you're receiving?

tough stirrup
#

Idk.... Maybe... it's because it is a preview feature?

somber swan
#

Ah! Can you enclose everything from line 13 to line 17 in curly braces {}?

Stripe::PaymentLink.update( 'plink_1LQfeFILwdSSnvJbBHvDTLyx', { line_items: [ {id: 'price_abc123'} ] }, )

tough stirrup
#

On it

#

Same error

somber swan
#

Also line_items is an array of hashes, so it should be { line_items: [{id: 'price_abc123'}] }

#

Did you change that too?

tough stirrup
#

Yup

#

Let me paste the request ID here une sec

somber swan
#

Okay cool. Thanks for bearing with me!

tough stirrup
#

req_thFQN3nxU0q9qS

#

Ups req_thFQN3nxUOq9qS

#

You know O VS 0 hehe my bad

#

The second ID :)

somber swan
#

Okay gotcha. Looking now

#

Ahhh, okay. So you're passing in price instead of id. Notice how my code above has {id: 'price_abc123'} instead of {price: 'price_abc123'}. Additionally, I don't think you can update a Payment Link with a new Price. I'm pretty sure you can only update prices that are already attached to the payment link

tough stirrup
#

Jmm I did it via DB :/ so no chance via API?

somber swan
#

I don't think so, but let me check

tough stirrup
#

Sure :)

somber swan
#

Yeah, so you won't be able to pass price: 'price_abc123' until the feature is rolled out officially (it's currently just in preview right now), and you can't add a new Price to an existing Payment Link using id

#

Just tested on my end and confirmed

#

Apologies if that was a wild goose chase

tough stirrup
#

Oof hehehe and no sneak peak on when will it be available for us mortals?

somber swan
#

Not that I know of, but I can say that the preview likely implies that it's not too far off.

tough stirrup
#

Great! Ty for your help mate! I really appreciate it. Have a good day :)