Ejemplo n.º 1
0
        public static PayResponse Request(string MerchantId, long amount, string description, string callbackUrl)
        {
            //bool sandBoxMode = merchantID.Equals(TestMerchantID);
            var httpCore = new HttpCore(Urls.GetPaymentRequestUrl(IsSandbox), "POST",
                                        JsonConvert.SerializeObject(new PayRequest(MerchantId, amount, description, callbackUrl)));
            var res = JsonConvert.DeserializeObject <PayResponse>(httpCore.GetResponse());

            res.Authority = res.Authority.TrimStart('0');
            return(res);
        }
Ejemplo n.º 2
0
        public static PayVerifyResponse Verify(string MerchantId, long amount, string authority)
        {
            var z     = "";
            var count = AuthorityLength - authority.Length;

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

            //bool sandBoxMode = merchantID.Equals(TestMerchantID);
            var httpCore = new HttpCore(Urls.GetVerificationUrl(IsSandbox), "POST",
                                        JsonConvert.SerializeObject(new PayVerify(MerchantId, amount, authority)));

            return(JsonConvert.DeserializeObject <PayVerifyResponse>(httpCore.GetResponse()));
        }
Ejemplo n.º 3
0
 public static string GetPaymentGatewayUrl(string authority)
 {
     //bool sandBoxMode = merchantID.Equals(TestMerchantID);
     return(Urls.GetPaymentGatewayUrl(authority, IsSandbox));
 }