Billhighway Cloud API

<back to all web services

CreditCardPaymentCollection

The following routes are available for this service:
POST/payments/creditcard
import Foundation
import ServiceStack

public class CreditCardPaymentCollection : Codable
{
    public var creditCardPaymentList:[CreditCardPayment] = []

    required public init(){}
}

public class CreditCardPayment : CreditCardPayment
{
    public var subscriptionInfo:SubscriptionParameters?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case subscriptionInfo
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        subscriptionInfo = try container.decodeIfPresent(SubscriptionParameters.self, forKey: .subscriptionInfo)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if subscriptionInfo != nil { try container.encode(subscriptionInfo, forKey: .subscriptionInfo) }
    }
}

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 CreditCardPaymentReply : Codable
{
    public var className:String?
    public var uniqueId:String?
    public var createdDateTime:Date?
    public var clientId:Int?
    public var transactionId:String?
    public var errorCode:Int?
    public var errorMessage:String?

    required public init(){}
}


Swift CreditCardPaymentCollection DTOs

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

HTTP + JSV

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

POST /payments/creditcard HTTP/1.1 
Host: devapi.billhighway.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CreditCardPaymentList: 
	[
		{
			ClassName: String,
			UniqueId: String,
			CreatedDateTime: 0001-01-01,
			ClientId: 0,
			GroupId: String,
			UserId: String,
			BhUserId: 0,
			Amount: String,
			AutoPay: False,
			CurrencyType: String,
			Country: String,
			CardReferenceOrCardNumber: String,
			StoreCardInfo: False,
			Address1: String,
			Address2: String,
			BillingCity: String,
			BillingState: String,
			PreferredEmailAddress: String,
			Memo: String,
			OpportunityId: String,
			ExpMonth: 0,
			ExpYear: 0,
			Cvv: String,
			PostalCode: String,
			Location: String,
			NameOnCard: String,
			CardType: String,
			InvoiceList: 
			[
				{
					ClassName: String,
					UniqueId: String,
					CreatedDateTime: 0001-01-01,
					ClientId: 0,
					Invoice: 0,
					AmountPaid: String
				}
			]
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ClassName: String,
	UniqueId: String,
	CreatedDateTime: 0001-01-01,
	ClientId: 0,
	TransactionId: String,
	ErrorCode: 0,
	ErrorMessage: String
}