#kekko7072

1 messages · Page 1 of 1 (latest)

unreal stirrupBOT
kind moss
#

This is my code to create user with card

wraith moth
#

Are you using the Flutter lib?

kind moss
#

yes

#

exports.call = functions
.region("europe-west3")
.https.onCall(async (req, context) => {
const {
customerId = req.createNewCustomer,
email = req.email,
name = req.fullName,
phoneNumber = req.phoneNumber,
payment_method_types = ["card"],
}: {
customerId: string;
email: string;
name: string;
phoneNumber: string;
payment_method_types: string[];
} = req;

const customer =
  customerId == "false"
    ? await stripe.customers.create({
        email: email,
        description: context.auth?.uid,
        name: name,
        phone: phoneNumber,
      })
    : await stripe.customers.retrieve(customerId);

const setupIntent = await stripe.setupIntents.create({
  customer: customer.id,
  payment_method_types,
  usage: "off_session",
  /*confirm: true,
return_url: "app.amperry",*/
});

});

#

this is the issue i created:

wraith moth
#

Well, that library isn't official (it's third-party)

#

How are you initialising the Payment Sheet

kind moss
#

i'm using the stock system

wraith moth
#

Is Apple Pay setup on your domains/devices? Do you meet the requirements?

kind moss
#

my problem is that i want to do it using the api of the backend and the api on flutter without oaymentSheet

#

because i dont want to make user pay for configuration

kind moss
#

and google pay and apple pay

#

with all the files configured

wraith moth
#

That doesn't answer the question:

Allow customers to securely make payments using Apple Pay on their iPhone, iPad, and Apple Watch.

wraith moth
kind moss
#

At the moment i use payment sheet to register apple pay and google pay and save the information as payment method for future usage

#

but to use this logic i need to do a payment of at least 0,5 €

kind moss
#

but without payment sheet

#

because i dont want to hold 0,5 € from user during configuration

wraith moth
#

That shouldn't be true if you use a Setup Intent, which also supports the Payment Sheet and allows your to save Apple Pay payment methods

kind moss
#

this is my payment intent code that i call from payment sheet

#

you are saying that i can call this with amount 0?

wraith moth
#

Why are you using Payment Intents if you're only saving the payment details and there's no payment?

#

I'm confused. Can we take a step back – you want to save payment details, from wallets like Apple Pay, for future payments. Correct?

kind moss
#

yes

#

at the moment i can register card calling from my app this:await stripe.setupIntents.create({
customer: customer.id,
payment_method_types,
usage: "off_session",
/confirm: true,
return_url: "app.amperry",
/
});

wraith moth
wraith moth
kind moss
#

no it's not clear to me

#

this is the flow for card

#

how can i create setupIntent with wallet payment ?

wraith moth
#

Wallet PMs fall under the card payment method type

kind moss
#

so i need to pass the token of apple pay?

wraith moth
#

No, Apple Pay should be surfaced on the Payment Sheet automatically for the Setup Intent assuming your device fulfils the Apple Pay requirements

kind moss
#

ok

#

so i can call payment Sheet with setup intent?

#

this is my flutter code with payment sheet

#

the flow will be:

#
  1. I call setup intent with payment shet
#
  1. i retreve from backend the payment sheet ephemeral key and setup intent code
#
  1. i register the wallet pay
hollow bobcat
#

Hi! I'm taking over this thread.

kind moss
#

can you read previous message?

hollow bobcat
#

Yes that looks correct:

  • Create a SetupIntent & ephemeral key on the backend
  • Get the client_secret & ephemeral key on the frontend
  • And launch the PaymentSheet
kind moss
#

ok

#

very clear

#

so as amount i will pass 0 in payment sheet?

#

can you leave the treat open for 24 hr so i can test?

hollow bobcat
#

I'm not familiar with flutter-stripe (this is not an official Stripe library), but with a SetupIntent there should be no amount (so maybe 0 if you need to set it).

kind moss
#

i'm sorry for my poor explanation so i will test what you said

hollow bobcat
#

can you leave the treat open for 24 hr so i can test?
We automatically close threads after they become inactive. But feel free to reopen a new thread if needed later!