#Chevy-undefined-paymentmethod

1 messages · Page 1 of 1 (latest)

ruby sundialBOT
junior bay
#

Chevy-undefined-paymentmethod

#

llo! I can't do much with pictures of code

#

Ultimately the problem seems to be that you are trying to retrieve a PaymentMethod and instead of passing a valid id pm_123456 you pass a null variable

pseudo dagger
#

How can pass a valid id pm_......?

junior bay
#

I don't know, I don't understand the context of your question, where your code is coming from, which doc you're following, etc.

#

Right now, your code is passing an invalid PM id, you need to find that code, find where the PM id is coming from, why it's null, etc.

pseudo dagger
#

I'm trying to retrieve the clientSecret from server(back4app) into my project. I want the user to be able to make payments

junior bay
#

Please don't share picture of code

#

share real code here

pseudo dagger
#

Understood! My appologies

junior bay
#

all good

#

I'm not sure how to tie that picture to your question

rich prism
#

@pseudo dagger that code sample means you need to make an API call to your backend to get the clientSecret

pseudo dagger
#

Yes, that exactly what I've been trying to do

rich prism
#

addNewPaymentMethod

#

Do you have idea why are you retrieving PaymentMethod inside this backend function?

#

It looks wrong to me. You should only creating a SetupIntent and returns, that’s it

#

Ah wait probably you need the exact same PaymentMethod I’d generated from the ApplePay button?

pseudo dagger
#

No experience at all with backend function. Do you know how to this work?

rich prism
#

It's simple that the backend function expects request.params.paymentMethodId

#

but you didn't provide it when you called PFCloud.callFunction in iOS code