| POST | /integrations/api/v2/{tokenType}/charge/token |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BH.CloudAPI.DTO.Charges.Api.Request
Imports BH.CloudAPI.DTO.Charges
Imports BH.CloudAPI.DTO.Charges.Api
Imports BH.CloudAPI.Common4.DTO
Imports BH.CloudAPI.DTO
Imports BH.CloudAPI.DTO.Charges.Api.Response
Namespace Global
Namespace BH.CloudAPI.Common4.DTO
Public Partial Class AttributeItem
Public Overridable Property Name As String
Public Overridable Property Value As String
End Class
End Namespace
Namespace BH.CloudAPI.DTO
Public Partial Class ReferenceIdTypedAssociationItem
Public Overridable Property Value As String
Public Overridable Property Type As String
End Class
End Namespace
Namespace BH.CloudAPI.DTO.Charges
Public Partial Class ChargeTokenOptions
Public Overridable Property Usages As Integer
Public Overridable Property Duration As Integer
End Class
End Namespace
Namespace BH.CloudAPI.DTO.Charges.Api
Public Partial Class AchChargeDetailsV2
Public Overridable Property AccountType As String
Public Overridable Property RoutingNumber As String
Public Overridable Property AccountNumberLast4 As String
Public Overridable Property BankName As String
End Class
Public Partial Class AchChargeItem
Public Overridable Property AccountNumber As String
Public Overridable Property RoutingNumber As String
Public Overridable Property AccountType As String
Public Overridable Property AccountHolderName As String
End Class
Public Partial Class CreditCardBillingAddressItem
Public Sub New()
Attributes = New List(Of AttributeItem)
End Sub
Public Overridable Property Address1 As String
Public Overridable Property Address2 As String
Public Overridable Property City As String
Public Overridable Property PostalCode As String
Public Overridable Property Region As String
Public Overridable Property Country As String
Public Overridable Property Attributes As List(Of AttributeItem)
End Class
Public Partial Class CreditCardChargeDetailsV2
Public Overridable Property CardType As String
Public Overridable Property ExpMonth As Integer
Public Overridable Property ExpYear As Integer
Public Overridable Property Last4 As String
Public Overridable Property Address As CreditCardBillingAddressItem
End Class
Public Partial Class CreditCardChargeItem
Public Overridable Property NameOnCard As String
Public Overridable Property ExpMonth As Integer
Public Overridable Property ExpYear As Integer
Public Overridable Property CardNumber As String
Public Overridable Property Cvv As String
Public Overridable Property Address As CreditCardBillingAddressItem
End Class
End Namespace
Namespace BH.CloudAPI.DTO.Charges.Api.Request
Public Partial Class ChargeTokenRqBase
Implements IChapterAuthorizationRequest
Implements IApiResultErrorService
Public Sub New()
ReferenceIds = New List(Of ReferenceIdTypedAssociationItem)
End Sub
Public Overridable Property tokenType As String
Public Overridable Property Amount As Integer
Public Overridable Property Description As String
Public Overridable Property Options As ChargeTokenOptions
Public Overridable Property CardInfo As CreditCardChargeItem
Public Overridable Property AchInfo As AchChargeItem
Public Overridable Property ReferenceIds As List(Of ReferenceIdTypedAssociationItem)
End Class
Public Partial Class ChargeTokenV2Rq
Inherits ChargeTokenRqBase
End Class
End Namespace
Namespace BH.CloudAPI.DTO.Charges.Api.Response
Public Partial Class ChargeTokenV2Rs
Public Overridable Property Token As String
Public Overridable Property Amount As Integer
Public Overridable Property TokenType As String
Public Overridable Property Description As String
Public Overridable Property ExpiresOn As Date
Public Overridable Property Currency As String
Public Overridable Property Usages As Integer
Public Overridable Property CardDetails As CreditCardChargeDetailsV2
Public Overridable Property AchDetails As AchChargeDetailsV2
End Class
End Namespace
End Namespace
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 /integrations/api/v2/{tokenType}/charge/token HTTP/1.1
Host: devapi.billhighway.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"tokenType":"String","Amount":0,"Description":"String","Options":{"Usages":0,"Duration":0},"CardInfo":{"NameOnCard":"String","ExpMonth":0,"ExpYear":0,"CardNumber":"String","Cvv":"String","Address":{"Address1":"String","Address2":"String","City":"String","PostalCode":"String","Region":"String","Country":"String","Attributes":[{"Name":"String","Value":"String"}]}},"AchInfo":{"AccountNumber":"String","RoutingNumber":"String","AccountType":"String","AccountHolderName":"String"},"ReferenceIds":[{"Value":"String","Type":"String"}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Token":"String","Amount":0,"TokenType":"String","Description":"String","ExpiresOn":"0001-01-01T00:00:00.0000000","Currency":"String","Usages":0,"CardDetails":{"CardType":"String","ExpMonth":0,"ExpYear":0,"Last4":"String","Address":{"Address1":"String","Address2":"String","City":"String","PostalCode":"String","Region":"String","Country":"String","Attributes":[{"Name":"String","Value":"String"}]}},"AchDetails":{"AccountType":"String","RoutingNumber":"String","AccountNumberLast4":"String","BankName":"String"}}