Creates a new bank account object.
curl https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources \
-u STRIPE_SECRET_KEY: \
-d source=btok_1BnETKGswQrCoh0X43GQEzjM \
-X POST
LOCAL loRest
LOCAL lnSuccess
LOCAL lnBTls
LOCAL lnPort
LOCAL lnBAutoReconnect
LOCAL lcStrResponseBody
LOCAL loJsonResponse
LOCAL lcId
LOCAL lcObject
LOCAL lcAccount
LOCAL lcAccount_holder_name
LOCAL lcAccount_holder_type
LOCAL lcBank_name
LOCAL lcCountry
LOCAL lcCurrency
LOCAL lnDefault_for_currency
LOCAL lcFingerprint
LOCAL lcLast4
LOCAL lcRouting_number
LOCAL lcStatus
LOCAL lcCustomer
loRest = CreateObject('Chilkat_9_5_0.Rest')
* URL: https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources
lnBTls = 1
lnPort = 443
lnBAutoReconnect = 1
lnSuccess = loRest.Connect("api.stripe.com",lnPort,lnBTls,lnBAutoReconnect)
IF (lnSuccess <> 1) THEN
? "ConnectFailReason: " + STR(loRest.ConnectFailReason)
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
loRest.SetAuthBasic("STRIPE_SECRET_KEY","")
loRest.AddQueryParam("source","btok_1BnETKGswQrCoh0X43GQEzjM")
lcStrResponseBody = loRest.FullRequestFormUrlEncoded("POST","/v1/customers/cus_CBbg3iRMzWBjoe/sources")
IF (loRest.LastMethodSuccess <> 1) THEN
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
loJsonResponse = CreateObject('Chilkat_9_5_0.JsonObject')
loJsonResponse.Load(lcStrResponseBody)
lcId = loJsonResponse.StringOf("id")
lcObject = loJsonResponse.StringOf("object")
lcAccount = loJsonResponse.StringOf("account")
lcAccount_holder_name = loJsonResponse.StringOf("account_holder_name")
lcAccount_holder_type = loJsonResponse.StringOf("account_holder_type")
lcBank_name = loJsonResponse.StringOf("bank_name")
lcCountry = loJsonResponse.StringOf("country")
lcCurrency = loJsonResponse.StringOf("currency")
lnDefault_for_currency = loJsonResponse.BoolOf("default_for_currency")
lcFingerprint = loJsonResponse.StringOf("fingerprint")
lcLast4 = loJsonResponse.StringOf("last4")
lcRouting_number = loJsonResponse.StringOf("routing_number")
lcStatus = loJsonResponse.StringOf("status")
lcCustomer = loJsonResponse.StringOf("customer")
RELEASE loRest
RELEASE loJsonResponse
{
"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"
}