I am not able to create account of a customer in my application. The code which I found on stripe documentation id:
Map<String, Object> accountParams = new HashMap<String, Object>();
accountParams.put("email", "[email protected]");
accountParams.put("country", "US");
accountParams.put("type", "custom");
Account account = Account.create(accountParams);
When I run this it gives the this error:
"You can only create new accounts if you've registered your platform"
I'm not able to create account.
Can anyone tell me the whole flow of using stripe?
I might not be following that flow.
That code is for creating a managed Stripe account as part of Stripe Connect, which I suspect is not what you are trying to do.
If you are only interested in charging a customer, you do not need to create a Stripe account for them, only a customer object. You would use Stripe Elements or Checkout to collect the customer's payment details and create a token, pass this token to your backend, and then create a customer using that token, as described in the Stripe docs.
https://stripe.com/docs/api#create_customer