I'm trying to implement Stripe payment and I'm quite new at it. I can detach payment methods of the regular customers. I can even delete the regular customers, programmatically.
The problem is I cannot detach payment methods of the Customers under the Connect
account. I cannot delete the Customers under the Connect
account either. I can do this via the dashboard, though.
Is there a way to achieve this programmatically?
CodePudding user response:
If you are a platform account, you can make calls to your connected account by using the Stripe-Account
header, as explained here.
Fo example, to delete a customer of a connected account in dotNET, you would do something like this:
StripeConfiguration.ApiKey = "{{PLATFORM_SECRET_KEY}}";
var requestOptions = new RequestOptions();
requestOptions.StripeAccount = "{{CONNECTED_ACCOUNT_ID}}";
var service = new CustomerService();
service.Delete("cus_xxx", null, requestOptions);