#mitsu_api

1 messages ยท Page 1 of 1 (latest)

autumn coveBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1293125735590002729

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

wheat loom
#

hi! you don't need to , you can just use the ID pm_card_visa in whatever API where you need the PaymentMethod.

twilit hazel
#

I want to add multiple credit cards for customers

twilit hazel
wheat loom
#

no. Never use tokens and raw card numbers that way in backend PHP code. Just do $paymentMethodId = "pm_card_visa"; and you can use that.

twilit hazel
#

how to create pm_id

wheat loom
#

not that way, never that way.

#

you don't need to create anything.
$paymentMethodId = "pm_card_visa";
then you use that ID in whatever you were going do next in your code, e.g. confirming a Payment/SetupIntent.

twilit hazel
#

I want to add this card for cus_QskLl9qU8WPTwZ how to do?

wheat loom
#

are you trying to do this in a backend test only, or are you building a real payments page like in that screenshot and asking how to build it?

twilit hazel
#

i am building a real payments page like in that screenshot and asking how to build it

wheat loom
twilit hazel
#

I tried searching chatgpt and it looks like this, right?

#

Is it correct to call the API like this?

wheat loom
#

no.

#

like I said, you would never pass raw card numbers like this. ChatGPT is wrong(the API call is technically correct, but this is not how you should ever use it because you should never access/use raw card numbers).

twilit hazel
#

This is the form the customer asked me to make
What does this credit card used to call api paymentintent mean?

wheat loom
#

I can't understand your question, sorry.

#

you should not build your own HTML form for this, you should use our Elements components that collect card details securely.

twilit hazel
#

this is my business, can't use stripe element
how to handle?

#

stripe documentation also says this, why can't I use it?

wheat loom
#

why can't you use Stripe Elements?

autumn coveBOT
twilit hazel
#

that is, now i have a form, and want to create pm_id to add to cus_id, finally to call api paymentIntents->create
please guide me

#

using Stripe.js

#

like this right?

hasty plaza
#

Hey! Taking over for my colleague. Let me catch up.

#

You shouldn't collect the card detals (card number, exp, cvv) and send them by your self to create a PaymentMethod

#

I invite you to use Stripe Element

twilit hazel
#

my business

#

Can I use stripe.js?

hasty plaza
#

Yes the guide I'm sharing with you is using StripeJs

twilit hazel
#

$this->stripe->paymentMethods->attach(
$request['pm_id'],
['customer' => 'cus_QskLl9qU8WPTwZ']
);
After having pm_id, I can add it to the customer and call PaymentIntent, right?

hasty plaza
#

No, you shouldn't attach the payment method like that.

#

You need to use SetupIntent in order to attach the PaymentMethod to the customer.

twilit hazel
#

I have a recent project that I did the same thing, is it wrong?

hasty plaza
hasty plaza
twilit hazel
hasty plaza
#

With SetupIntent ?

twilit hazel
#

Now the project customer requires to use their form instead of stripe element, then will use stripe.js as you instructed

twilit hazel
hasty plaza
#

Ok, let's start from scratch, what you want to achieve exactly ? Collect a Payment Method and then use it later or charge the customer immediatly ?

twilit hazel
#
  • my form, use stripe.js to create pm_id
  • then add pm_id with cus_id
  • paymentIntents->create
hasty plaza
#

It's uses StripeJs and Stripe Element

twilit hazel
#

How can this form use stripe element???

hasty plaza
hasty plaza