Updates only some card details, like the billing address or expiration date, you can do so without having to re-enter the full card details.
curl https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/card_1BnETKGswQrCoh0Xhu1A6BfL \
-u STRIPE_SECRET_KEY: \
-d name="Liam Thomas" \
-X POST
load ./chilkat.dll
set rest [new_CkRest]
# URL: https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/card_1BnETKGswQrCoh0Xhu1A6BfL
set bTls 1
set port 443
set bAutoReconnect 1
set success [CkRest_Connect $rest "api.stripe.com" $port $bTls $bAutoReconnect]
if {[expr $success != 1]} then {
puts "ConnectFailReason: [CkRest_ConnectFailReason $rest]"
puts [CkRest_lastErrorText $rest]
delete_CkRest $rest
exit
}
CkRest_SetAuthBasic $rest "STRIPE_SECRET_KEY" ""
CkRest_AddQueryParam $rest "name" "Liam Thomas"
set strResponseBody [CkRest_fullRequestFormUrlEncoded $rest "POST" "/v1/customers/cus_CBbg3iRMzWBjoe/sources/card_1BnETKGswQrCoh0Xhu1A6BfL"]
if {[expr [CkRest_LastMethodSuccess $rest] != 1]} then {
puts [CkRest_lastErrorText $rest]
delete_CkRest $rest
exit
}
set jsonResponse [new_CkJsonObject]
CkJsonObject_Load $jsonResponse $strResponseBody
set id [CkJsonObject_stringOf $jsonResponse "id"]
set object [CkJsonObject_stringOf $jsonResponse "object"]
set address_city [CkJsonObject_IsNullOf $jsonResponse "address_city"]
set address_country [CkJsonObject_IsNullOf $jsonResponse "address_country"]
set address_line1 [CkJsonObject_IsNullOf $jsonResponse "address_line1"]
set address_line1_check [CkJsonObject_IsNullOf $jsonResponse "address_line1_check"]
set address_line2 [CkJsonObject_IsNullOf $jsonResponse "address_line2"]
set address_state [CkJsonObject_IsNullOf $jsonResponse "address_state"]
set address_zip [CkJsonObject_IsNullOf $jsonResponse "address_zip"]
set address_zip_check [CkJsonObject_IsNullOf $jsonResponse "address_zip_check"]
set brand [CkJsonObject_stringOf $jsonResponse "brand"]
set country [CkJsonObject_stringOf $jsonResponse "country"]
set customer [CkJsonObject_stringOf $jsonResponse "customer"]
set cvc_check [CkJsonObject_IsNullOf $jsonResponse "cvc_check"]
set dynamic_last4 [CkJsonObject_IsNullOf $jsonResponse "dynamic_last4"]
set exp_month [CkJsonObject_IntOf $jsonResponse "exp_month"]
set exp_year [CkJsonObject_IntOf $jsonResponse "exp_year"]
set fingerprint [CkJsonObject_stringOf $jsonResponse "fingerprint"]
set funding [CkJsonObject_stringOf $jsonResponse "funding"]
set last4 [CkJsonObject_stringOf $jsonResponse "last4"]
set name [CkJsonObject_stringOf $jsonResponse "name"]
set tokenization_method [CkJsonObject_IsNullOf $jsonResponse "tokenization_method"]
delete_CkRest $rest
delete_CkJsonObject $jsonResponse
{
"id": "card_1BnETKGswQrCoh0Xhu1A6BfL",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"customer": "cus_CBbg3iRMzWBjoe",
"cvc_check": null,
"dynamic_last4": null,
"exp_month": 8,
"exp_year": 2019,
"fingerprint": "F9mANtIt1TaukpRJ",
"funding": "credit",
"last4": "4242",
"metadata": {},
"name": "Liam Thomas",
"tokenization_method": null
}