POST api/paymentservice/cc/validateandcharge
Validates and charges a credit card.
Request Information
URI Parameters
None.
Body Parameters
A request containing the details of the credit card to validate and charge.
PaymentServiceValidateAndChargeCreditCardPaymentRequest| Name | Description | Type | Additional information | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| WorkOrderId |
Represents the Id of the work order to attach a successful payment to |
integer |
Minimum value: 1 |
||||||||||||||||||||||||||
| CompanyId |
Represents the Id of the company the payment will be placed for. |
integer |
Required Minimum value: 1 |
||||||||||||||||||||||||||
| ExpiryDate |
Expiration date of the credit card. Only month and year are used. |
date |
Required |
||||||||||||||||||||||||||
| BillingAddress |
The billing address of the credit card being validated.
|
Address |
Required |
||||||||||||||||||||||||||
| CardHolderName |
The name on the card. |
string |
Required String length: inclusive between 1 and 30 |
||||||||||||||||||||||||||
| CardNumber |
The account number on the credit card. Must be a valid AMEX, Visa, MC, or Discover account number |
string |
Required |
||||||||||||||||||||||||||
| Cvv2 |
The CVV2 code for the credit card.
|
string |
Required String length: inclusive between 1 and 4 |
||||||||||||||||||||||||||
| PhoneNumber |
PhoneNumber associated with the credit card |
string |
Required Must be an acceptably formed phone number String length: inclusive between 0 and 14 |
||||||||||||||||||||||||||
| PhoneType |
Type of phone number provided |
PhoneType |
Required |
||||||||||||||||||||||||||
| EmailAddress |
Email address of the person responsible for the credit card. |
string |
Required String length: inclusive between 0 and 30 |
||||||||||||||||||||||||||
| CurrencyCode |
What currency to make the charge in. |
string |
Required |
||||||||||||||||||||||||||
| Username |
Name of user authorizing the charge |
string |
Required String length: inclusive between 1 and 100 |
||||||||||||||||||||||||||
| ChargeAmountNatural |
Amount to charge on the card in CurrencyCode currency. |
decimal number |
Required Range: inclusive between 0.01 and 999999.99 |
||||||||||||||||||||||||||
| SecurityKey |
Security key for this transaction. Base64 encoding of the MD5 hash of "UserName:PrivateKey:MMddyyyy" in UTF8.
"WEB-API-USER:WEB-API-SECRET:08092017" would result in "YnQXrdS22L03ftjKHaExBg==" for a SecurityKey. |
string |
Required |
Request Formats
application/json, text/json
{
"WorkOrderId": 1,
"CompanyId": 1,
"ExpiryDate": "2025-12-01T20:42:00.1461146-05:00",
"BillingAddress": {
"Street1": "sample string 1",
"Street2": "sample string 2",
"Street3": "sample string 3",
"City": "sample string 4",
"Region": "sample string 5",
"Postalcode": "sample string 6",
"PostalZip4": "sample string 7",
"CountryCode": "sample string 8"
},
"CardHolderName": "sample string 3",
"CardNumber": "sample string 4",
"Cvv2": "sample string 5",
"PhoneNumber": "sample string 6",
"PhoneType": 68,
"EmailAddress": "sample string 7",
"CurrencyCode": "sample string 8",
"Username": "sample string 9",
"ChargeAmountNatural": 10.0,
"SecurityKey": "sample string 11"
}
application/xml, text/xml
<PaymentServiceValidateAndChargeCreditCardPaymentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<WorkOrderId>1</WorkOrderId>
<CompanyId>1</CompanyId>
<ExpiryDate>2025-12-01T20:42:00.1461146-05:00</ExpiryDate>
<BillingAddress>
<Street1>sample string 1</Street1>
<Street2>sample string 2</Street2>
<Street3>sample string 3</Street3>
<City>sample string 4</City>
<Region>sample string 5</Region>
<Postalcode>sample string 6</Postalcode>
<PostalZip4>sample string 7</PostalZip4>
<CountryCode>sample string 8</CountryCode>
</BillingAddress>
<CardHolderName>sample string 3</CardHolderName>
<CardNumber>sample string 4</CardNumber>
<Cvv2>sample string 5</Cvv2>
<PhoneNumber>sample string 6</PhoneNumber>
<PhoneType>Day</PhoneType>
<EmailAddress>sample string 7</EmailAddress>
<CurrencyCode>sample string 8</CurrencyCode>
<Username>sample string 9</Username>
<ChargeAmountNatural>10</ChargeAmountNatural>
<SecurityKey>sample string 11</SecurityKey>
</PaymentServiceValidateAndChargeCreditCardPaymentRequest>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
A response containing validity data and information resulting from charging the card.
PaymentServiceValidateAndChargeCreditCardPaymentResponse| Name | Description | Type | Additional information |
|---|---|---|---|
| ValidationResult |
Result of the validation of the information. |
ResultType |
None. |
| ChargeResult |
Result of the charge. |
ResultType |
None. |
| ConfirmationNumber |
Confirmation number of the charge |
string |
None. |
| ChargedAmount |
Amount charged to the card |
string |
None. |
| ServiceChargeAmount |
Amount of surcharge added to the requested amount. |
string |
None. |
| ChargedAccountDisplay |
Masked version of the card charged |
string |
None. |
| UserErrorMessage |
Error message if charging was unsuccessful |
string |
None. |
| CardTypeDisplay |
Type of card charged |
string |
None. |
| CardType |
Type of card charged |
CreditCardType |
None. |
Response Formats
application/json, text/json
{
"ValidationResult": 0,
"ChargeResult": 0,
"ConfirmationNumber": "sample string 1",
"ChargedAmount": "sample string 2",
"ServiceChargeAmount": "sample string 3",
"ChargedAccountDisplay": "sample string 4",
"UserErrorMessage": "sample string 5",
"CardTypeDisplay": "sample string 6",
"CardType": 1
}
application/xml, text/xml
<PaymentServiceValidateAndChargeCreditCardPaymentResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ValidationResult>Unknown</ValidationResult> <ChargeResult>Unknown</ChargeResult> <ConfirmationNumber>sample string 1</ConfirmationNumber> <ChargedAmount>sample string 2</ChargedAmount> <ServiceChargeAmount>sample string 3</ServiceChargeAmount> <ChargedAccountDisplay>sample string 4</ChargedAccountDisplay> <UserErrorMessage>sample string 5</UserErrorMessage> <CardTypeDisplay>sample string 6</CardTypeDisplay> <CardType>Visa</CardType> </PaymentServiceValidateAndChargeCreditCardPaymentResponse>