public EWayPayment(IOrder order, EwayPaymentResponse response) { this.Guid = Guid.NewGuid(); this.OrderGuid = order.Guid; this.AccessCode = response.AccessCode; this.InvoiceNumber = response.InvoiceNumber; this.AuthorisationCode = response.AuthorisationCode; this.ResponseCode = response.ResponseCode; this.ResponseMessage = response.ResponseMessage; this.TransactionID = response.TransactionID; this.TransactionStatus = response.TransactionStatus; }
public string GetError(EwayPaymentResponse response) { switch(response.ResponseCode) { case "01":// Refer to Issuer Fail case "02":// Refer to Issuer, special Fail return "It looks like there is a problem with your credit card. Please contact your bank or use a different credit card."; case "04":// Pick Up Card Fail case "07":// Pick Up Card, Special Fail case "41":// Lost Card Fail return "Sorry we cannot process your payment with that credit, please try a different card."; case "05":// Do Not Honour Fail return "Your transaction has been declined. Please contact your bank or use a different credit card."; case "14":// Invalid Card Number Fail return "The credit card number you have provided is invalid. Please try again."; case "15":// No Issuer Fail return "Sorry there was a problem processing your payment details. Please try again"; case "51":// Insufficient Funds Fail return "Your transaction has not completed due to insufficient funds."; case "33":// Expired Card, Capture Fail case "54":// Expired Card Fail return "It looks like your credit card has expired. Please try a different card."; default: return "Sorry there was a problem processing your payment details. Please try again."; } }