public async void Example()
        {
#pragma warning disable 0168
            using (Client client = GetClient())
            {
                Address billingAddress = new Address();
                billingAddress.AdditionalInfo = "Suite II";
                billingAddress.City           = "Monument Valley";
                billingAddress.CountryCode    = "US";
                billingAddress.HouseNumber    = "1";
                billingAddress.State          = "Utah";
                billingAddress.Street         = "Desertroad";
                billingAddress.Zip            = "84536";

                CompanyInformation companyInformation = new CompanyInformation();
                companyInformation.Name = "Acme Labs";

                PersonalNameToken name = new PersonalNameToken();
                name.FirstName     = "Wile";
                name.Surname       = "Coyote";
                name.SurnamePrefix = "E.";

                PersonalInformationToken personalInformation = new PersonalInformationToken();
                personalInformation.Name = name;

                CustomerToken customer = new CustomerToken();
                customer.BillingAddress      = billingAddress;
                customer.CompanyInformation  = companyInformation;
                customer.MerchantCustomerId  = "1234";
                customer.PersonalInformation = personalInformation;

                BankAccountBban bankAccountBban = new BankAccountBban();
                bankAccountBban.AccountNumber = "000000123456";
                bankAccountBban.BankCode      = "05428";
                bankAccountBban.BranchCode    = "11101";
                bankAccountBban.CheckDigit    = "X";
                bankAccountBban.CountryCode   = "IT";

                TokenNonSepaDirectDebitPaymentProduct705SpecificData paymentProduct705SpecificData = new TokenNonSepaDirectDebitPaymentProduct705SpecificData();
                paymentProduct705SpecificData.AuthorisationId = "123456";
                paymentProduct705SpecificData.BankAccountBban = bankAccountBban;

                MandateNonSepaDirectDebit mandate = new MandateNonSepaDirectDebit();
                mandate.PaymentProduct705SpecificData = paymentProduct705SpecificData;

                TokenNonSepaDirectDebit nonSepaDirectDebit = new TokenNonSepaDirectDebit();
                nonSepaDirectDebit.Customer = customer;
                nonSepaDirectDebit.Mandate  = mandate;

                CreateTokenRequest body = new CreateTokenRequest();
                body.NonSepaDirectDebit = nonSepaDirectDebit;
                body.PaymentProductId   = 705;

                CreateTokenResponse response = await client.Merchant("merchantId").Tokens().Create(body);
            }
#pragma warning restore 0168
        }
Example #2
0
        public async void Example()
        {
#pragma warning disable 0168
            using (Client client = GetClient())
            {
                Address billingAddress = new Address();
                billingAddress.AdditionalInfo = "b";
                billingAddress.City           = "Monument Valley";
                billingAddress.CountryCode    = "US";
                billingAddress.HouseNumber    = "13";
                billingAddress.State          = "Utah";
                billingAddress.Street         = "Desertroad";
                billingAddress.Zip            = "84536";

                CompanyInformation companyInformation = new CompanyInformation();
                companyInformation.Name = "Acme Labs";

                PersonalNameToken name = new PersonalNameToken();
                name.FirstName     = "Wile";
                name.Surname       = "Coyote";
                name.SurnamePrefix = "E.";

                PersonalInformationToken personalInformation = new PersonalInformationToken();
                personalInformation.Name = name;

                CustomerToken customer = new CustomerToken();
                customer.BillingAddress      = billingAddress;
                customer.CompanyInformation  = companyInformation;
                customer.MerchantCustomerId  = "1234";
                customer.PersonalInformation = personalInformation;

                CardWithoutCvv cardWithoutCvv = new CardWithoutCvv();
                cardWithoutCvv.CardNumber     = "4567350000427977";
                cardWithoutCvv.CardholderName = "Wile E. Coyote";
                cardWithoutCvv.ExpiryDate     = "1299";
                cardWithoutCvv.IssueNumber    = "12";

                TokenCardData data = new TokenCardData();
                data.CardWithoutCvv = cardWithoutCvv;

                TokenCard card = new TokenCard();
                card.Customer = customer;
                card.Data     = data;

                UpdateTokenRequest body = new UpdateTokenRequest();
                body.Card             = card;
                body.PaymentProductId = 1;

                await client.Merchant("merchantId").Tokens().Update("tokenId", body);
            }
#pragma warning restore 0168
        }