private PaymentRequestMessage <AntiFraudPaymentRequestTxn> CreateRequestMessage() { var message = new PaymentRequestMessage <AntiFraudPaymentRequestTxn> { MerchantInfo = { MerchantId = _merchantId, Password = _password } }; message.Payment.TxnList.Txn.PurchaseId = Guid.NewGuid(); message.Payment.TxnList.Txn.Amount = 37620; message.Payment.TxnList.Txn.Currency = Domain.Currency.AUD; message.Payment.TxnList.Txn.CreditCardInfo.CardNumber = AustralianCreditCardNumber; message.Payment.TxnList.Txn.CreditCardInfo.Cvv = "123"; message.Payment.TxnList.Txn.CreditCardInfo.ExpiryDate = new ExpiryDate(DateTime.Now.AddYears(2)); message.Payment.TxnList.Txn.BuyerInfo.Ip = AustralianIpAddress; message.Payment.TxnList.Txn.BuyerInfo.EmailAddress = EmailAddress; message.Payment.TxnList.Txn.BuyerInfo.BillingCountry = Country; message.Payment.TxnList.Txn.BuyerInfo.DeliveryCountry = Country; message.Prepare(); message.Validate(); return(message); }
public void TestSerializeRequestMessage() { // Serialize. var message = new PaymentRequestMessage <RefundRequestTxn>(CreateMessageInfo(), CreateMerchantInfo(false)); message.Payment.TxnList.Txn.Amount = 1; message.Payment.TxnList.Txn.PurchaseId = Guid.NewGuid(); message.Payment.TxnList.Txn.ExternalTransactionId = Guid.NewGuid().ToString(); message.Prepare(); message.Validate(); var serializedMessage = Serialization.Serialize(message); // Check. AssertRequestMessage(message, serializedMessage); }
public void TestSerializeRequestMessage() { // Serialize. var message = new PaymentRequestMessage <StandardPaymentRequestTxn>(CreateMessageInfo(), CreateMerchantInfo(false)); message.Payment.TxnList.Txn.Amount = 1; message.Payment.TxnList.Txn.PurchaseId = Guid.NewGuid(); message.Payment.TxnList.Txn.CreditCardInfo.CardNumber = CardNumber; message.Payment.TxnList.Txn.CreditCardInfo.Cvv = Cvv; message.Payment.TxnList.Txn.CreditCardInfo.ExpiryDate = ExpiryDate; message.Prepare(); message.Validate(); var serializedMessage = Serialization.Serialize(message); // Check. AssertRequestMessage(message, serializedMessage); }
private PaymentRequestMessage <StandardPaymentRequestTxn> CreateRequestMessage() { var message = new PaymentRequestMessage <StandardPaymentRequestTxn> { MerchantInfo = { MerchantId = _merchantId, Password = _password } }; message.Payment.TxnList.Txn.PurchaseId = Guid.NewGuid(); message.Payment.TxnList.Txn.Amount = 37620; message.Payment.TxnList.Txn.Currency = Domain.Currency.AUD; message.Payment.TxnList.Txn.CreditCardInfo.CardNumber = "4444333322221111"; message.Payment.TxnList.Txn.CreditCardInfo.Cvv = "123"; message.Payment.TxnList.Txn.CreditCardInfo.ExpiryDate = new ExpiryDate(DateTime.Now.AddYears(2)); message.Prepare(); message.Validate(); return(message); }
public void TestSerializeRequestMessage() { // Serialize. var message = new PaymentRequestMessage <AntiFraudPaymentRequestTxn>(CreateMessageInfo(), CreateMerchantInfo(true)); message.Payment.TxnList.Txn.Amount = 1; message.Payment.TxnList.Txn.PurchaseId = Guid.NewGuid(); message.Payment.TxnList.Txn.CreditCardInfo.CardNumber = CardNumber; message.Payment.TxnList.Txn.CreditCardInfo.Cvv = Cvv; message.Payment.TxnList.Txn.CreditCardInfo.ExpiryDate = ExpiryDate; message.Payment.TxnList.Txn.BuyerInfo.Ip = IpAddress; message.Payment.TxnList.Txn.BuyerInfo.EmailAddress = EmailAddress; message.Payment.TxnList.Txn.BuyerInfo.BillingCountry = Country; message.Payment.TxnList.Txn.BuyerInfo.DeliveryCountry = Country; message.Prepare(); message.Validate(); var serializedMessage = Serialization.Serialize(message); // Check. AssertRequestMessage(message, serializedMessage); }