#Zachary-Android-Customer
1 messages · Page 1 of 1 (latest)
Hi there! You would create a Customer from your server via https://stripe.com/docs/api/customers/create and then pass that to your client.
What integration flow are you using?
I'm using VS Code for the Cloud Function
Okay so looks like you already are creating a Customer with that code. Are you having trouble accessing the Customer ID from your created Customer?
I'm having trouble implementing createStripeCustomer into Andrioid Studio using Kotlin
Okay but you wouldn't implement this into Kotlin... this code needs to run from your Server. What type of backend are you using?
Sorry, I'm not super familiar with Cloud functions.
I'm getting some more info, give me one second.
This is already uploaded to Firebase Cloud Functions 🙂 Now I just need to know how to execute it using Kotlin so I can assign a stripeID when a customer registers
Gotcha. Not super familiar with Kotlin and Android development overall so asking a colleague how you would trigger this
Thank you
Okay so we actually show how to do this in our docs here: https://stripe.com/docs/payments/accept-a-payment?platform=android#android-collect-payment-details
Looks like you will need the two packages in the second code snippet: import com.github.kittinunf.fuel.httpPost import com.github.kittinunf.fuel.json.responseJson
And then you would use "https://path.to.my.server".httpPost()
Thank you, so Android doesn't need a customer stripeID like iOS?
Sorry, not sure what you mean by that? When you create a Customer, Stripe assigns it an ID that looks like cus_xxxx
This is true regardless of which platform you use to hit our create customer API
Yes, I'm needing the cus_xxx for the Android side
Gotcha so when you run the function provided above, it will return you a customer ID
If you log out customer after your .then() you will see the full customer object including the ID
How about regisrating a customer?
Registering a customer to assign a cus_xxx
This happens automatically when you hit the Stripe "Create Customer" API. See: https://stripe.com/docs/api/customers/create and look at the example response on the right side
That is an example of the Customer object that will get returned to you when you use stripe.customer.create()
In Kotlin?
Nope, in your Node code that you supplied above.
You want to set up your server code so that when you call it from your client (from your Kotlin code) it passes back the Customer ID and the other relevant information.
I need my Node code to trigger in Kotlin
Sure... you will use Kotlin to call that code as discussed in the docs I linked above where it talks about fetching your PaymentIntent, Eph Key, Customer ID, etc.
K thank you, I was getting confused, thank you