Retrieves the details of an existing refund.
curl https://api.stripe.com/v1/refunds/re_1BnETKGswQrCoh0XT2qLx7S0 \
-u STRIPE_SECRET_KEY:
#include <C_CkRest.h>
#include <C_CkStringBuilder.h>
#include <C_CkJsonObject.h>
void ChilkatSample(void)
{
HCkRest rest;
BOOL success;
BOOL bTls;
int port;
BOOL bAutoReconnect;
HCkStringBuilder sbResponseBody;
HCkJsonObject jsonResponse;
const char *id;
const char *object;
int amount;
BOOL balance_transaction;
const char *charge;
int created;
const char *currency;
BOOL reason;
BOOL receipt_number;
const char *status;
rest = CkRest_Create();
// URL: https://api.stripe.com/v1/refunds/re_1BnETKGswQrCoh0XT2qLx7S0
bTls = TRUE;
port = 443;
bAutoReconnect = TRUE;
success = CkRest_Connect(rest,"api.stripe.com",port,bTls,bAutoReconnect);
if (success != TRUE) {
printf("ConnectFailReason: %d\n",CkRest_getConnectFailReason(rest));
printf("%s\n",CkRest_lastErrorText(rest));
CkRest_Dispose(rest);
return;
}
CkRest_SetAuthBasic(rest,"STRIPE_SECRET_KEY","");
sbResponseBody = CkStringBuilder_Create();
success = CkRest_FullRequestNoBodySb(rest,"GET","/v1/refunds/re_1BnETKGswQrCoh0XT2qLx7S0",sbResponseBody);
if (success != TRUE) {
printf("%s\n",CkRest_lastErrorText(rest));
CkRest_Dispose(rest);
CkStringBuilder_Dispose(sbResponseBody);
return;
}
jsonResponse = CkJsonObject_Create();
CkJsonObject_LoadSb(jsonResponse,sbResponseBody);
id = CkJsonObject_stringOf(jsonResponse,"id");
object = CkJsonObject_stringOf(jsonResponse,"object");
amount = CkJsonObject_IntOf(jsonResponse,"amount");
balance_transaction = CkJsonObject_IsNullOf(jsonResponse,"balance_transaction");
charge = CkJsonObject_stringOf(jsonResponse,"charge");
created = CkJsonObject_IntOf(jsonResponse,"created");
currency = CkJsonObject_stringOf(jsonResponse,"currency");
reason = CkJsonObject_IsNullOf(jsonResponse,"reason");
receipt_number = CkJsonObject_IsNullOf(jsonResponse,"receipt_number");
status = CkJsonObject_stringOf(jsonResponse,"status");
CkRest_Dispose(rest);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jsonResponse);
}
{
"id": "re_1BnETKGswQrCoh0XT2qLx7S0",
"object": "refund",
"amount": 100,
"balance_transaction": null,
"charge": "ch_1BnETKGswQrCoh0XE7kJI2wj",
"created": 1516662782,
"currency": "usd",
"metadata": {},
"reason": null,
"receipt_number": null,
"status": "succeeded"
}