Billhighway Cloud API

<back to all web services

BillMeLaterSubscription

import 'package:servicestack/servicestack.dart';

class ApiClientHeader implements IConvertible
{
    int? ClientId;
    String? Referrer;
    String? IpAddress;
    int? LoggedInUserId;
    int? GroupId;
    String? Task;
    String? Machine;
    String? Location;
    int? CreatedBy;
    int? CampaignId;
    double? ReCaptchaScore;

    ApiClientHeader({this.ClientId,this.Referrer,this.IpAddress,this.LoggedInUserId,this.GroupId,this.Task,this.Machine,this.Location,this.CreatedBy,this.CampaignId,this.ReCaptchaScore});
    ApiClientHeader.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ClientId = json['ClientId'];
        Referrer = json['Referrer'];
        IpAddress = json['IpAddress'];
        LoggedInUserId = json['LoggedInUserId'];
        GroupId = json['GroupId'];
        Task = json['Task'];
        Machine = json['Machine'];
        Location = json['Location'];
        CreatedBy = json['CreatedBy'];
        CampaignId = json['CampaignId'];
        ReCaptchaScore = JsonConverters.toDouble(json['ReCaptchaScore']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ClientId': ClientId,
        'Referrer': Referrer,
        'IpAddress': IpAddress,
        'LoggedInUserId': LoggedInUserId,
        'GroupId': GroupId,
        'Task': Task,
        'Machine': Machine,
        'Location': Location,
        'CreatedBy': CreatedBy,
        'CampaignId': CampaignId,
        'ReCaptchaScore': ReCaptchaScore
    };

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

class SubscriberFormField implements IConvertible
{
    String? Name;
    String? Value;

    SubscriberFormField({this.Name,this.Value});
    SubscriberFormField.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Name = json['Name'];
        Value = json['Value'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Name': Name,
        'Value': Value
    };

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

class SubscriptionParameters implements IConvertible
{
    int? FormTemplateID;
    int? SubscriptionInvoiceID;
    String? ClientSubscriberId;
    int? SignupTypeID;
    int? FrequencyID;
    bool? AutoRenew;
    int? CompanyID;
    int? UserID;
    int? ChapMemPayID;
    int? MemberSubscriptionInvID;
    List<SubscriberFormField>? Fields;
    int? CreatedBy;
    int? UpdatedBy;
    int? AptifyUpdateType;
    int? RenewedMemberSubscriptionInvID;
    int? ChapId;

    SubscriptionParameters({this.FormTemplateID,this.SubscriptionInvoiceID,this.ClientSubscriberId,this.SignupTypeID,this.FrequencyID,this.AutoRenew,this.CompanyID,this.UserID,this.ChapMemPayID,this.MemberSubscriptionInvID,this.Fields,this.CreatedBy,this.UpdatedBy,this.AptifyUpdateType,this.RenewedMemberSubscriptionInvID,this.ChapId});
    SubscriptionParameters.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FormTemplateID = json['FormTemplateID'];
        SubscriptionInvoiceID = json['SubscriptionInvoiceID'];
        ClientSubscriberId = json['ClientSubscriberId'];
        SignupTypeID = json['SignupTypeID'];
        FrequencyID = json['FrequencyID'];
        AutoRenew = json['AutoRenew'];
        CompanyID = json['CompanyID'];
        UserID = json['UserID'];
        ChapMemPayID = json['ChapMemPayID'];
        MemberSubscriptionInvID = json['MemberSubscriptionInvID'];
        Fields = JsonConverters.fromJson(json['Fields'],'List<SubscriberFormField>',context!);
        CreatedBy = json['CreatedBy'];
        UpdatedBy = json['UpdatedBy'];
        AptifyUpdateType = json['AptifyUpdateType'];
        RenewedMemberSubscriptionInvID = json['RenewedMemberSubscriptionInvID'];
        ChapId = json['ChapId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FormTemplateID': FormTemplateID,
        'SubscriptionInvoiceID': SubscriptionInvoiceID,
        'ClientSubscriberId': ClientSubscriberId,
        'SignupTypeID': SignupTypeID,
        'FrequencyID': FrequencyID,
        'AutoRenew': AutoRenew,
        'CompanyID': CompanyID,
        'UserID': UserID,
        'ChapMemPayID': ChapMemPayID,
        'MemberSubscriptionInvID': MemberSubscriptionInvID,
        'Fields': JsonConverters.toJson(Fields,'List<SubscriberFormField>',context!),
        'CreatedBy': CreatedBy,
        'UpdatedBy': UpdatedBy,
        'AptifyUpdateType': AptifyUpdateType,
        'RenewedMemberSubscriptionInvID': RenewedMemberSubscriptionInvID,
        'ChapId': ChapId
    };

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

class CampaignInformation implements IConvertible
{
    int? CampaignId;
    String? CampaignName;
    double? Amount;
    String? ChapPayID;

