public PushpayAnticipatedPaymentDto CreateAnticipatedPayment(PushpayAnticipatedPaymentDto anticipatedPayment)
        {
            var request  = CreateRequest("anticipatedpayments", Method.POST, createAnticipatedPaymentsScope, anticipatedPayment);
            var response = _restClient.Execute <PushpayAnticipatedPaymentDto>(request);

            return(response.Data);
        }
        public PushpayAnticipatedPaymentDto CreateAnticipatedPayment(PushpayAnticipatedPaymentDto anticipatedPaymentDto)
        {
            // TODO replace when frontend is sending up data
            var samplePushpayAnticipatedPayment = new PushpayAnticipatedPaymentDto()
            {
                Description      = "2018 Jul NOLA Trip",
                DescriptionTitle = "Trip Donation For",
                ReturnUrl        = "https://www.espn.com",
                ReturnTitle      = "Return to espn.com...",
                MerchantKey      = PushpayMerchantKey,
                Fields           = new List <PushpayAnticipatedPaymentField>
                {
                    new PushpayAnticipatedPaymentField()
                    {
                        Key   = "amount",
                        Value = new JObject(
                            new JProperty("amount", "140.50"),
                            new JProperty("currency", "USD")
                            ),
                        ReadOnly = true
                    },
                    new PushpayAnticipatedPaymentField()
                    {
                        Key      = "fund",
                        Value    = "2018 Jul NOLA Trip",
                        ReadOnly = true
                    }
                }
            };

            return(_pushpayService.CreateAnticipatedPayment(samplePushpayAnticipatedPayment));
        }
Exemplo n.º 3
0
 public IActionResult CreateAnticipatedPayment([FromBody] PushpayAnticipatedPaymentDto anticipatedPaymentDto)
 {
     try
     {
         var result = _paymentEventService.CreateAnticipatedPayment(anticipatedPaymentDto);
         return(StatusCode(201, result.Links.Pay.Href));
     }
     catch (Exception ex)
     {
         return(StatusCode(400, ex));
     }
 }
Exemplo n.º 4
0
 public PushpayAnticipatedPaymentDto CreateAnticipatedPayment(PushpayAnticipatedPaymentDto anticipatedPayment)
 {
     return(_pushpayClient.CreateAnticipatedPayment(anticipatedPayment));
 }