Returns a list of all refunds you’ve previously created.
curl https://api.stripe.com/v1/refunds?limit=3 \
-u STRIPE_SECRET_KEY: \
-G
#import <CkoRest.h>
#import <CkoStringBuilder.h>
#import <CkoJsonObject.h>
#import <NSString.h>
CkoRest *rest = [[CkoRest alloc] init];
BOOL success;
// URL: https://api.stripe.com/v1/refunds?limit=3
BOOL bTls = YES;
int port = 443;
BOOL bAutoReconnect = YES;
success = [rest Connect: @"api.stripe.com" port: [NSNumber numberWithInt: port] tls: bTls autoReconnect: bAutoReconnect];
if (success != YES) {
NSLog(@"%@%d",@"ConnectFailReason: ",[rest.ConnectFailReason intValue]);
NSLog(@"%@",rest.LastErrorText);
return;
}
[rest SetAuthBasic: @"STRIPE_SECRET_KEY" password: @""];
CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
success = [rest FullRequestNoBodySb: @"GET" uriPath: @"/v1/refunds?limit=3" sb: sbResponseBody];
if (success != YES) {
NSLog(@"%@",rest.LastErrorText);
return;
}
CkoJsonObject *jsonResponse = [[CkoJsonObject alloc] init];
[jsonResponse LoadSb: sbResponseBody];
NSString *object = 0;
NSString *url = 0;
BOOL has_more;
int i;
int count_i;
NSString *id = 0;
int amount;
BOOL balance_transaction;
NSString *charge = 0;
int created;
NSString *currency = 0;
BOOL reason;
BOOL receipt_number;
NSString *status = 0;
object = [jsonResponse StringOf: @"object"];
url = [jsonResponse StringOf: @"url"];
has_more = [jsonResponse BoolOf: @"has_more"];
i = 0;
count_i = [[jsonResponse SizeOfArray: @"data"] intValue];
while (i < count_i) {
jsonResponse.I = [NSNumber numberWithInt: i];
id = [jsonResponse StringOf: @"data[i].id"];
object = [jsonResponse StringOf: @"data[i].object"];
amount = [[jsonResponse IntOf: @"data[i].amount"] intValue];
balance_transaction = [jsonResponse IsNullOf: @"data[i].balance_transaction"];
charge = [jsonResponse StringOf: @"data[i].charge"];
created = [[jsonResponse IntOf: @"data[i].created"] intValue];
currency = [jsonResponse StringOf: @"data[i].currency"];
reason = [jsonResponse IsNullOf: @"data[i].reason"];
receipt_number = [jsonResponse IsNullOf: @"data[i].receipt_number"];
status = [jsonResponse StringOf: @"data[i].status"];
i = i + 1;
}
{
"object": "list",
"url": "/v1/refunds",
"has_more": false,
"data": [
{
"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"
}
]
}