| POST | /payments/creditcard/token | (Deprecated) | (Deprecated) |
|---|---|---|---|
| POST | /payments/creditcard/ref |
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreditCardReferenceReply(IHaveErrorField):
# @ApiMember(Description="Same as CardReference, however this field is deprecated")
card_token: Optional[str] = None
"""
Same as CardReference, however this field is deprecated
"""
error_message: Optional[str] = None
error_code: Optional[int] = None
# @ApiMember(ExcludeInSchema=true)
is_error: Optional[bool] = None
card_reference: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreditCardReference:
# @ApiMember(IsRequired=true)
group_id: Optional[str] = None
# @ApiMember(IsRequired=true)
card_number: Optional[str] = None
# @ApiMember(IsRequired=true)
card_type: Optional[str] = None
# @ApiMember(IsRequired=true)
expiration_month: int = 0
# @ApiMember(IsRequired=true)
expiration_year: int = 0
Python CreditCardReference 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 /payments/creditcard/token HTTP/1.1
Host: devapi.billhighway.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
GroupId: String,
CardNumber: String,
CardType: String,
ExpirationMonth: 0,
ExpirationYear: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
CardToken: String,
ErrorMessage: String,
ErrorCode: 0,
IsError: False,
CardReference: String
}