public IActionResult ProcessPayment(ProcessPaymentPayload payload)
        {
            if (DateTime.Now > payload.ExpiryDate)
            {
                return(BadRequest("The customers credit card has expired."));
            }

            return(PaymentGateway.ProcessPayment(payload, new BankRequestMock()));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Maps the api payload
 /// </summary>
 /// <returns>
 /// The <see cref="GetPaymentDetailsResponse" />.
 /// </returns>
 public PaymentDetails Map(ProcessPaymentPayload payload, string uniqueIdentifier, bool success)
 {
     this.Id         = uniqueIdentifier;
     this.Amount     = payload.Amount;
     this.CardNumber = payload.CardNumber;
     this.Currency   = payload.Currency;
     this.Reference  = payload.Reference;
     this.Cvv        = payload.Cvv;
     this.Success    = success;
     this.ExpiryDate = payload.ExpiryDate;
     return(this);
 }