public void PaymentCurrencyAmountInitsWithNoArgs() { var paymentCurrencyAmount = new PaymentCurrencyAmount(); Assert.NotNull(paymentCurrencyAmount); Assert.IsType <PaymentCurrencyAmount>(paymentCurrencyAmount); }
public void PaymentCurrencyAmountInits() { var currency = "$"; var value = "100.00"; var currencySystem = "USD"; var paymentCurrencyAmount = new PaymentCurrencyAmount(currency, value, currencySystem); Assert.NotNull(paymentCurrencyAmount); Assert.IsType <PaymentCurrencyAmount>(paymentCurrencyAmount); Assert.Equal(currency, paymentCurrencyAmount.Currency); Assert.Equal(value, paymentCurrencyAmount.Value); Assert.Equal(currencySystem, paymentCurrencyAmount.CurrencySystem); }
public void PaymentItemInits() { var label = "yo-yo"; var amount = new PaymentCurrencyAmount("$", "5.00", "USD"); var pending = false; var paymentItem = new PaymentItem(label, amount, pending); Assert.NotNull(paymentItem); Assert.IsType <PaymentItem>(paymentItem); Assert.Equal(label, paymentItem.Label); Assert.Equal(amount, paymentItem.Amount); Assert.Equal(pending, paymentItem.Pending); }
public void PaymentShippingOptionInits() { var id = "shippingOptionId"; var label = "label"; var amount = new PaymentCurrencyAmount(); var selected = true; var paymentShippingOption = new PaymentShippingOption(id, label, amount, selected); Assert.NotNull(paymentShippingOption); Assert.IsType <PaymentShippingOption>(paymentShippingOption); Assert.Equal(id, paymentShippingOption.Id); Assert.Equal(label, paymentShippingOption.Label); Assert.Equal(amount, paymentShippingOption.Amount); Assert.Equal(selected, paymentShippingOption.Selected); }
public static string CreatePriceString(PaymentCurrencyAmount cost) { decimal value = FromInvariantString(cost.Value); return(String.Format(USDCulture, "{0:C}", value)); }
private PaymentCompleteResponse CreateMockCardDeclinedResponse(string requestId, string invoiceId, PaymentCurrencyAmount amount) { return(new PaymentCompleteResponse() { RequestId = requestId, Details = "We were unable to charge your credit card.", Result = PaymentResult.Fail, Error = new PaymentCompleteError() { Code = "card_error", Message = "Card cannot be processed.", Target = "stripeToken", InnerError = new PaymentCompleteError() { Code = PaymentErrorCodes.CardDeclined, Message = "Your credit card was declined." } } }); }