protected void btndirectpayment_Click(object sender, EventArgs e)
 {
     External_APIs.CurrencyCloud cc = new External_APIs.CurrencyCloud();
     cc.CheckCC_Trades_DirectPayment();
     LastUpdated();
     RadGrid1.Rebind();
 }
        public void dorun(int cutoff)
        {
            External_APIs.CurrencyCloud cc = new External_APIs.CurrencyCloud();

            string strsettlementid;
            //Create the Settlement
            strsettlementid = cc.Settlement_Create();

            //Add each transaction
            cc.Settlement_AddTrades(strsettlementid, cutoff);

            //Release the batch
            Boolean releasesuccess = cc.Settlement_Release(strsettlementid);

            if (releasesuccess)
            {
                if (cutoff == 1)
                {
                    Peerfx_DB.SPs.UpdateScheduledTask(2).Execute();
                }
                else
                {
                    Peerfx_DB.SPs.UpdateScheduledTask(3).Execute();
                }
            }
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Peerfx.External_APIs.CurrencyCloud cc = new External_APIs.CurrencyCloud();
     DataTable dttemp = Peerfx_DB.SPs.ViewInfoFeeTypesAll().GetDataSet().Tables[0];
     Hashtable hstemp = new Hashtable();
     foreach (DataRow dr in dttemp.Rows){
         int currency1 = Convert.ToInt32(dr["currency1"]);
         int currency2 = Convert.ToInt32(dr["currency2"]);
         hstemp = cc.Exchange_Rate_ccy_pair(currency1, currency2);
         if (!hstemp.ContainsValue("error"))
         {
             decimal rate = Convert.ToDecimal(hstemp["market_price"]);
             Peerfx_DB.SPs.UpdateInfoFeeTypesExchangeRate(currency1, currency2, rate).Execute();
         }
     }
 }
        public void LoadInfo(string cctradeid)
        {
            lblbuyamount.Text = "";
            lblbuycurrency.Text = "";
            lblclientrate.Text = "";
            lbldeliverydate.Text = "";
            lblmarketrate.Text = "";
            lblsellamount.Text = "";
            lblsellcurrency.Text = "";
            lblsettlementdate.Text = "";
            lblstatus.Text = "";
            lbltradeddate.Text = "";
            lbltradeid.Text = "";

            if (cctradeid != null)
            {
                if (cctradeid != "")
                {
                    External_APIs.CurrencyCloud cc = new External_APIs.CurrencyCloud();
                    Hashtable hstemp = cc.getTradeDetails(cctradeid);

                    if (hstemp.Count > 0)
                    {
                        lblbuyamount.Text = hstemp["client_buy_amt"].ToString();
                        lblbuycurrency.Text = hstemp["client_buy_ccy"].ToString();
                        lblclientrate.Text = hstemp["client_invr"].ToString();
                        if (hstemp["delivery_date"] != null)
                        {
                            lbldeliverydate.Text = hstemp["delivery_date"].ToString();
                        }
                        lblmarketrate.Text = hstemp["fxc_market_rate"].ToString();
                        lblsellamount.Text = hstemp["client_sell_amt"].ToString();
                        lblsellcurrency.Text = hstemp["client_sell_ccy"].ToString();
                        if ((hstemp["settlement_date"] != null) && (hstemp["settlement_time"] != null))
                        {
                            lblsettlementdate.Text = hstemp["settlement_date"].ToString() + " " + hstemp["settlement_time"].ToString();
                        }
                        lblstatus.Text = hstemp["status"].ToString();
                        if ((hstemp["traded_at_date"] != null) && (hstemp["traded_at_time"] != null))
                        {
                            lbltradeddate.Text = hstemp["traded_at_date"].ToString() + " " + hstemp["traded_at_time"].ToString();
                        }
                        lbltradeid.Text = cctradeid;
                    }
                }
            }
        }
        public void LoadInfo(string ccpaymentid)
        {
            lblclientcost.Text = "";
            lblcurrency.Text = "";
            lbldealref.Text = "";
            lblpaymentid.Text = "";
            lblpaymentreference.Text = "";
            lblpaymenttype.Text = "";
            lblreason.Text = "";
            lblstatus.Text = "";
            lbltransfereddate.Text = "";

            if (ccpaymentid != null)
            {
                if (ccpaymentid != "")
                {
                    External_APIs.CurrencyCloud cc = new External_APIs.CurrencyCloud();
                    Hashtable hstemp = cc.getPaymentDetails(ccpaymentid);

                    if (hstemp.Count > 0)
                    {
                        if (hstemp["client_cost"] != null)
                        {
                            lblclientcost.Text = hstemp["client_cost"].ToString();
                        }

                        lblcurrency.Text = hstemp["ccy"].ToString();
                        lbldealref.Text = hstemp["deal_ref"].ToString();
                        lblpaymentid.Text = ccpaymentid;
                        lblpaymentreference.Text = hstemp["payment_reference"].ToString();
                        lblpaymenttype.Text = hstemp["payment_type"].ToString();
                        if (hstemp["reason"] != null)
                        {
                            lblreason.Text = hstemp["reason"].ToString();
                        }
                        lblstatus.Text = hstemp["status"].ToString();
                        if (hstemp["transferred_at"] != null)
                        {
                            lbltransfereddate.Text = hstemp["transferred_at"].ToString();
                        }
                    }

                }
            }
        }
Ejemplo n.º 6
0
        public Boolean ValidateBankAccount()
        {
            //Validate the bank account with CurrencyCloud
            External_APIs.CurrencyCloud cc = new External_APIs.CurrencyCloud();
            string strfullname = txtfirstname.Text + " " + txtlastname.Text;
            Boolean bankaccountisvalid = false;

            if (sitetemp.isValidateBankAccount(Convert.ToInt32(ddlcurrency.SelectedValue)))
            {
                BankAccounts ba = gettxtfields();
                lblerror.Visible = false;
                string strreturn = cc.Validate_BankAccount(ba);
                if (strreturn == "true"){
                    bankaccountisvalid = true;
                }
            }
            else
            {
                bankaccountisvalid = true;
            }

            if (!bankaccountisvalid)
            {
                lblerror.Visible = true;
            }
            lblerror.Text = "Please enter valid Bank Account info";
            if ((txtfirstname.Text.Length == 0) || (txtlastname.Text.Length == 0))
            {
                lblerror.Text = "Please enter the recipients Full Name";
                bankaccountisvalid = false;
            }

            if (!bankaccountisvalid)
            {/*
                switch (strreturn.Contains())
                {
                    case "BIC":
                }
              */
            }

            return bankaccountisvalid;
        }
 protected void Checkccrequiredfields()
 {
     External_APIs.CurrencyCloud cc = new External_APIs.CurrencyCloud();
     lblccresult.Text = cc.RequiredFields_BankAccounts_rawresponse(Convert.ToInt32(ddlcurrency.SelectedValue), Convert.ToInt32(ddlcountry.SelectedValue));
 }
 protected void btnretryTrades_Click(object sender, EventArgs e)
 {
     External_APIs.CurrencyCloud cc = new External_APIs.CurrencyCloud();
     DataTable dttemp = Peerfx_DB.SPs.ViewCurrencyCloudTradesErrors().GetDataSet().Tables[0];
     foreach (DataRow dr in dttemp.Rows)
     {
         cc.Trade_Execute(Convert.ToInt32(dr["payments_key"]));
     }
     RadGrid1.Rebind();
     RadGrid2.Rebind();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     External_APIs.CurrencyCloud cc = new External_APIs.CurrencyCloud();
     cc.CheckCC_Trades_DirectPayment();
 }