Exemple #1
0
        static PaymentVerifyResult getVerifyResult(IServiceProvider services, string authority)
        {
            using IServiceScope scope = services.CreateScope();
            IServiceProvider provider = scope.ServiceProvider;

            IZarinpalGateway zarinpal = provider.GetRequiredService <IZarinpalGateway>();
            var request = new PaymentVerifyRequest {
                Amount = 30000
            };

            //zarinpal.EnableSandboxMode();
            zarinpal.SetAuthority(authority);

            var result = zarinpal.VerifyPaymentAsync(request).Result;

            return(result);
        }
Exemple #2
0
        static PaymentRequestResult getPaymentResult(IServiceProvider services)
        {
            using IServiceScope scope = services.CreateScope();
            IServiceProvider provider = scope.ServiceProvider;

            IZarinpalGateway zarinpal = provider.GetRequiredService <IZarinpalGateway>();
            //zarinpal.EnableSandboxMode();
            var request = new PaymentRequest("http://*****:*****@gmail.com",
                Mobile      = "+989121234567"
            };

            zarinpal.SetAuthority("varzeshafarinan.com");

            var result = zarinpal.CreatePaymentAsync(request).Result;

            return(result);
        }