java - Android: Create a new customer record with Stripe API -


i have new customer checking out , wants store card future use. if i'm reading documentation correctly, need make separate calls out stripe, 1 create customer card , charge card.

the question is.. there way create new customer record stripe using android/java codes without utilizing back-end server size codes php, node.js, etc?

cause i'm having trouble documentation stated here java. tried follow documentation sadly, codes not work in android project (even though added build.gradle, etc.)

i'm new stripe i'm not knowledgeable.

this code trying follow , apply project.

// set secret key: remember change live secret key in production // see keys here: https://dashboard.stripe.com/account/apikeys stripe.apikey = "sk_test_ejknr41rd0sbinvxkzocneg0";  // token created using stripe.js or checkout! // payment token submitted form: string token = request.getparameter("stripetoken");  // create customer: map<string, object> customerparams = new hashmap<string, object>(); customerparams.put("email", "paying.user@example.com"); customerparams.put("source", token); customer customer = customer.create(customerparams);  // charge customer instead of card: map<string, object> chargeparams = new hashmap<string, object>(); chargeparams.put("amount", 1000); chargeparams.put("currency", "eur"); chargeparams.put("customer", customer.getid()); charge charge = charge.create(chargeparams);  // code: save customer id , other info in database later.  // code (later): when it's time charge customer again, retrieve customer id. map<string, object> chargeparams = new hashmap<string, object>(); chargeparams.put("amount", 1500); // $15.00 time chargeparams.put("currency", "eur"); chargeparams.put("customer", customerid); charge charge = charge.create(chargeparams); 

is there way create new customer record stripe using android/java codes without utilizing back-end server size codes php, node.js, etc?

no. stripe's android sdk should used collect , tokenize customer payment information. operation done publishable api key.

all other operations (e.g. using token create customer object or a charge) done using secret key, must never shared or embedded in mobile app attacker retrieve , use issue api requests on behalf.

stripe provide java library, meant server-side use, not used android mobile app.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -