Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     System.Globalization.CultureInfo ui = System.Globalization.CultureInfo.CurrentUICulture;
     if (Request.Form["payment_id"] != null || Request.Form["data"] != null)
     {
         ResponeData = Request.Form;
         var resp = new Response().GetResponse(Request.Form.ToString(), "form");
         if (resp.SignatureError != null)
         {
             ResponeOrderError                     = "Signature error";
             ResponeOrderSignatureString           = resp.SignatureError.SignatureString;
             ResponeOrderCalculatedSignatureString = resp.SignatureError.CalculatedSignature;
         }
         else
         {
             ResponeOrder = resp.order_id;
             var p2PcreditReq = new P2PcreditRequest()
             {
                 order_id          = Guid.NewGuid().ToString(),
                 currency          = "USD",
                 receiver_rectoken = resp.rectoken,
                 amount            = 10000,
                 order_desc        = "request desc"
             };
             Config.CreditKey = "testcredit";
             var presp = new P2Pcredit().Post(p2PcreditReq);
             if (presp.Error != null)
             {
                 ResponeData = null;
                 DataError   = presp.Error.ErrorMessage;
                 Data        = presp.Error.RequestId;
             }
             else
             {
                 P2PResp = presp;
             }
         }
     }
     btnSubmit.Click += Submit;
 }
Exemplo n.º 2
0
        public void P2PTest()
        {
            Config.MerchantId  = MerchantId;
            Config.SecretKey   = SecretKey;
            Config.CreditKey   = CreditKey;
            Config.ContentType = ContentType;
            Config.Endpoint(Endpoint);
            string oID = Guid.NewGuid().ToString();
            var    req = new P2PcreditRequest()
            {
                order_id             = oID,
                amount               = 10000,
                order_desc           = "checkout tests",
                currency             = "EUR",
                receiver_card_number = card_number
            };
            var resp = new P2Pcredit().Post(req);

            Assert.IsNotNull(resp);
            Assert.AreEqual(oID, resp.order_id);
            Assert.AreEqual("declined", resp.order_status);
        }
Exemplo n.º 3
0
        public void P2PTest()
        {
            FondyConfig.Init(MerchantId, SecretKey, ContentType, CreditKey);
            FondyConfig.Endpoint(Endpoint);

            string orderId = Guid.NewGuid().ToString();

            var req = new P2PcreditRequest()
            {
                order_id             = orderId,
                amount               = 10000,
                order_desc           = "P2P Credit test request",
                currency             = "USD",
                receiver_card_number = card_number
            };

            var resp = new P2Pcredit().Post(req);

            Assert.IsNotNull(resp);
            Assert.AreEqual(orderId, resp.order_id);
            Assert.AreEqual("declined", resp.order_status);
        }