    CampaignInformation({this.CampaignId,this.CampaignName,this.Amount,this.ChapPayID});
    CampaignInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CampaignId = json['CampaignId'];
        CampaignName = json['CampaignName'];
        Amount = JsonConverters.toDouble(json['Amount']);
        ChapPayID = json['ChapPayID'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CampaignId': CampaignId,
        'CampaignName': CampaignName,
        'Amount': Amount,
        'ChapPayID': ChapPayID
    };

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

class BillMeLaterSubscription implements IConvertible
{
    ApiClientHeader? Header;
    SubscriptionParameters? SubscriptionInfo;
    List<CampaignInformation>? CampaignInfo;

    BillMeLaterSubscription({this.Header,this.SubscriptionInfo,this.CampaignInfo});
    BillMeLaterSubscription.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Header = JsonConverters.fromJson(json['Header'],'ApiClientHeader',context!);
        SubscriptionInfo = JsonConverters.fromJson(json['SubscriptionInfo'],'SubscriptionParameters',context!);
        CampaignInfo = JsonConverters.fromJson(json['CampaignInfo'],'List<CampaignInformation>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Header': JsonConverters.toJson(Header,'ApiClientHeader',context!),
        'SubscriptionInfo': JsonConverters.toJson(SubscriptionInfo,'SubscriptionParameters',context!),
        'CampaignInfo': JsonConverters.toJson(CampaignInfo,'List<CampaignInformation>',context!)
    };

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

class BillMeCloudServiceResponse implements IConvertible
{
    bool? IsDuplicate;
    bool? IsSuccessful;
    String? ErrorCode;
    String? Message;
    bool? IsError;

    BillMeCloudServiceResponse({this.IsDuplicate,this.IsSuccessful,this.ErrorCode,this.Message,this.IsError});
    BillMeCloudServiceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        IsDuplicate = json['IsDuplicate'];
        IsSuccessful = json['IsSuccessful'];
        ErrorCode = json['ErrorCode'];
        Message = json['Message'];
        IsError = json['IsError'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'IsDuplicate': IsDuplicate,
        'IsSuccessful': IsSuccessful,
        'ErrorCode': ErrorCode,
        'Message': Message,
        'IsError': IsError
    };

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

class BillMePaymentResult extends BillMeCloudServiceResponse implements IConvertible
{
    int? TransactionRecordID;

