Пример #1
0
        public VerificationResponse InvokeVerificationPayment(VerificationRequest verificationRequest)
        {
            _HttpCore.URL    = _Urls.GetVerificationURL();
            _HttpCore.Method = Method.POST;
            _HttpCore.Raw    = verificationRequest;


            String response                   = _HttpCore.Get();
            JavaScriptSerializer j            = new JavaScriptSerializer();
            VerificationResponse verification = j.Deserialize <VerificationResponse>(response);

            return(verification);
        }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var    zarinpal   = ZarinPal.ZarinPal.Get();
        String MerchantID = "71c705f8-bd37-11e6-aa0c-000c295eb8fc";
        String Authority  = HttpUtility.ParseQueryString(this.ClientQueryString)["Authority"];
        long   Amount     = 100;


        var verificationRequest = new ZarinPal.VerificationRequest(MerchantID, Amount, Authority);

        var verificationResponse = zarinpal.InvokeVerificationPayment(verificationRequest);

        if (verificationResponse.IsSuccess)
        {
            Response.Write(String.Format("<script>alert('Purchase successfully with ref transaction {0}')</script>", verificationResponse.RefID));
        }
        else
        {
            Response.Write(String.Format("<script>alert('Purchase unsuccessfully Error code is: {0}')</script>", verificationResponse.Status));
        }
    }