import Foundation
import ServiceStack
public class BillMeLaterSubscription : Codable
{
public var header:ApiClientHeader?
public var subscriptionInfo:SubscriptionParameters?
public var campaignInfo:[CampaignInformation] = []
required public init(){}
}
public class ApiClientHeader : Codable
{
public var clientId:Int?
public var referrer:String?
public var ipAddress:String?
public var loggedInUserId:Int?
public var groupId:Int?
public var task:String?
public var machine:String?
public var location:String?
public var createdBy:Int?
public var campaignId:Int?
public var reCaptchaScore:Double?
required public init(){}
}
public class SubscriptionParameters : Codable
{
public var formTemplateID:Int?
public var subscriptionInvoiceID:Int?
public var clientSubscriberId:String?
public var signupTypeID:Int?
public var frequencyID:Int?
public var autoRenew:Bool?
public var companyID:Int?
public var userID:Int?
public var chapMemPayID:Int?
public var memberSubscriptionInvID:Int?
public var fields:[SubscriberFormField] = []
public var createdBy:Int?
public var updatedBy:Int?
public var aptifyUpdateType:Int?
public var renewedMemberSubscriptionInvID:Int?
public var chapId:Int?
required public init(){}
}
public class SubscriberFormField : Codable
{
public var name:String?
public var value:String?
required public init(){}
}
public class CampaignInformation : Codable
{
public var campaignId:Int?
public var campaignName:String?
public var amount:Double?
public var chapPayID:String?
required public init(){}
}
public class BillMePaymentResult : BillMeCloudServiceResponse
{
public var transactionRecordID:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case transactionRecordID
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
transactionRecordID = try container.decodeIfPresent(Int.self, forKey: .transactionRecordID)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if transactionRecordID != nil { try container.encode(transactionRecordID, forKey: .transactionRecordID) }
}
}
public class BillMeCloudServiceResponse : Codable
{
public var isDuplicate:Bool?
public var isSuccessful:Bool?
public var errorCode:String?
public var message:String?
public var isError:Bool?
required public init(){}
}
Swift BillMeLaterSubscription 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /json/reply/BillMeLaterSubscription HTTP/1.1
Host: devapi.billhighway.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Header":{"ClientId":0,"Referrer":"String","IpAddress":"String","LoggedInUserId":0,"GroupId":0,"Task":"String","Machine":"String","Location":"String","CreatedBy":0,"CampaignId":0,"ReCaptchaScore":0},"SubscriptionInfo":{"FormTemplateID":0,"SubscriptionInvoiceID":0,"ClientSubscriberId":"String","SignupTypeID":0,"FrequencyID":0,"AutoRenew":false,"CompanyID":0,"UserID":0,"ChapMemPayID":0,"MemberSubscriptionInvID":0,"Fields":[{"Name":"String","Value":"String"}],"CreatedBy":0,"UpdatedBy":0,"AptifyUpdateType":0,"RenewedMemberSubscriptionInvID":0,"ChapId":0},"CampaignInfo":[{"CampaignId":0,"CampaignName":"String","Amount":0,"ChapPayID":"String"}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"TransactionRecordID":0,"IsDuplicate":false,"IsSuccessful":false,"ErrorCode":"String","Message":"String","IsError":false}