Retrieve details about a specific bank account stored on the Stripe account.
curl https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99 \
-u STRIPE_SECRET_KEY:
var
rest: HCkRest;
success: Boolean;
bTls: Boolean;
port: Integer;
bAutoReconnect: Boolean;
sbResponseBody: HCkStringBuilder;
jsonResponse: HCkJsonObject;
id: PWideChar;
object: PWideChar;
account: PWideChar;
account_holder_name: PWideChar;
account_holder_type: PWideChar;
bank_name: PWideChar;
country: PWideChar;
currency: PWideChar;
default_for_currency: Boolean;
fingerprint: PWideChar;
last4: PWideChar;
routing_number: PWideChar;
status: PWideChar;
customer: PWideChar;
begin
rest := CkRest_Create();
// URL: https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99
bTls := True;
port := 443;
bAutoReconnect := True;
success := CkRest_Connect(rest,'api.stripe.com',port,bTls,bAutoReconnect);
if (success <> True) then
begin
Memo1.Lines.Add('ConnectFailReason: ' + IntToStr(CkRest_getConnectFailReason(rest)));
Memo1.Lines.Add(CkRest__lastErrorText(rest));
Exit;
end;
CkRest_SetAuthBasic(rest,'STRIPE_SECRET_KEY','');
sbResponseBody := CkStringBuilder_Create();
success := CkRest_FullRequestNoBodySb(rest,'GET','/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99',sbResponseBody);
if (success <> True) then
begin
Memo1.Lines.Add(CkRest__lastErrorText(rest));
Exit;
end;
jsonResponse := CkJsonObject_Create();
CkJsonObject_LoadSb(jsonResponse,sbResponseBody);
id := CkJsonObject__stringOf(jsonResponse,'id');
object := CkJsonObject__stringOf(jsonResponse,'object');
account := CkJsonObject__stringOf(jsonResponse,'account');
account_holder_name := CkJsonObject__stringOf(jsonResponse,'account_holder_name');
account_holder_type := CkJsonObject__stringOf(jsonResponse,'account_holder_type');
bank_name := CkJsonObject__stringOf(jsonResponse,'bank_name');
country := CkJsonObject__stringOf(jsonResponse,'country');
currency := CkJsonObject__stringOf(jsonResponse,'currency');
default_for_currency := CkJsonObject_BoolOf(jsonResponse,'default_for_currency');
fingerprint := CkJsonObject__stringOf(jsonResponse,'fingerprint');
last4 := CkJsonObject__stringOf(jsonResponse,'last4');
routing_number := CkJsonObject__stringOf(jsonResponse,'routing_number');
status := CkJsonObject__stringOf(jsonResponse,'status');
customer := CkJsonObject__stringOf(jsonResponse,'customer');
CkRest_Dispose(rest);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jsonResponse);
{
"id": "ba_1BnETKGswQrCoh0XzgjB3t99",
"object": "bank_account",
"account": "acct_18qpKxGswQrCoh0X",
"account_holder_name": "Jane Austen",
"account_holder_type": "individual",
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"default_for_currency": false,
"fingerprint": "L2j4aSuWk1MZMDZ5",
"last4": "6789",
"metadata": {},
"routing_number": "110000000",
"status": "new",
"customer": "cus_CBbg3iRMzWBjoe"
}