コード例 #1
0
        public System.Threading.Tasks.Task <PaymentVerificationResponse> PaymentVerificationAsync(string MerchantID, string Authority, int Amount)
        {
            PaymentVerificationRequest inValue = new PaymentVerificationRequest();

            inValue.Body            = new PaymentVerificationRequestBody();
            inValue.Body.MerchantID = MerchantID;
            inValue.Body.Authority  = Authority;
            inValue.Body.Amount     = Amount;
            return(((PaymentGatewayImplementationServicePortType)(this)).PaymentVerificationAsync(inValue));
        }
コード例 #2
0
        public int PaymentVerification(string MerchantID, string Authority, int Amount, out long RefID)
        {
            PaymentVerificationRequest inValue = new PaymentVerificationRequest();

            inValue.Body            = new PaymentVerificationRequestBody();
            inValue.Body.MerchantID = MerchantID;
            inValue.Body.Authority  = Authority;
            inValue.Body.Amount     = Amount;
            PaymentVerificationResponse retVal = ((PaymentGatewayImplementationServicePortType)(this)).PaymentVerification(inValue);

            RefID = retVal.Body.RefID;
            return(retVal.Body.Status);
        }
コード例 #3
0
        public async Task <IActionResult> Confirm([FromServices] IPaymentProvider provider, string reference)
        {
            var request = new PaymentVerificationRequest();

            request.Initialize(new Dictionary <string, string>
            {
                [PAYSTACK_VERIFICATION_REFERENCE_KEY] = reference
            });

            var response = await provider.VerifyPayment(request);

            if (response.Successful)
            {
                ViewBag.amountPaid = (response.Amount / 100f).ToString();
            }

            return(View("Index"));
        }
コード例 #4
0
        public async Task IsVerifyPaymentSuccessParsingCorrect()
        {
            paystack.Caller = new TestPaystackCaller <PaymentVerificationResponse>();
            const string expectedMessage = "Successful";
            const string expectedStatus  = "success";

            var request = new PaymentVerificationRequest();

            request.Initialize(new Dictionary <string, string>
            {
                [PAYSTACK_VERIFICATION_REFERENCE_KEY] = "500"
            });

            var response = await paystack.VerifyPayment(request);

            Assert.AreEqual(expectedMessage, response.Message);
            Assert.AreEqual(expectedStatus, response.Status);
            Assert.IsTrue(response.AuthorizationReference != null);
            Assert.IsTrue(response.Successful);
        }
コード例 #5
0
 System.Threading.Tasks.Task <PaymentVerificationResponse> PaymentGatewayImplementationServicePortType.PaymentVerificationAsync(PaymentVerificationRequest request)
 {
     return(base.Channel.PaymentVerificationAsync(request));
 }
コード例 #6
0
 PaymentVerificationResponse PaymentGatewayImplementationServicePortType.PaymentVerification(PaymentVerificationRequest request)
 {
     return(base.Channel.PaymentVerification(request));
 }