#Ramya-token
1 messages · Page 1 of 1 (latest)
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
i am doing ach payments process.. following
Map<String, Object> bankAccount = new HashMap<>();
bankAccount.put("country", "US");
bankAccount.put("currency", "usd");
bankAccount.put(
"account_holder_name",
"Jenny Rosen"
);
bankAccount.put(
"account_holder_type",
"individual"
);
bankAccount.put("routing_number", "110000000");
bankAccount.put("account_number", "000123456789");
Map<String, Object> params = new HashMap<>();
params.put("bank_account", bankAccount);
Token token = Token.create(params);
this code returning empty object
in logs there is no recent logs
what does "empty object" mean?
like what are you looking at exactly, can you share the exact response or a screenshot of what you are looking at or so on?
giving {} like this
but i am expecting for
{
"id": "btok_1KgnhQ2eZvKYlo2CoaQl5Uur",
"object": "token",
"bank_account": {
"id": "ba_1KgnhQ2eZvKYlo2CeKCQq2sX",
"object": "bank_account",
"account_holder_name": "Jane Austen",
"account_holder_type": "individual",
"account_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"fingerprint": "1JWtPxqbdX5Gamtz",
"last4": "6789",
"routing_number": "110000000",
"status": "new"
},
"client_ip": null,
"created": 1648116924,
"livemode": false,
"type": "bank_account",
"used": false
}
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can you show me where you see {} exactly, what code do you have that prints it, or are you looking in a debugger, or something else?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i wanted to get token which is belongs to particular account details
I understand.
can you show me where you see {} exactly, what code do you have that prints it, or are you looking in a debugger, or something else?
Gson gson = new GsonBuilder().setPrettyPrinting().create();
Stripe.apiKey = "sk_test_R8EhbtMSWYQYqkuppjm3UvSz00MCTmCh3i";
Map<String,Object> tokenParams = new HashMap<>();
Map<String,Object> bankAccountMap = new HashMap<>();
bankAccountMap.put("country","US");
bankAccountMap.put("currency","usd");
bankAccountMap.put("account_holder_name","Jenny Rosen");
bankAccountMap.put("account_holder_type","individual");
bankAccountMap.put("routing_number","110000000");
bankAccountMap.put("account_number","000123456789");
tokenParams.put("bank_account",bankAccountMap);
Token token = null;
Log.d("TAG", "params: "+tokenParams);
new Thread(new Runnable(){
@Override
public void run() {
try {
com.stripe.model.Token token1 = com.stripe.model.Token.create(tokenParams);
Log.d("TAG", "createACHToken: "+gson.toJson(token1));
} catch (StripeException e) {
e.printStackTrace();
Log.d("TAG", "run: e :::: "+e.toString());
}
}
}).start();
i have used this code
in my logs displaying createACHToken: {}
interesting how that code is different from what you posted earlier
try just doing Log.d("TAG", "createACHToken: "+ token1.getId()); instead and see what happens.
giving null value
both are same instead of secret key... i couldn't understand what ithappens
well, you can see the request is being made and is in your logs(https://dashboard.stripe.com/test/logs/req_qwFfJ0ERRebjZA)
wait, you're doing this in an Android app?
that is completely wrong
you can't use our stripe-java library in an Android app, and you can't use your secret key in a frontend app your customers would install! That library is for backend servers.
in logs giving this message No request log found with the specified ID.
yes i am developing android application using java.. i wanted to create token using my user bank account details.. can i make this from front end
then you're not logged into the right Stripe account(the one who's API key you're using)
yes, you would use our Android library though.