TicketUserServices

<back to all web services

CancelRecurringPaymentRequest

Requires Authentication
The following routes are available for this service:
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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<CancelRecurringPaymentRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <Id>0</Id>
  <PaymentTokenId>String</PaymentTokenId>
  <Phone>String</Phone>
  <Reason>String</Reason>
  <Via>String</Via>
</CancelRecurringPaymentRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CancelRecurringPaymentResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <AlreadyCancelled>false</AlreadyCancelled>
  <CancelledAt>0001-01-01T00:00:00</CancelledAt>
  <Effect>String</Effect>
  <Id>0</Id>
  <Message>String</Message>
  <MonthsPaid>0</MonthsPaid>
  <Ok>false</Ok>
  <PriorSubscriptionLength>0</PriorSubscriptionLength>
  <Reason>String</Reason>
  <Remaining>0</Remaining>
  <Status>String</Status>
  <StatusCode>0</StatusCode>
  <SubscriptionLength>0</SubscriptionLength>
</CancelRecurringPaymentResult>