Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.
curl https://api.stripe.com/v1/sources/src_1BnETLGswQrCoh0X5KOorXEP \
-u STRIPE_SECRET_KEY:
func chilkatTest() {
let rest = CkoRest()
var success: Bool
// URL: https://api.stripe.com/v1/sources/src_1BnETLGswQrCoh0X5KOorXEP
var bTls: Bool = true
var port: Int = 443
var bAutoReconnect: Bool = true
success = rest.Connect("api.stripe.com", port: port, tls: bTls, autoReconnect: bAutoReconnect)
if success != true {
print("ConnectFailReason: \(rest.ConnectFailReason.integerValue)")
print("\(rest.LastErrorText)")
return
}
rest.SetAuthBasic("STRIPE_SECRET_KEY", password: "")
let sbResponseBody = CkoStringBuilder()
success = rest.FullRequestNoBodySb("GET", uriPath: "/v1/sources/src_1BnETLGswQrCoh0X5KOorXEP", sb: sbResponseBody)
if success != true {
print("\(rest.LastErrorText)")
return
}
let jsonResponse = CkoJsonObject()
jsonResponse.LoadSb(sbResponseBody)
var id: String?
var object: String?
var amount: Int
var client_secret: String?
var created: Int
var currency: String?
var flow: String?
var livemode: Bool
var ownerAddress: Bool
var ownerEmail: String?
var ownerName: Bool
var ownerPhone: Bool
var ownerVerified_address: Bool
var ownerVerified_email: Bool
var ownerVerified_name: Bool
var ownerVerified_phone: Bool
var receiverAddress: String?
var receiverAmount_charged: Int
var receiverAmount_received: Int
var receiverAmount_returned: Int
var receiverRefund_attributes_method: String?
var receiverRefund_attributes_status: String?
var statement_descriptor: Bool
var status: String?
var type: String?
var usage: String?
var bitcoinAddress: String?
var bitcoinAmount: Int
var bitcoinAmount_charged: Int
var bitcoinAmount_received: Int
var bitcoinAmount_returned: Int
var bitcoinUri: String?
id = jsonResponse.StringOf("id")
object = jsonResponse.StringOf("object")
amount = jsonResponse.IntOf("amount").integerValue
client_secret = jsonResponse.StringOf("client_secret")
created = jsonResponse.IntOf("created").integerValue
currency = jsonResponse.StringOf("currency")
flow = jsonResponse.StringOf("flow")
livemode = jsonResponse.BoolOf("livemode")
ownerAddress = jsonResponse.IsNullOf("owner.address")
ownerEmail = jsonResponse.StringOf("owner.email")
ownerName = jsonResponse.IsNullOf("owner.name")
ownerPhone = jsonResponse.IsNullOf("owner.phone")
ownerVerified_address = jsonResponse.IsNullOf("owner.verified_address")
ownerVerified_email = jsonResponse.IsNullOf("owner.verified_email")
ownerVerified_name = jsonResponse.IsNullOf("owner.verified_name")
ownerVerified_phone = jsonResponse.IsNullOf("owner.verified_phone")
receiverAddress = jsonResponse.StringOf("receiver.address")
receiverAmount_charged = jsonResponse.IntOf("receiver.amount_charged").integerValue
receiverAmount_received = jsonResponse.IntOf("receiver.amount_received").integerValue
receiverAmount_returned = jsonResponse.IntOf("receiver.amount_returned").integerValue
receiverRefund_attributes_method = jsonResponse.StringOf("receiver.refund_attributes_method")
receiverRefund_attributes_status = jsonResponse.StringOf("receiver.refund_attributes_status")
statement_descriptor = jsonResponse.IsNullOf("statement_descriptor")
status = jsonResponse.StringOf("status")
type = jsonResponse.StringOf("type")
usage = jsonResponse.StringOf("usage")
bitcoinAddress = jsonResponse.StringOf("bitcoin.address")
bitcoinAmount = jsonResponse.IntOf("bitcoin.amount").integerValue
bitcoinAmount_charged = jsonResponse.IntOf("bitcoin.amount_charged").integerValue
bitcoinAmount_received = jsonResponse.IntOf("bitcoin.amount_received").integerValue
bitcoinAmount_returned = jsonResponse.IntOf("bitcoin.amount_returned").integerValue
bitcoinUri = jsonResponse.StringOf("bitcoin.uri")
}
{
"id": "src_1BnETLGswQrCoh0X5KOorXEP",
"object": "source",
"amount": 1000,
"client_secret": "src_client_secret_CBbgdvc1AflN5jN0wQevA2jA",
"created": 1516662783,
"currency": "usd",
"flow": "receiver",
"livemode": false,
"metadata": {},
"owner": {
"address": null,
"email": "jenny.rosen@example.com",
"name": null,
"phone": null,
"verified_address": null,
"verified_email": null,
"verified_name": null,
"verified_phone": null
},
"receiver": {
"address": "test_1MBhWS3uv4ynCfQXF3xQjJkzFPukr4K56N",
"amount_charged": 0,
"amount_received": 0,
"amount_returned": 0,
"refund_attributes_method": "email",
"refund_attributes_status": "missing"
},
"statement_descriptor": null,
"status": "pending",
"type": "bitcoin",
"usage": "single_use",
"bitcoin": {
"address": "test_1MBhWS3uv4ynCfQXF3xQjJkzFPukr4K56N",
"amount": 2371000,
"amount_charged": 0,
"amount_received": 0,
"amount_returned": 0,
"uri": "bitcoin:test_1MBhWS3uv4ynCfQXF3xQjJkzFPukr4K56N?amount=0.02371000"
}
}