Table of Contents


Authorize.Net - Credit Card Charge

You can use Magentrix Integration to process Credit Card payments via Authorize.Net using the below API:

var trans = new ChargeInfo {
    Currency="USD",
    Amount=50,
    Firstname="John",
    Lastname="Smith",
    CardNumber="XXXXXXXXX1111",
    ExpYear=2016,
    ExpMonth=11,
    CardCvc = "123"
};

//processing the payment
// the string passed to AuthNet class is the name of the integration record
// holding the AuthNet credentials.
IPaymentGateway authnet = new AuthNet("AuthNet");
TransactionResult result = authnet.Charge(trans);

//check the results:
if (result.Status.ToLower()!="success") {
   //transaction failed.
} else {
   //the AuthNet transaction Id
   string transId = result.TransactionId;
}

In order to see all the options and properties of ChangeInfo click here.