Exemple #1
0
        public static PayResponse Request(string merchantId, long amount, string description, string callbackUrl)
        {
            bool     sandBoxMode = merchantId.Equals(TestMerchantId);
            HttpCore httpCore    = new HttpCore(Urls.GetPaymentRequestUrl(sandBoxMode), "POST",
                                                JsonConvert.SerializeObject(new PayRequest(merchantId, amount, description, callbackUrl)));
            var res = JsonConvert.DeserializeObject <PayResponse>(httpCore.GetResponse());

            res.Authority = res.Authority.TrimStart('0');
            return(res);
        }
Exemple #2
0
        public static PayVerifyResponse Verify(string merchantId, long amount, string authority)
        {
            string z     = "";
            int    count = AuthorityLength - authority.Length;

            for (int i = 0; i < count; i++)
            {
                z += "0";
            }
            authority = z + authority;

            bool     sandBoxMode = merchantId.Equals(TestMerchantId);
            HttpCore httpCore    = new HttpCore(Urls.GetVerificationUrl(sandBoxMode), "POST",
                                                JsonConvert.SerializeObject(new PayVerify(merchantId, amount, authority)));

            return(JsonConvert.DeserializeObject <PayVerifyResponse>(httpCore.GetResponse()));
        }