public TransactionResponse PayWithCreditCard(int peopleId, decimal amt, string cardnumber, string expires, string description, int tranid, string cardcode, string email, string first, string last, string addr, string addr2, string city, string state, string country, string zip, string phone) { var creditCardSaleRequest = new CreditCardSaleRequest( _userName, _password, new CreditCard { CardNumber = cardnumber, Expiration = expires, CardCode = cardcode, BillingAddress = new BillingAddress { FirstName = first, LastName = last, Address1 = addr, Address2 = addr2, City = city, State = state, Country = country, Zip = zip, Email = email, Phone = phone } }, amt, tranid.ToString(CultureInfo.InvariantCulture), description, peopleId.ToString(CultureInfo.InvariantCulture)); var response = creditCardSaleRequest.Execute(); return(new TransactionResponse { Approved = response.ResponseStatus == ResponseStatus.Approved, AuthCode = response.AuthCode, Message = response.ResponseText, TransactionId = response.TransactionId }); }
public TransactionResponse PayWithCreditCard(int peopleId, decimal amt, string cardnumber, string expires, string description, int tranid, string cardcode, string email, string first, string last, string addr, string addr2, string city, string state, string country, string zip, string phone) { var creditCardSaleRequest = new CreditCardSaleRequest( _id, _key, new CreditCard { NameOnCard = $"{first} {last}", CardNumber = cardnumber, Expiration = expires, CardCode = cardcode, BillingAddress = new BillingAddress { Address1 = addr, City = city, State = state, Country = country, Zip = zip, Email = email, Phone = phone } }, amt, tranid.ToString(CultureInfo.InvariantCulture), peopleId.ToString(CultureInfo.InvariantCulture)); var response = creditCardSaleRequest.Execute(); return(new TransactionResponse { Approved = response.ApprovalIndicator == ApprovalIndicator.Approved, AuthCode = response.Code, Message = response.Message, TransactionId = response.Reference }); }