    BillMePaymentResult({this.TransactionRecordID});
    BillMePaymentResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
    'ApiClientHeader': TypeInfo(TypeOf.Class, create:() => ApiClientHeader()),
    'SubscriberFormField': TypeInfo(TypeOf.Class, create:() => SubscriberFormField()),
    'SubscriptionParameters': TypeInfo(TypeOf.Class, create:() => SubscriptionParameters()),
    'List<SubscriberFormField>': TypeInfo(TypeOf.Class, create:() => <SubscriberFormField>[]),
    'CampaignInformation': TypeInfo(TypeOf.Class, create:() => CampaignInformation()),
    'BillMeLaterSubscription': TypeInfo(TypeOf.Class, create:() => BillMeLaterSubscription()),
    'List<CampaignInformation>': TypeInfo(TypeOf.Class, create:() => <CampaignInformation>[]),
    'BillMeCloudServiceResponse': TypeInfo(TypeOf.Class, create:() => BillMeCloudServiceResponse()),
    'BillMePaymentResult': TypeInfo(TypeOf.Class, create:() => BillMePaymentResult()),
});

Dart BillMeLaterSubscription 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 /xml/reply/BillMeLaterSubscription HTTP/1.1 
Host: devapi.billhighway.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<BillMeLaterSubscription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.billhighway.com/api">
  <CampaignInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.Subscriptions">
    <d2p1:CampaignInformation>
      <d2p1:Amount>0</d2p1:Amount>
      <d2p1:CampaignId>0</d2p1:CampaignId>
      <d2p1:CampaignName>String</d2p1:CampaignName>
      <d2p1:ChapPayID>String</d2p1:ChapPayID>
    </d2p1:CampaignInformation>
  </CampaignInfo>
  <Header xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common.DTO">
    <d2p1:CampaignId>0</d2p1:CampaignId>
    <d2p1:ClientId>0</d2p1:ClientId>
    <d2p1:CreatedBy>0</d2p1:CreatedBy>
    <d2p1:GroupId>0</d2p1:GroupId>
    <d2p1:IpAddress>String</d2p1:IpAddress>
    <d2p1:Location>String</d2p1:Location>
    <d2p1:LoggedInUserId>0</d2p1:LoggedInUserId>
    <d2p1:Machine>String</d2p1:Machine>
    <d2p1:ReCaptchaScore>0</d2p1:ReCaptchaScore>
    <d2p1:Referrer>String</d2p1:Referrer>
    <d2p1:Task>String</d2p1:Task>
  </Header>
  <SubscriptionInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce">
    <d2p1:AptifyUpdateType>0</d2p1:AptifyUpdateType>
    <d2p1:AutoRenew>false</d2p1:AutoRenew>
    <d2p1:ChapId>0</d2p1:ChapId>
    <d2p1:ChapMemPayID>0</d2p1:ChapMemPayID>
    <d2p1:ClientSubscriberId>String</d2p1:ClientSubscriberId>
    <d2p1:CompanyID>0</d2p1:CompanyID>
    <d2p1:CreatedBy>0</d2p1:CreatedBy>
    <d2p1:Fields>
      <d2p1:SubscriberFormField>
        <d2p1:_x003C_Name_x003E_k__BackingField>String</d2p1:_x003C_Name_x003E_k__BackingField>
        <d2p1:_x003C_Value_x003E_k__BackingField>String</d2p1:_x003C_Value_x003E_k__BackingField>
      </d2p1:SubscriberFormField>
    </d2p1:Fields>
    <d2p1:FormTemplateID>0</d2p1:FormTemplateID>
    <d2p1:FrequencyID>0</d2p1:FrequencyID>
    <d2p1:MemberSubscriptionInvID>0</d2p1:MemberSubscriptionInvID>
    <d2p1:RenewedMemberSubscriptionInvID>0</d2p1:RenewedMemberSubscriptionInvID>
    <d2p1:SignupTypeID>0</d2p1:SignupTypeID>
    <d2p1:SubscriptionInvoiceID>0</d2p1:SubscriptionInvoiceID>
    <d2p1:UpdatedBy>0</d2p1:UpdatedBy>
    <d2p1:UserID>0</d2p1:UserID>
  </SubscriptionInfo>
</BillMeLaterSubscription>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<BillMePaymentResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common.DTO">
  <ErrorCode>String</ErrorCode>
  <IsDuplicate>false</IsDuplicate>
  <IsError>false</IsError>
  <IsSuccessful>false</IsSuccessful>
  <Message>String</Message>
  <TransactionRecordID>0</TransactionRecordID>
</BillMePaymentResult>