public async Task <IActionResult> Checkout(double total) { var paypalAPI = new PaypalAPI(configuration); String URL = await paypalAPI.GetRedirectUrlToPaypal(total, "USD"); return(Redirect(URL)); }
static void Main() { //#warning Paypal API not yet working var paypalApi = new PaypalAPI(); paypalApi.GetPaymentList(); SetConsoleUp(); NameValueCollection appSettings = ConfigurationManager.AppSettings; Paypal paypal = new Paypal(); MasterDetails[] recordsMs = paypal.LoadPaypalFile(appSettings["PaypalFilePath"]); Core.Generator generator = new Generator(); var mList = generator.Generate(appSettings, recordsMs); if (mList != null && mList.Count > 0) { Magento magento = new Magento(); magento.SaveMagentoFile(appSettings["MagentoFilePath"], appSettings["HeaderRow"], mList); Console.WriteLine(Process.Summary.ToString()); Console.WriteLine("{0} records generated into new file {1}", mList.Count, appSettings["MagentoFilePath"]); } else { //todo output summary? Console.WriteLine("No records generated. \r\nCheck application settings in app.config.\r\n"); } Console.WriteLine("Press any key..."); Console.ReadLine(); }
/// <summary> /// Método para ejecutar el pago /// </summary> /// <param name="paymentId">ID del pago</param> /// <param name="PayerID">ID del pagador</param> /// <returns></returns> public async Task <IActionResult> success([FromQuery(Name = "paymentId")] string paymentId, [FromQuery(Name = "PayerID")] string PayerID) { var paypalAPI = new PaypalAPI(configuration); var result = await paypalAPI.ExecutePayment(paymentId, PayerID); ViewBag.data = result; return(View("success")); }
private void Button_Clicked(object sender, EventArgs e) { PaypalAPI paypal = new PaypalAPI(); try { paypal.SendPay(Convert.ToDouble(valuePay.Text)); DisplayAlert("Success", "Successful Payment.", "Ok"); } catch (Exception er) { DisplayAlert("Error", er.Message, "Ok"); } valuePay.Text = ""; valuePay.Focus(); }