| POST, PUT, DELETE | /api/SalesForce/StoredAccountDetail | ||
|---|---|---|---|
| POST, PUT, DELETE | /members/storedaccountdetail |
import Foundation
import ServiceStack
public class StoredAccountDetail : BaseClass
{
public var storedAccountId:Int?
public var nameOnCard:String?
public var clientId:Int?
public var groupId:String?
public var clientUserId:String?
public var bhUserId:Int?
public var cardNumber:String?
public var expMonth:Int?
public var expYear:Int?
public var cvv:String?
public var cardType:String?
public var billingAddress:String?
public var billingCity:String?
public var billingState:String?
public var billingPostalCode:String?
public var billingCountry:String?
public var errorCode:String?
public var message:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case storedAccountId
case nameOnCard
case clientId
case groupId
case clientUserId
case bhUserId
case cardNumber
case expMonth
case expYear
case cvv
case cardType
case billingAddress
case billingCity
case billingState
case billingPostalCode
case billingCountry
case errorCode
case message
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
storedAccountId = try container.decodeIfPresent(Int.self, forKey: .storedAccountId)
nameOnCard = try container.decodeIfPresent(String.self, forKey: .nameOnCard)
clientId = try container.decodeIfPresent(Int.self, forKey: .clientId)
groupId = try container.decodeIfPresent(String.self, forKey: .groupId)
clientUserId = try container.decodeIfPresent(String.self, forKey: .clientUserId)
bhUserId = try container.decodeIfPresent(Int.self, forKey: .bhUserId)
cardNumber = try container.decodeIfPresent(String.self, forKey: .cardNumber)
expMonth = try container.decodeIfPresent(Int.self, forKey: .expMonth)
expYear = try container.decodeIfPresent(Int.self, forKey: .expYear)
cvv = try container.decodeIfPresent(String.self, forKey: .cvv)
cardType = try container.decodeIfPresent(String.self, forKey: .cardType)
billingAddress = try container.decodeIfPresent(String.self, forKey: .billingAddress)
billingCity = try container.decodeIfPresent(String.self, forKey: .billingCity)
billingState = try container.decodeIfPresent(String.self, forKey: .billingState)
billingPostalCode = try container.decodeIfPresent(String.self, forKey: .billingPostalCode)
billingCountry = try container.decodeIfPresent(String.self, forKey: .billingCountry)
errorCode = try container.decodeIfPresent(String.self, forKey: .errorCode)
message = try container.decodeIfPresent(String.self, forKey: .message)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if storedAccountId != nil { try container.encode(storedAccountId, forKey: .storedAccountId) }
if nameOnCard != nil { try container.encode(nameOnCard, forKey: .nameOnCard) }
if clientId != nil { try container.encode(clientId, forKey: .clientId) }
if groupId != nil { try container.encode(groupId, forKey: .groupId) }
if clientUserId != nil { try container.encode(clientUserId, forKey: .clientUserId) }
if bhUserId != nil { try container.encode(bhUserId, forKey: .bhUserId) }
if cardNumber != nil { try container.encode(cardNumber, forKey: .cardNumber) }
if expMonth != nil { try container.encode(expMonth, forKey: .expMonth) }
if expYear != nil { try container.encode(expYear, forKey: .expYear) }
if cvv != nil { try container.encode(cvv, forKey: .cvv) }
if cardType != nil { try container.encode(cardType, forKey: .cardType) }
if billingAddress != nil { try container.encode(billingAddress, forKey: .billingAddress) }
if billingCity != nil { try container.encode(billingCity, forKey: .billingCity) }
if billingState != nil { try container.encode(billingState, forKey: .billingState) }
if billingPostalCode != nil { try container.encode(billingPostalCode, forKey: .billingPostalCode) }
if billingCountry != nil { try container.encode(billingCountry, forKey: .billingCountry) }
if errorCode != nil { try container.encode(errorCode, forKey: .errorCode) }
if message != nil { try container.encode(message, forKey: .message) }
}
}
public class BaseClass : Codable
{
public var className:String?
public var uniqueId:String?
public var createdDateTime:Date?
public var version:Int?
required public init(){}
}
Swift StoredAccountDetail DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/SalesForce/StoredAccountDetail HTTP/1.1
Host: devapi.billhighway.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
StoredAccountId: 0,
NameOnCard: String,
ClientId: 0,
GroupId: String,
ClientUserId: String,
BhUserId: 0,
CardNumber: String,
ExpMonth: 0,
ExpYear: 0,
Cvv: String,
CardType: String,
BillingAddress: String,
BillingCity: String,
BillingState: String,
BillingPostalCode: String,
BillingCountry: String,
ErrorCode: String,
Message: String,
ClassName: String,
UniqueId: String,
CreatedDateTime: 0001-01-01,
Version: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
StoredAccountId: 0,
NameOnCard: String,
ClientId: 0,
GroupId: String,
ClientUserId: String,
BhUserId: 0,
CardNumber: String,
ExpMonth: 0,
ExpYear: 0,
Cvv: String,
CardType: String,
BillingAddress: String,
BillingCity: String,
BillingState: String,
BillingPostalCode: String,
BillingCountry: String,
ErrorCode: String,
Message: String,
ClassName: String,
UniqueId: String,
CreatedDateTime: 0001-01-01,
Version: 0
}