VBScript Stripe: Delete a Bank Account

Back to Index

Deletes a customer's bank account.

Documentation: https://stripe.com/docs/api/curl#customer_delete_bank_account

CURL Command

curl https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99 \
   -u STRIPE_SECRET_KEY: \
   -X DELETE

VBScript Example

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

set rest = CreateObject("Chilkat_9_5_0.Rest")

'  URL: https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99
bTls = 1
port = 443
bAutoReconnect = 1
success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect)
If (success <> 1) Then
    outFile.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
    outFile.WriteLine(rest.LastErrorText)
    WScript.Quit
End If

success = rest.SetAuthBasic("STRIPE_SECRET_KEY","")

set sbResponseBody = CreateObject("Chilkat_9_5_0.StringBuilder")
success = rest.FullRequestNoBodySb("DELETE","/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99",sbResponseBody)
If (success <> 1) Then
    outFile.WriteLine(rest.LastErrorText)
    WScript.Quit
End If

set jsonResponse = CreateObject("Chilkat_9_5_0.JsonObject")
success = jsonResponse.LoadSb(sbResponseBody)

deleted = jsonResponse.BoolOf("deleted")
id = jsonResponse.StringOf("id")

outFile.Close

Sample JSON Response Body

{
  "deleted": true,
  "id": "ba_1BnETKGswQrCoh0XzgjB3t99"
}