private static CreditCardDebitPeriod GenerateDebitPeriod(AmexCardInfo card, CardChargeResponse bankCharge) { return(new CreditCardDebitPeriod { CardId = GenerateCardId(card), CardLastDigits = bankCharge.CardNumber, Date = AutoMapper.Mapper.Map <DateTime>(bankCharge.BillingDate), Amount = bankCharge.BillingSumSekel, Transactions = new List <CreditCardTransaction>() }); }
/// <summary> /// Charge a card /// </summary> /// <param name="card">Card details of customer</param> /// <param name="alg">Algorithm to use for validation</param> /// <returns>Details of the outcome of the card charge</returns> public async Task <CardChargeResponse> ChargeCardAsync(Card card, Algorithm alg) { var body = new { PBFPubKey = PrivateKey, client = encryption.EncryptData(PrivateKey, card.ToJson()), alg = alg.ToString() }; var response = await _client.SendRequest(Request.RequestMethod.Post, "flwv3-pug/getpaidx/api/charge", body.ToJson()); return(CardChargeResponse.FromJson(response)); }