示例#1
0
        public void QueryTransactions_ShouldAllowFilteringWithOperator_ForEmailWithTransactionHistory(Operator?op)
        {
            TokenCard cardCreateModel = TestHelper.GetTokenCardModel();
            HttpResponse <CardTokenCreate> cardTokenResponse = CheckoutClient.TokenService.GetCardToken(cardCreateModel);
            CardTokenCharge       cardTokenChargeModel       = TestHelper.GetCardTokenChargeCreateModel(cardTokenResponse.Model.Id, TestHelper.RandomData.Email);
            HttpResponse <Charge> chargeResponse             = CheckoutClient.ChargeService.ChargeWithCardToken(cardTokenChargeModel);

            QueryTransactions_ShouldAllowFilteringWithOperator(chargeResponse.Model.Email, op);
        }
示例#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
        }
示例#3
0
        public async Task Test()
        {
            CreateTokenRequest createTokenRequest = new CreateTokenRequest();

            createTokenRequest.PaymentProductId = (1);
            TokenCard card = new TokenCard();

            createTokenRequest.Card = (card);
            CustomerToken customer = new CustomerToken();

            card.Customer = (customer);
            Address billingAddress = new Address();

            customer.BillingAddress    = (billingAddress);
            billingAddress.CountryCode = ("NL");
            TokenCardData mandate = new TokenCardData();

            card.Data = (mandate);
            CardWithoutCvv cardWithoutCvv = new CardWithoutCvv();

            mandate.CardWithoutCvv        = (cardWithoutCvv);
            cardWithoutCvv.CardholderName = ("Jan");
            cardWithoutCvv.IssueNumber    = ("12");
            cardWithoutCvv.CardNumber     = ("4567350000427977");
            cardWithoutCvv.ExpiryDate     = ("0820");

            using (Client client = GetClient())
            {
                CreateTokenResponse createTokenResponse = await client
                                                          .Merchant("9991")
                                                          .Tokens()
                                                          .Create(createTokenRequest);

                Assert.NotNull(createTokenResponse.Token);

                DeleteTokenParams deleteTokenRequest = new DeleteTokenParams();

                await client
                .Merchant("9991")
                .Tokens()
                .Delete(createTokenResponse.Token, deleteTokenRequest);
            }
        }
示例#4
0
 /// <summary>
 ///     <para>Do not use the <c>GetCardTokenAsync</c> method in live production.</para>
 ///     <para>The cardToken is part of the response when you use Checkout.com solutions like Checkout.js and Frames in your shop.</para>
 /// </summary>
 public Task <HttpResponse <CardTokenCreate> > GetCardTokenAsync(TokenCard requestModel)
 {
     return(_apiHttpClient.PostRequest <CardTokenCreate>(_configuration.ApiUrls.CardToken, _configuration.PublicKey, requestModel));
 }
示例#5
0
 /// <summary>
 ///     <para>Do not use the <c>GetCardToken</c> method in live production.</para>
 ///     <para>The cardToken is part of the response when you use Checkout.com solutions like Checkout.js and Frames in your shop.</para>
 /// </summary>
 public HttpResponse <CardTokenCreate> GetCardToken(TokenCard requestModel)
 {
     return(_tokenServiceAsync.GetCardTokenAsync(requestModel).Result);
 }