public void Should_Create_User_And_Add_Card()
        {
            CreateCardRequest request = new CreateCardRequest();
            request.Locale = Locale.TR.ToString();
            request.ConversationId = "123456789";
            request.Email = "*****@*****.**";
            request.ExternalId = "external id";

            CardInformation cardInformation = new CardInformation();
            cardInformation.CardAlias = "card alias";
            cardInformation.CardHolderName = "John Doe";
            cardInformation.CardNumber = "5528790000000008";
            cardInformation.ExpireMonth = "12";
            cardInformation.ExpireYear = "2030";
            request.Card = cardInformation;

            Card card = Card.Create(request, options);

            PrintResponse<Card>(card);

            Assert.AreEqual(Status.SUCCESS.ToString(), card.Status);
            Assert.AreEqual(Locale.TR.ToString(), card.Locale);
            Assert.AreEqual("123456789", card.ConversationId);
            Assert.IsNotNull(card.SystemTime);
            Assert.IsNull(card.ErrorCode);
            Assert.IsNull(card.ErrorMessage);
            Assert.IsNull(card.ErrorGroup);
            Assert.AreEqual("552879", card.BinNumber);
            Assert.AreEqual("card alias", card.CardAlias);
            Assert.AreEqual("CREDIT_CARD", card.CardType);
            Assert.AreEqual("MASTER_CARD", card.CardAssociation);
            Assert.AreEqual("Paraf", card.CardFamily);
            Assert.AreEqual("Halk Bankası", card.CardBankName);
            Assert.AreEqual(12, card.CardBankCode);
            Assert.IsNotNull(card.CardUserKey);
            Assert.IsNotNull(card.CardToken);
            Assert.AreEqual("*****@*****.**", card.Email);
            Assert.AreEqual("external id", card.ExternalId);
        }
示例#2
0
 public static Card Create(CreateCardRequest request, Options options)
 {
     return RestHttpClient.Create().Post<Card>(options.BaseUrl + "/cardstorage/card", GetHttpHeaders(request, options), request);
 }