public void ThreeDSecureRequestXmlHelpersNoEnumsTest() { Card card = new Card() .AddExpiryDate(sx.CARD_EXPIRY_DATE) .AddNumber(sx.CARD_NUMBER) .AddType(CardType.VISA) .AddCardHolderName(sx.CARD_HOLDER_NAME) .AddIssueNumber(sx.CARD_ISSUE_NUMBER) .AddCvn(sx.CARD_CVN_NUMBER) .AddCvnPresenceIndicator(sx.CARD_CVN_PRESENCE); ThreeDSecureRequest request = new ThreeDSecureRequest() .AddAccount(sx.ACCOUNT) .AddMerchantId(sx.MERCHANT_ID) .AddType(ThreeDSecureType.VERIFY_ENROLLED) .AddAmount(sx.AMOUNT) .AddCurrency(sx.CURRENCY) .AddCard(card) .AddTimestamp(sx.TIMESTAMP) .AddOrderId(sx.ORDER_ID) .AddHash(sx.THREE_D_SECURE_VERIFY_ENROLLED_REQUEST_HASH); //convert to XML string xml = request.ToXml(); //Convert from XML back to PaymentRequest ThreeDSecureRequest fromXmlRequest = new ThreeDSecureRequest().FromXml(xml); sx.checkUnmarshalledVerifyEnrolledRequest(fromXmlRequest); }
public void ThreeDSecureSigRequestXmlWithSettersTest() { Card card = new Card(); card.ExpiryDate = sx.CARD_EXPIRY_DATE; card.Number = sx.CARD_NUMBER; card.Type = CardType.VISA; card.CardHolderName = sx.CARD_HOLDER_NAME; card.IssueNumber = sx.CARD_ISSUE_NUMBER; Cvn cvn = new Cvn(); cvn.Number = sx.CARD_CVN_NUMBER; cvn.PresenceIndicator = sx.CARD_CVN_PRESENCE; card.Cvn = cvn; ThreeDSecureRequest request = new ThreeDSecureRequest(); request.Account = sx.ACCOUNT; request.MerchantId = sx.MERCHANT_ID; RxpAmount amount = new RxpAmount(); amount.Amount = sx.AMOUNT; amount.Currency = sx.CURRENCY; request.Amount = amount; request.Card = card; request.Timestamp = sx.TIMESTAMP; request.OrderId = sx.ORDER_ID; request.Pares = sx.THREE_D_SECURE_PARES; request.Hash = sx.THREE_D_SECURE_VERIFY_SIG_REQUEST_HASH; request.Type = ThreeDSecureType.VERIFY_SIG; //convert to XML string xml = request.ToXml(); //Convert from XML back to PaymentRequest ThreeDSecureRequest fromXmlRequest = new ThreeDSecureRequest().FromXml(xml); sx.checkUnmarshalledVerifySigRequest(fromXmlRequest); }