/// <summary>
        /// POST /paymentsLinks API call
        /// </summary>
        /// <param name="createPaymentLinkRequest"></param>
        /// <returns>CreatePaymentLinkResponse</returns>
        public CreatePaymentLinkResponse PaymentLinks(CreatePaymentLinkRequest createPaymentLinkRequest)
        {
            var jsonRequest  = Util.JsonOperation.SerializeRequest(createPaymentLinkRequest);
            var jsonResponse = _paymentLinksResult.Request(jsonRequest);

            return(JsonConvert.DeserializeObject <CreatePaymentLinkResponse>(jsonResponse));
        }
        /// <summary>
        /// POST /paymentsLinks API call async
        /// </summary>
        /// <param name="createPaymentLinkRequest"></param>
        /// <returns>PaymentLinkResource</returns>
        public async Task <PaymentLinkResource> PaymentLinksAsync(CreatePaymentLinkRequest createPaymentLinkRequest)
        {
            var jsonRequest  = Util.JsonOperation.SerializeRequest(createPaymentLinkRequest);
            var jsonResponse = await _paymentLinksResult.RequestAsync(jsonRequest);

            return(JsonConvert.DeserializeObject <PaymentLinkResource>(jsonResponse));
        }
Beispiel #3
0
        public void CreatePaymentLinkSuccess()
        {
            var createPaymentLinkRequest = new CreatePaymentLinkRequest {
                Store = "TheDemoStore"
            };

            Assert.AreEqual(createPaymentLinkRequest.Store, "TheDemoStore");
        }
Beispiel #4
0
        public void PaymentLinksSuccess()
        {
            var client   = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/payment-links-success.json");
            var checkout = new Checkout(client);
            var createPaymentLinkRequest = new CreatePaymentLinkRequest(amount: new Amount(currency: "EUR", 1000), merchantAccount: "MerchantAccount", reference: "YOUR_ORDER_NUMBER");
            var paymentLinksResponse     = checkout.PaymentLinks(createPaymentLinkRequest);

            Assert.AreEqual(paymentLinksResponse.Url, "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA");
            Assert.AreEqual(paymentLinksResponse.ExpiresAt, "2019-12-17T10:05:29Z");
            Assert.AreEqual(paymentLinksResponse.Reference, "YOUR_ORDER_NUMBER");
            Assert.IsNotNull(paymentLinksResponse.Amount);
        }
Beispiel #5
0
        public void CreateRecurringPaymentLinkSuccessTest()
        {
            var client   = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentlinks-recurring-payment-success.json");
            var checkout = new Checkout(client);

            var createPaymentLinkRequest = new CreatePaymentLinkRequest(amount: new Amount(currency: "EUR", 100), merchantAccount: "MerchantAccount", reference: "REFERENCE_NUMBER")
            {
                CountryCode              = "GR",
                ShopperLocale            = "GR",
                ShopperReference         = "ShopperReference",
                StorePaymentMethod       = true,
                RecurringProcessingModel = CreatePaymentLinkRequest.RecurringProcessingModelEnum.Subscription
            };

            var paymentLinksResponse = checkout.PaymentLinks(createPaymentLinkRequest);

            Assert.AreEqual(createPaymentLinkRequest.Reference, paymentLinksResponse.Reference);
            Assert.AreEqual("https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA", paymentLinksResponse.Url);
            Assert.AreEqual(createPaymentLinkRequest.Amount.Currency, paymentLinksResponse.Amount.Currency);
            Assert.AreEqual(createPaymentLinkRequest.Amount.Value, paymentLinksResponse.Amount.Value);
        }
Beispiel #6
0
        public void CreatePaymentLinkSuccess()
        {
            var createPaymentLinkRequest = new CreatePaymentLinkRequest(store: "TheDemoStore", amount: new Amount(currency: "EUR", 1000), merchantAccount: "MerchantAccount", reference: "reference");

            Assert.AreEqual(createPaymentLinkRequest.Store, "TheDemoStore");
        }