I want to create Stripe express accounts for my customers (who will receive money) on my WordPress platform. An user account will be created when the user registers on my platform. How can I do it?
I’ve installed two Stripe extensions to help me but none of those extensions allows account creation for customers. I’ve tried browsing on Stripe docs in order to write my own code. I found some examples and tried a short code for the code below after including the Stripe library folder in my theme folder.
require_once get_template_directory() . '/stripe-php-master/lib/Stripe.php';
$stripe = new StripeStripeClient('<my_stripe_secret_api_key');
$stripe->accounts->create(['type' => 'express']);
I’ve include the short code on my customers registering page, but nothing worked as expected. I expected my code to create an express account without any information (apart of the mandatory one which is the account type) to see if that code worked but nothing happened.
2
Answers
I finally got the account creation working on another WordPress website that I got locally (for testing) with the code below and after using "code snippets" extension for integration. You can note some errors that I corrected.
Now, using the same process, I can't get the accounts created on the real website. I've got two types of behavior when trying.
I hope that helps get you on the right track!