digitaluapi

<back to all web services

InitialisePaymentRequest

import 'package:servicestack/servicestack.dart';
import 'dart:collection';

class ResponseBase implements IConvertible
{
    bool? Status;
    String? Message;
    Map<String,List<String>?>? Errors;

    ResponseBase({this.Status,this.Message,this.Errors});
    ResponseBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Status = json['Status'];
        Message = json['Message'];
        Errors = JsonConverters.fromJson(json['Errors'],'Map<String,List<String>?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Status': Status,
        'Message': Message,
        'Errors': JsonConverters.toJson(Errors,'Map<String,List<String>?>',context!)
    };

    getTypeName() => "ResponseBase";
    TypeContext? context = _ctx;
}

class InitialisePaymentResponse extends ResponseBase implements IConvertible
{
    String? TransactionId;
    String? Signature;
    String? Url;

    InitialisePaymentResponse({this.TransactionId,this.Signature,this.Url});
    InitialisePaymentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        TransactionId = json['TransactionId'];
        Signature = json['Signature'];
        Url = json['Url'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'TransactionId': TransactionId,
        'Signature': Signature,
        'Url': Url
    });

    getTypeName() => "InitialisePaymentResponse";
    TypeContext? context = _ctx;
}

enum PaymentTypeEnum
{
    OneTime,
    Recurring,
}

enum FrequencyEnum
{
    Daily,
    Weekly,
    Monthly,
    Quarterly,
    Biannually,
    Annually,
}

class InitialisePaymentRequest implements IConvertible
{
    PaymentTypeEnum? PaymentType;
    String? Uuid;
    String? ReferenceNumber;
    double? Amount;
    String? Currency;
    String? ItemName;
    String? ItemDescription;
    DateTime? BillingDate;
    FrequencyEnum? Frequency;
    int? Cycles;

    InitialisePaymentRequest({this.PaymentType,this.Uuid,this.ReferenceNumber,this.Amount,this.Currency,this.ItemName,this.ItemDescription,this.BillingDate,this.Frequency,this.Cycles});
    InitialisePaymentRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        PaymentType = JsonConverters.fromJson(json['PaymentType'],'PaymentTypeEnum',context!);
        Uuid = json['Uuid'];
        ReferenceNumber = json['ReferenceNumber'];
        Amount = JsonConverters.toDouble(json['Amount']);
        Currency = json['Currency'];
        ItemName = json['ItemName'];
        ItemDescription = json['ItemDescription'];
        BillingDate = JsonConverters.fromJson(json['BillingDate'],'DateTime',context!);
        Frequency = JsonConverters.fromJson(json['Frequency'],'FrequencyEnum',context!);
        Cycles = json['Cycles'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'PaymentType': JsonConverters.toJson(PaymentType,'PaymentTypeEnum',context!),
        'Uuid': Uuid,
        'ReferenceNumber': ReferenceNumber,
        'Amount': Amount,
        'Currency': Currency,
        'ItemName': ItemName,
        'ItemDescription': ItemDescription,
        'BillingDate': JsonConverters.toJson(BillingDate,'DateTime',context!),
        'Frequency': JsonConverters.toJson(Frequency,'FrequencyEnum',context!),
        'Cycles': Cycles
    };

    getTypeName() => "InitialisePaymentRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'duengageapi.uat.scadsoftware.com', types: <String, TypeInfo> {
    'ResponseBase': TypeInfo(TypeOf.Class, create:() => ResponseBase()),
    'Map<String,List<String>?>': TypeInfo(TypeOf.Class, create:() => Map<String,List<String>?>()),
    'InitialisePaymentResponse': TypeInfo(TypeOf.Class, create:() => InitialisePaymentResponse()),
    'PaymentTypeEnum': TypeInfo(TypeOf.Enum, enumValues:PaymentTypeEnum.values),
    'FrequencyEnum': TypeInfo(TypeOf.Enum, enumValues:FrequencyEnum.values),
    'InitialisePaymentRequest': TypeInfo(TypeOf.Class, create:() => InitialisePaymentRequest()),
});

Dart InitialisePaymentRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /json/reply/InitialisePaymentRequest HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"PaymentType":"OneTime","Uuid":"00000000000000000000000000000000","ReferenceNumber":"String","Amount":0,"Currency":"String","ItemName":"String","ItemDescription":"String","BillingDate":"0001-01-01T00:00:00.0000000","Frequency":"Daily","Cycles":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"TransactionId":"String","Signature":"String","Url":"String","Status":false,"Message":"String","Errors":{"String":["String"]}}