| POST | /recurringPayments/cancel | ||
|---|---|---|---|
| POST | /recurringPayments/{Id}/cancel |
import 'package:servicestack/servicestack.dart';
class CancelRecurringPaymentResult implements IConvertible
{
bool? ok;
int? id;
String? effect;
String? status;
int? subscriptionLength;
int? priorSubscriptionLength;
int? monthsPaid;
DateTime? cancelledAt;
String? reason;
bool? alreadyCancelled;
int? remaining;
int? statusCode;
String? message;
CancelRecurringPaymentResult({this.ok,this.id,this.effect,this.status,this.subscriptionLength,this.priorSubscriptionLength,this.monthsPaid,this.cancelledAt,this.reason,this.alreadyCancelled,this.remaining,this.statusCode,this.message});
CancelRecurringPaymentResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ok = json['ok'];
id = json['id'];
effect = json['effect'];
status = json['status'];
subscriptionLength = json['subscriptionLength'];
priorSubscriptionLength = json['priorSubscriptionLength'];
monthsPaid = json['monthsPaid'];
cancelledAt = JsonConverters.fromJson(json['cancelledAt'],'DateTime',context!);
reason = json['reason'];
alreadyCancelled = json['alreadyCancelled'];
remaining = json['remaining'];
statusCode = json['statusCode'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'ok': ok,
'id': id,
'effect': effect,
'status': status,
'subscriptionLength': subscriptionLength,
'priorSubscriptionLength': priorSubscriptionLength,
'monthsPaid': monthsPaid,
'cancelledAt': JsonConverters.toJson(cancelledAt,'DateTime',context!),
'reason': reason,
'alreadyCancelled': alreadyCancelled,
'remaining': remaining,
'statusCode': statusCode,
'message': message
};
getTypeName() => "CancelRecurringPaymentResult";
TypeContext? context = _ctx;
}
class CancelRecurringPaymentRequest implements IConvertible
{
int? id;
String? paymentTokenId;
String? phone;
String? reason;
String? via;
CancelRecurringPaymentRequest({this.id,this.paymentTokenId,this.phone,this.reason,this.via});
CancelRecurringPaymentRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
paymentTokenId = json['paymentTokenId'];
phone = json['phone'];
reason = json['reason'];
via = json['via'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'paymentTokenId': paymentTokenId,
'phone': phone,
'reason': reason,
'via': via
};
getTypeName() => "CancelRecurringPaymentRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'CancelRecurringPaymentResult': TypeInfo(TypeOf.Class, create:() => CancelRecurringPaymentResult()),
'CancelRecurringPaymentRequest': TypeInfo(TypeOf.Class, create:() => CancelRecurringPaymentRequest()),
});
Dart CancelRecurringPaymentRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /recurringPayments/cancel HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: 0,
paymentTokenId: String,
phone: String,
reason: String,
via: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ok: False,
id: 0,
effect: String,
status: String,
subscriptionLength: 0,
priorSubscriptionLength: 0,
monthsPaid: 0,
cancelledAt: 0001-01-01,
reason: String,
alreadyCancelled: False,
remaining: 0,
statusCode: 0,
message: String
}