Exemplo n.º 1
0
        /// <summary>
        /// Submits the sale via Ontraport form.
        /// </summary>
        public string Submit(ProcessOrder order)
        {
            order.CheckNotNull(nameof(order));
            order.OntraportFormId.CheckNotNullOrEmpty(nameof(order.OntraportFormId));
            order.Address.CheckNotNull(nameof(order.Address));
            if (order.PaymentCurrency != Currency.Usd)
            {
                throw new ArgumentException(Res.PayPalFormInvalidCurrency);
            }

            return(_ontraForms.ClientPost(order.OntraportFormId, GetFormData(order)));
        }
 public IActionResult OnPost()
 {
     if (ModelState.IsValid)
     {
         return(new TextActionResult(_ontraForms.ClientPost("p2c20557f57", new ApiCustomContact()
         {
             FirstName = Input.Name,
             Email = Input.Email
         }.GetChanges())));
     }
     return(Page());
 }