-
-
Notifications
You must be signed in to change notification settings - Fork 3
Quick Start
ahwm edited this page Oct 22, 2018
·
5 revisions
Note: You may either pass a CardNum
with a CVV
and an expiration date OR pass a Token
OR pass the raw card data (as MagStripe
). The API will not accept multiple.
The order of preference for the API wrapper:
- Card Number, Expiration Date, CVV (optional)
- Token
- Mag Stripe.
using CardknoxApi;
using CardknoxApi.Operations;
CCSale save = new CCSale
{
CardNum = "4444333322221111",
CVV = "123", // optional, requirement determined by software security settings
Exp = "1222" // Expiration Date: MMyy
};
Cardknox c = new Cardknox(new CardknoxRequest("CardknoxKey", "SoftwareName", "SoftwareVersion"));
CardknoxResponse resp = c.CCSale(sale);
if (resp.HasError)
throw new Exception(resp.Error);
string transactionId = resp.RefNum; // Always returned regardless of outcome
StatusType status = resp.Status; // Approved, Declined, Error
ResultType result = resp.Result; // A, D, E
string cardNum = resp.MaskedCardNumber; // eg 4xxxxxxxxxxx1111
string token = resp.Token; // Token returned for use with future transaction.
CardType cardType = resp.CardType; // Visa, Discover, etc