Exemplo n.º 1
0
        /// <summary>
        /// Check out payment request
        /// </summary>
        /// <param name="merchantAccount"></param>
        /// <returns></returns>
        public Model.Checkout.PaymentRequest CreatePaymentRequestCheckout()
        {
            var amount          = new Model.Checkout.Amount("USD", 1000);
            var paymentsRequest = new Model.Checkout.PaymentRequest
            {
                Reference       = "Your order number ",
                ReturnUrl       = @"https://your-company.com/...",
                MerchantAccount = "MerchantAccount",
            };

            paymentsRequest.AddCardData("4111111111111111", "10", "2020", "737", "John Smith");
            return(paymentsRequest);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 3DS2 payments request
        /// </summary>
        /// <returns></returns>
        public Model.Checkout.PaymentRequest CreatePaymentRequest3DS2()
        {
            var amount          = new Model.Checkout.Amount("USD", 1000);
            var paymentsRequest = new Model.Checkout.PaymentRequest
            {
                Reference       = "Your order number ",
                Amount          = amount,
                ReturnUrl       = @"https://your-company.com/...",
                MerchantAccount = "MerchantAccount",
                AdditionalData  = new Dictionary <string, string>()
                {
                    { "allow3DS2", "true" }
                },
                Channel = Model.Checkout.PaymentRequest.ChannelEnum.Web
            };

            paymentsRequest.AddCardData("4111111111111111", "10", "2020", "737", "John Smith");
            return(paymentsRequest);
        }
        /// <summary>
        /// Check out Google Pay payment request
        /// </summary>
        /// <returns></returns>
        public Model.Checkout.PaymentRequest CreateGooglePayPaymentRequestCheckout()
        {
            var amount    = new Model.Checkout.Amount("USD", 1000);
            var googlePay = new Model.Checkout.DefaultPaymentMethodDetails()
            {
                Type           = "paywithgoogle",
                GooglePayToken = "==Payload as retrieved from Google Pay response=="
            };
            var paymentsRequest = new Model.Checkout.PaymentRequest
            {
                Amount          = amount,
                Reference       = "Your order number ",
                ReturnUrl       = @"https://your-company.com/...",
                MerchantAccount = "MerchantAccount",
                PaymentMethod   = googlePay
            };

            return(paymentsRequest);
        }
        /// <summary>
        /// Check out Apple Pay payment request
        /// </summary>
        /// <returns></returns>
        public Model.Checkout.PaymentRequest CreateApplePayPaymentRequestCheckout()
        {
            var amount   = new Model.Checkout.Amount("USD", 1000);
            var applePay = new Model.Checkout.DefaultPaymentMethodDetails()
            {
                Type          = "applepay",
                ApplePayToken = "VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..."
            };
            var paymentsRequest = new Model.Checkout.PaymentRequest
            {
                Amount          = amount,
                Reference       = "Your order number ",
                ReturnUrl       = @"https://your-company.com/...",
                MerchantAccount = "MerchantAccount",
                PaymentMethod   = applePay
            };

            return(paymentsRequest);
        }