Пример #1
0
        public void TestOrderNewMaestroCard()
        {
            SetUpTestCase();

            var cardPinAssignment = new CardPinAssignment(
                CardPinAssignmentTypePrimary
                )
            {
                PinCode           = PinCode,
                MonetaryAccountId = BunqContext.UserContext.PrimaryMonetaryAccountBank.Id
            };
            var allCardPinAssignments = new List <CardPinAssignment> {
                cardPinAssignment
            };
            var cardDebit = CardDebit.Create(
                GenerateRandomSecondLine(),
                GetAnAllowedName(),
                GetAlias(),
                CardTypeMaestro,
                allCardPinAssignments
                ).Value;

            Assert.True(cardDebit.Id != null);

            var cardFromCardEndpoint = Card.Get(cardDebit.Id.Value).Value;

            Assert.Equal(cardDebit.SecondLine, cardFromCardEndpoint.SecondLine);
            Assert.Equal(cardDebit.Created, cardFromCardEndpoint.Created);
            Assert.Equal(cardDebit.NameOnCard, cardFromCardEndpoint.NameOnCard);
        }
Пример #2
0
        public void TestOrderNewMaestroCard()
        {
            var cardDebitMap = new Dictionary <string, object>
            {
                { CardDebit.FIELD_ALIAS, GetAlias() },
                { CardDebit.FIELD_NAME_ON_CARD, GetAnAllowedName() },
                { CardDebit.FIELD_PIN_CODE, PIN_CODE },
                { CardDebit.FIELD_SECOND_LINE, GenerateRandomSecondLine() }
            };
            var cardDebit = CardDebit.Create(API_CONTEXT, cardDebitMap, USER_ID).Value;

            var cardFromCardEndpoint = Card.Get(API_CONTEXT, USER_ID, cardDebit.Id.Value).Value;

            Assert.Equal(cardDebit.SecondLine, cardFromCardEndpoint.SecondLine);
            Assert.Equal(cardDebit.Created, cardFromCardEndpoint.Created);
            Assert.Equal(cardDebit.NameOnCard, cardFromCardEndpoint.NameOnCard);
        }
Пример #3
0
        private const int USER_ITEM_ID          = 0;          // Put your user ID here

        public void Run()
        {
            var apiContext = ApiContext.Restore();
            var requestMap = new Dictionary <string, object>
            {
                { CardDebit.FIELD_NAME_ON_CARD, NAME_YOUR_COMPANY },
                { CardDebit.FIELD_SECOND_LINE, GenerateRandomSecondLine() },
                { CardDebit.FIELD_PIN_CODE, PIN_CODE },
                {
                    CardDebit.FIELD_ALIAS,
                    new Pointer(POINTER_TYPE_EMAIL, EMAIL_YOUR_COMPANY)
                    {
                        Name = POINTER_NAME_TEST
                    }
                },
            };

            Console.WriteLine(CardDebit.Create(apiContext, requestMap, USER_ITEM_ID));
        }
Пример #4
0
        private const int MONETARY_ACCOUNT_ID = 0; // Put your monetaryAccount ID here

        public void Run()
        {
            BunqContext.LoadApiContext(ApiContext.Restore());
            var cardPinAssignment = new CardPinAssignment(
                CARD_PIN_ASSIGNMENT_TYPE_PRIMARY,
                PIN_CODE,
                MONETARY_ACCOUNT_ID
                );
            var allCardPinAssignments = new List <CardPinAssignment> {
                cardPinAssignment
            };

            Console.WriteLine(CardDebit.Create(GenerateRandomSecondLine(), NAME_YOUR_COMPANY,
                                               new Pointer(POINTER_TYPE_EMAIL, EMAIL_YOUR_COMPANY)
            {
                Name = POINTER_NAME_TEST
            },
                                               pinCodeAssignment: allCardPinAssignments));
        }
Пример #5
0
        public void TestOrderNewMaestroCard()
        {
            var cardPinAssignment = new CardPinAssignment(
                CARD_PIN_ASSIGNMENT_TYPE_PRIMARY,
                PIN_CODE,
                Config.GetMonetarytAccountId());
            var allCardPinAssignments = new List <CardPinAssignment> {
                cardPinAssignment
            };
            var cardDebit = CardDebit.Create(GenerateRandomSecondLine(), GetAnAllowedName(), GetAlias(), CardTypeMaestro,
                                             allCardPinAssignments).Value;

            Assert.True(cardDebit.Id != null);

            var cardFromCardEndpoint = Card.Get(cardDebit.Id.Value).Value;

            Assert.Equal(cardDebit.SecondLine, cardFromCardEndpoint.SecondLine);
            Assert.Equal(cardDebit.Created, cardFromCardEndpoint.Created);
            Assert.Equal(cardDebit.NameOnCard, cardFromCardEndpoint.NameOnCard);
        }