#Zachary-Android-Customer

1 messages · Page 1 of 1 (latest)

blazing patio
#

What integration flow are you using?

tawdry panther
#

I'm using VS Code for the Cloud Function

blazing patio
#

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?

tawdry panther
#

I'm having trouble implementing createStripeCustomer into Andrioid Studio using Kotlin

blazing patio
#

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.

tawdry panther
#

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

blazing patio
#

Gotcha. Not super familiar with Kotlin and Android development overall so asking a colleague how you would trigger this

tawdry panther
#

Thank you

blazing patio
#

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()

tawdry panther
#

Thank you, so Android doesn't need a customer stripeID like iOS?

blazing patio
#

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

tawdry panther
#

Yes, I'm needing the cus_xxx for the Android side

blazing patio
#

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

tawdry panther
#

How about regisrating a customer?

blazing patio
#

What do you mean by that?

#

What does "registering a customer" entail?

tawdry panther
#

Registering a customer to assign a cus_xxx

blazing patio
#

That is an example of the Customer object that will get returned to you when you use stripe.customer.create()

tawdry panther
#

In Kotlin?

blazing patio
#

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.

tawdry panther
#

I need my Node code to trigger in Kotlin

blazing patio
#

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.

tawdry panther
#

K thank you, I was getting confused, thank you