| POST | /integrations/api/{tokenType}/charge/token |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:collection';
class ChargeTokenOptions implements IConvertible
{
int? Usages;
int? Duration;
ChargeTokenOptions({this.Usages,this.Duration});
ChargeTokenOptions.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Usages = json['Usages'];
Duration = json['Duration'];
return this;
}
Map<String, dynamic> toJson() => {
'Usages': Usages,
'Duration': Duration
};
getTypeName() => "ChargeTokenOptions";
TypeContext? context = _ctx;
}
class AttributeItem implements IConvertible
{
String? Name;
String? Value;
AttributeItem({this.Name,this.Value});
AttributeItem.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() => "AttributeItem";
TypeContext? context = _ctx;
}
class CreditCardBillingAddressItem implements IConvertible
{
String? Address1;
String? Address2;
String? City;
String? PostalCode;
String? Region;
String? Country;
List<AttributeItem>? Attributes;
CreditCardBillingAddressItem({this.Address1,this.Address2,this.City,this.PostalCode,this.Region,this.Country,this.Attributes});
CreditCardBillingAddressItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Address1 = json['Address1'];
Address2 = json['Address2'];
City = json['City'];
PostalCode = json['PostalCode'];
Region = json['Region'];
Country = json['Country'];
Attributes = JsonConverters.fromJson(json['Attributes'],'List<AttributeItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Address1': Address1,
'Address2': Address2,
'City': City,
'PostalCode': PostalCode,
'Region': Region,
'Country': Country,
'Attributes': JsonConverters.toJson(Attributes,'List<AttributeItem>',context!)
};
getTypeName() => "CreditCardBillingAddressItem";
TypeContext? context = _ctx;
}
class CreditCardChargeItem implements IConvertible
{
String? NameOnCard;
int? ExpMonth;
int? ExpYear;
String? CardNumber;
String? Cvv;
CreditCardBillingAddressItem? Address;
CreditCardChargeItem({this.NameOnCard,this.ExpMonth,this.ExpYear,this.CardNumber,this.Cvv,this.Address});
CreditCardChargeItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
NameOnCard = json['NameOnCard'];
ExpMonth = json['ExpMonth'];
ExpYear = json['ExpYear'];
CardNumber = json['CardNumber'];
Cvv = json['Cvv'];
Address = JsonConverters.fromJson(json['Address'],'CreditCardBillingAddressItem',context!);
return this;
}
Map<String, dynamic> toJson() => {
'NameOnCard': NameOnCard,
'ExpMonth': ExpMonth,
'ExpYear': ExpYear,
'CardNumber': CardNumber,
'Cvv': Cvv,
'Address': JsonConverters.toJson(Address,'CreditCardBillingAddressItem',context!)
};
getTypeName() => "CreditCardChargeItem";
TypeContext? context = _ctx;
}
class AchChargeItem implements IConvertible
{
String? AccountNumber;
String? RoutingNumber;
String? AccountType;
String? AccountHolderName;
AchChargeItem({this.AccountNumber,this.RoutingNumber,this.AccountType,this.AccountHolderName});
AchChargeItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AccountNumber = json['AccountNumber'];
RoutingNumber = json['RoutingNumber'];
AccountType = json['AccountType'];
AccountHolderName = json['AccountHolderName'];
return this;
}
Map<String, dynamic> toJson() => {
'AccountNumber': AccountNumber,
'RoutingNumber': RoutingNumber,
'AccountType': AccountType,
'AccountHolderName': AccountHolderName
};
getTypeName() => "AchChargeItem";
TypeContext? context = _ctx;
}
class ReferenceIdTypedAssociationItem implements IConvertible
{
String? Value;
String? Type;
ReferenceIdTypedAssociationItem({this.Value,this.Type});
ReferenceIdTypedAssociationItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Value = json['Value'];
Type = json['Type'];
return this;
}
Map<String, dynamic> toJson() => {
'Value': Value,
'Type': Type
};
getTypeName() => "ReferenceIdTypedAssociationItem";
TypeContext? context = _ctx;
}
abstract class ChargeTokenRqBase implements IChapterAuthorizationRequest, IApiResultErrorService
{
String? tokenType;
int? Amount;
String? Description;
ChargeTokenOptions? Options;
CreditCardChargeItem? CardInfo;
AchChargeItem? AchInfo;
List<ReferenceIdTypedAssociationItem>? ReferenceIds;
ChargeTokenRqBase({this.tokenType,this.Amount,this.Description,this.Options,this.CardInfo,this.AchInfo,this.ReferenceIds});
ChargeTokenRqBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
tokenType = json['tokenType'];
Amount = json['Amount'];
Description = json['Description'];
Options = JsonConverters.fromJson(json['Options'],'ChargeTokenOptions',context!);
CardInfo = JsonConverters.fromJson(json['CardInfo'],'CreditCardChargeItem',context!);
AchInfo = JsonConverters.fromJson(json['AchInfo'],'AchChargeItem',context!);
ReferenceIds = JsonConverters.fromJson(json['ReferenceIds'],'List<ReferenceIdTypedAssociationItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'tokenType': tokenType,
'Amount': Amount,
'Description': Description,
'Options': JsonConverters.toJson(Options,'ChargeTokenOptions',context!),
'CardInfo': JsonConverters.toJson(CardInfo,'CreditCardChargeItem',context!),
'AchInfo': JsonConverters.toJson(AchInfo,'AchChargeItem',context!),
'ReferenceIds': JsonConverters.toJson(ReferenceIds,'List<ReferenceIdTypedAssociationItem>',context!)
};
getTypeName() => "ChargeTokenRqBase";
TypeContext? context = _ctx;
}
class CreditCardChargeVerificationResult implements IConvertible
{
bool? NetworkVerificationAttempted;
String? CvvVerificationResult;
String? AddressVerificationResult;
String? PostalCodeVerificationResult;
CreditCardChargeVerificationResult({this.NetworkVerificationAttempted,this.CvvVerificationResult,this.AddressVerificationResult,this.PostalCodeVerificationResult});
CreditCardChargeVerificationResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
NetworkVerificationAttempted = json['NetworkVerificationAttempted'];
CvvVerificationResult = json['CvvVerificationResult'];
AddressVerificationResult = json['AddressVerificationResult'];
PostalCodeVerificationResult = json['PostalCodeVerificationResult'];
return this;
}
Map<String, dynamic> toJson() => {
'NetworkVerificationAttempted': NetworkVerificationAttempted,
'CvvVerificationResult': CvvVerificationResult,
'AddressVerificationResult': AddressVerificationResult,
'PostalCodeVerificationResult': PostalCodeVerificationResult
};
getTypeName() => "CreditCardChargeVerificationResult";
TypeContext? context = _ctx;
}
class CreditCardChargeDetails implements IConvertible
{
String? CardType;
int? ExpMonth;
int? ExpYear;
String? Last4;
CreditCardBillingAddressItem? Address;
CreditCardChargeVerificationResult? VerificationResult;
CreditCardChargeDetails({this.CardType,this.ExpMonth,this.ExpYear,this.Last4,this.Address,this.VerificationResult});
CreditCardChargeDetails.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CardType = json['CardType'];
ExpMonth = json['ExpMonth'];
ExpYear = json['ExpYear'];
Last4 = json['Last4'];
Address = JsonConverters.fromJson(json['Address'],'CreditCardBillingAddressItem',context!);
VerificationResult = JsonConverters.fromJson(json['VerificationResult'],'CreditCardChargeVerificationResult',context!);
return this;
}
Map<String, dynamic> toJson() => {
'CardType': CardType,
'ExpMonth': ExpMonth,
'ExpYear': ExpYear,
'Last4': Last4,
'Address': JsonConverters.toJson(Address,'CreditCardBillingAddressItem',context!),
'VerificationResult': JsonConverters.toJson(VerificationResult,'CreditCardChargeVerificationResult',context!)
};
getTypeName() => "CreditCardChargeDetails";
TypeContext? context = _ctx;
}
class AchChargeVerificationResult implements IConvertible
{
bool? NetworkVerificationAttempted;
String? Result;
AchChargeVerificationResult({this.NetworkVerificationAttempted,this.Result});
AchChargeVerificationResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
NetworkVerificationAttempted = json['NetworkVerificationAttempted'];
Result = json['Result'];
return this;
}
Map<String, dynamic> toJson() => {
'NetworkVerificationAttempted': NetworkVerificationAttempted,
'Result': Result
};
getTypeName() => "AchChargeVerificationResult";
TypeContext? context = _ctx;
}
class AchChargeDetails implements IConvertible
{
String? AccountType;
String? RoutingNumber;
String? AccountNumberLast4;
String? BankName;
AchChargeVerificationResult? VerificationResult;
AchChargeDetails({this.AccountType,this.RoutingNumber,this.AccountNumberLast4,this.BankName,this.VerificationResult});
AchChargeDetails.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AccountType = json['AccountType'];
RoutingNumber = json['RoutingNumber'];
AccountNumberLast4 = json['AccountNumberLast4'];
BankName = json['BankName'];
VerificationResult = JsonConverters.fromJson(json['VerificationResult'],'AchChargeVerificationResult',context!);
return this;
}
Map<String, dynamic> toJson() => {
'AccountType': AccountType,
'RoutingNumber': RoutingNumber,
'AccountNumberLast4': AccountNumberLast4,
'BankName': BankName,
'VerificationResult': JsonConverters.toJson(VerificationResult,'AchChargeVerificationResult',context!)
};
getTypeName() => "AchChargeDetails";
TypeContext? context = _ctx;
}
class ChargeTokenRs implements IConvertible
{
String? Token;
int? OrganizationId;
int? ChapterId;
int? Amount;
String? TokenType;
String? Description;
DateTime? ExpiresOn;
String? Currency;
int? Usages;
CreditCardChargeDetails? CardDetails;
AchChargeDetails? AchDetails;
ChargeTokenRs({this.Token,this.OrganizationId,this.ChapterId,this.Amount,this.TokenType,this.Description,this.ExpiresOn,this.Currency,this.Usages,this.CardDetails,this.AchDetails});
ChargeTokenRs.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Token = json['Token'];
OrganizationId = json['OrganizationId'];
ChapterId = json['ChapterId'];
Amount = json['Amount'];
TokenType = json['TokenType'];
Description = json['Description'];
ExpiresOn = JsonConverters.fromJson(json['ExpiresOn'],'DateTime',context!);
Currency = json['Currency'];
Usages = json['Usages'];
CardDetails = JsonConverters.fromJson(json['CardDetails'],'CreditCardChargeDetails',context!);
AchDetails = JsonConverters.fromJson(json['AchDetails'],'AchChargeDetails',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Token': Token,
'OrganizationId': OrganizationId,
'ChapterId': ChapterId,
'Amount': Amount,
'TokenType': TokenType,
'Description': Description,
'ExpiresOn': JsonConverters.toJson(ExpiresOn,'DateTime',context!),
'Currency': Currency,
'Usages': Usages,
'CardDetails': JsonConverters.toJson(CardDetails,'CreditCardChargeDetails',context!),
'AchDetails': JsonConverters.toJson(AchDetails,'AchChargeDetails',context!)
};
getTypeName() => "ChargeTokenRs";
TypeContext? context = _ctx;
}
class ChargeTokenRq extends ChargeTokenRqBase implements IConvertible
{
ChargeTokenRq();
ChargeTokenRq.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "ChargeTokenRq";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
'ChargeTokenOptions': TypeInfo(TypeOf.Class, create:() => ChargeTokenOptions()),
'AttributeItem': TypeInfo(TypeOf.Class, create:() => AttributeItem()),
'CreditCardBillingAddressItem': TypeInfo(TypeOf.Class, create:() => CreditCardBillingAddressItem()),
'List<AttributeItem>': TypeInfo(TypeOf.Class, create:() => <AttributeItem>[]),
'CreditCardChargeItem': TypeInfo(TypeOf.Class, create:() => CreditCardChargeItem()),
'AchChargeItem': TypeInfo(TypeOf.Class, create:() => AchChargeItem()),
'ReferenceIdTypedAssociationItem': TypeInfo(TypeOf.Class, create:() => ReferenceIdTypedAssociationItem()),
'ChargeTokenRqBase': TypeInfo(TypeOf.AbstractClass),
'List<ReferenceIdTypedAssociationItem>': TypeInfo(TypeOf.Class, create:() => <ReferenceIdTypedAssociationItem>[]),
'CreditCardChargeVerificationResult': TypeInfo(TypeOf.Class, create:() => CreditCardChargeVerificationResult()),
'CreditCardChargeDetails': TypeInfo(TypeOf.Class, create:() => CreditCardChargeDetails()),
'AchChargeVerificationResult': TypeInfo(TypeOf.Class, create:() => AchChargeVerificationResult()),
'AchChargeDetails': TypeInfo(TypeOf.Class, create:() => AchChargeDetails()),
'ChargeTokenRs': TypeInfo(TypeOf.Class, create:() => ChargeTokenRs()),
'ChargeTokenRq': TypeInfo(TypeOf.Class, create:() => ChargeTokenRq()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /integrations/api/{tokenType}/charge/token HTTP/1.1
Host: devapi.billhighway.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ChargeTokenRq xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api.Request">
<AchInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api">
<d2p1:_x003C_AccountHolderName_x003E_k__BackingField>String</d2p1:_x003C_AccountHolderName_x003E_k__BackingField>
<d2p1:_x003C_AccountNumber_x003E_k__BackingField>String</d2p1:_x003C_AccountNumber_x003E_k__BackingField>
<d2p1:_x003C_AccountType_x003E_k__BackingField>String</d2p1:_x003C_AccountType_x003E_k__BackingField>
<d2p1:_x003C_RoutingNumber_x003E_k__BackingField>String</d2p1:_x003C_RoutingNumber_x003E_k__BackingField>
</AchInfo>
<Amount>0</Amount>
<CardInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api">
<d2p1:_x003C_Address_x003E_k__BackingField>
<d2p1:Address1>String</d2p1:Address1>
<d2p1:Address2>String</d2p1:Address2>
<d2p1:Attributes xmlns:d4p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO">
<d4p1:AttributeItem>
<d4p1:Name>String</d4p1:Name>
<d4p1:Value>String</d4p1:Value>
</d4p1:AttributeItem>
</d2p1:Attributes>
<d2p1:City>String</d2p1:City>
<d2p1:Country>String</d2p1:Country>
<d2p1:PostalCode>String</d2p1:PostalCode>
<d2p1:Region>String</d2p1:Region>
</d2p1:_x003C_Address_x003E_k__BackingField>
<d2p1:_x003C_CardNumber_x003E_k__BackingField>String</d2p1:_x003C_CardNumber_x003E_k__BackingField>
<d2p1:_x003C_Cvv_x003E_k__BackingField>String</d2p1:_x003C_Cvv_x003E_k__BackingField>
<d2p1:_x003C_ExpMonth_x003E_k__BackingField>0</d2p1:_x003C_ExpMonth_x003E_k__BackingField>
<d2p1:_x003C_ExpYear_x003E_k__BackingField>0</d2p1:_x003C_ExpYear_x003E_k__BackingField>
<d2p1:_x003C_NameOnCard_x003E_k__BackingField>String</d2p1:_x003C_NameOnCard_x003E_k__BackingField>
</CardInfo>
<Description>String</Description>
<Options xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges">
<d2p1:Duration>0</d2p1:Duration>
<d2p1:Usages>0</d2p1:Usages>
</Options>
<ReferenceIds xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO">
<d2p1:ReferenceIdTypedAssociationItem>
<d2p1:_x003C_Type_x003E_k__BackingField>String</d2p1:_x003C_Type_x003E_k__BackingField>
<d2p1:_x003C_Value_x003E_k__BackingField>String</d2p1:_x003C_Value_x003E_k__BackingField>
</d2p1:ReferenceIdTypedAssociationItem>
</ReferenceIds>
<tokenType>String</tokenType>
</ChargeTokenRq>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ChargeTokenRs xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api.Response">
<AchDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api">
<d2p1:_x003C_AccountNumberLast4_x003E_k__BackingField>String</d2p1:_x003C_AccountNumberLast4_x003E_k__BackingField>
<d2p1:_x003C_AccountType_x003E_k__BackingField>String</d2p1:_x003C_AccountType_x003E_k__BackingField>
<d2p1:_x003C_BankName_x003E_k__BackingField>String</d2p1:_x003C_BankName_x003E_k__BackingField>
<d2p1:_x003C_RoutingNumber_x003E_k__BackingField>String</d2p1:_x003C_RoutingNumber_x003E_k__BackingField>
<d2p1:_x003C_VerificationResult_x003E_k__BackingField>
<d2p1:_x003C_NetworkVerificationAttempted_x003E_k__BackingField>false</d2p1:_x003C_NetworkVerificationAttempted_x003E_k__BackingField>
<d2p1:_x003C_Result_x003E_k__BackingField>String</d2p1:_x003C_Result_x003E_k__BackingField>
</d2p1:_x003C_VerificationResult_x003E_k__BackingField>
</AchDetails>
<Amount>0</Amount>
<CardDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api">
<d2p1:_x003C_Address_x003E_k__BackingField>
<d2p1:Address1>String</d2p1:Address1>
<d2p1:Address2>String</d2p1:Address2>
<d2p1:Attributes xmlns:d4p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO">
<d4p1:AttributeItem>
<d4p1:Name>String</d4p1:Name>
<d4p1:Value>String</d4p1:Value>
</d4p1:AttributeItem>
</d2p1:Attributes>
<d2p1:City>String</d2p1:City>
<d2p1:Country>String</d2p1:Country>
<d2p1:PostalCode>String</d2p1:PostalCode>
<d2p1:Region>String</d2p1:Region>
</d2p1:_x003C_Address_x003E_k__BackingField>
<d2p1:_x003C_CardType_x003E_k__BackingField>String</d2p1:_x003C_CardType_x003E_k__BackingField>
<d2p1:_x003C_ExpMonth_x003E_k__BackingField>0</d2p1:_x003C_ExpMonth_x003E_k__BackingField>
<d2p1:_x003C_ExpYear_x003E_k__BackingField>0</d2p1:_x003C_ExpYear_x003E_k__BackingField>
<d2p1:_x003C_Last4_x003E_k__BackingField>String</d2p1:_x003C_Last4_x003E_k__BackingField>
<d2p1:_x003C_VerificationResult_x003E_k__BackingField>
<d2p1:_x003C_AddressVerificationResult_x003E_k__BackingField>String</d2p1:_x003C_AddressVerificationResult_x003E_k__BackingField>
<d2p1:_x003C_CvvVerificationResult_x003E_k__BackingField>String</d2p1:_x003C_CvvVerificationResult_x003E_k__BackingField>
<d2p1:_x003C_NetworkVerificationAttempted_x003E_k__BackingField>false</d2p1:_x003C_NetworkVerificationAttempted_x003E_k__BackingField>
<d2p1:_x003C_PostalCodeVerificationResult_x003E_k__BackingField>String</d2p1:_x003C_PostalCodeVerificationResult_x003E_k__BackingField>
</d2p1:_x003C_VerificationResult_x003E_k__BackingField>
</CardDetails>
<ChapterId>0</ChapterId>
<Currency>String</Currency>
<Description>String</Description>
<ExpiresOn>0001-01-01T00:00:00</ExpiresOn>
<OrganizationId>0</OrganizationId>
<Token>String</Token>
<TokenType>String</TokenType>
<Usages>0</Usages>
</ChargeTokenRs>