public void Initialize() { base.Initialize(); interval = Interval.period(1, Interval.TypeUnit.MONTH); this.payment = _paymill.PaymentService.CreateWithTokenAsync(testToken).Result; this.offer1 = _paymill.OfferService.CreateAsync(this.amount, this.currency, this.interval, this.name).Result; this.offer2 = _paymill.OfferService.CreateAsync(this.amount * 2, this.currency, this.interval, "Updated " + this.name).Result; }
static void addCreditCardPayment() { Paymill.ApiKey = Properties.Settings.Default.ApiKey; Paymill.ApiUrl = Properties.Settings.Default.ApiUrl; PaymentService paymentService = Paymill.GetService<PaymentService>(); Payment payment = new Payment(); payment.Token = "098f6bcd4621d373cade4e832627b4f6"; Payment newPayment = paymentService.AddPayment(payment); Console.WriteLine("PaymentID:" + newPayment.Id); Console.Read(); }
static void addDebitPayment() { Paymill.ApiKey = Properties.Settings.Default.ApiKey; Paymill.ApiUrl = Properties.Settings.Default.ApiUrl; PaymentService paymentService = Paymill.GetService<PaymentService>(); Payment payment = new Payment(); payment.Type = Payment.TypePayment.DEBIT; payment.Code = "86055500"; payment.Account = "1234512345"; payment.Holder = "Max Mustermann"; Payment newPayment = paymentService.AddPayment(payment); Console.WriteLine("PaymentID:" + newPayment.Id); Console.WriteLine("Created at:" + newPayment.Created_At); Console.Read(); }
public Transaction CreateTransaction(Client customer, Payment creditCard, int amount, string currency = "EUR") { Transaction createdTransaction = transactionService.Create( new Transaction { Payment = creditCard, Client = customer, Amount = amount, Currency = currency} , null); return createdTransaction; }
public Refund CreateRefund(Client customer, Payment creditCard, int amount) { Transaction firstTransaction = getTransactions().Where(t => t.Client.Id == customer.Id && t.Payment.Id == creditCard.Id).FirstOrDefault(); Refund refund = refundService.Create(firstTransaction.Id, amount); return refund; }
public static Refund Withdraw(this Client customer, PaymillHelper ph, double amount, Payment creditCard = null) { if (creditCard == null) creditCard = customer.Payment.FirstOrDefault(); return ph.CreateRefund(customer, creditCard, PaymillHelper.DoubleToPaymillPrice(amount)); }
public static Transaction Pay(this Client customer, PaymillHelper ph, double amount, Payment creditCard = null) { if (creditCard == null) creditCard = customer.Payment.FirstOrDefault(); return ph.CreateTransaction(customer, creditCard, PaymillHelper.DoubleToPaymillPrice(amount)); }
static internal void ValidatesPayment(Payment payment) { if (payment == null || String.IsNullOrWhiteSpace(payment.Id)) throw new ArgumentException("Payment or its Id can not be blank"); }
public Payment.Filter ByCardType(Payment.CardTypes cardType) { this.cardType = cardType.ToString(); return this; }
internal Creator(Payment payment, Offer offer) { this.Payment = payment; this.Offer = offer; }
internal Creator(Payment payment, int amount, String currency, Interval.PeriodWithChargeDay interval) { Payment = payment; Amount = amount; Currency = currency; this.Interval = interval; }
public static Creator Create(Payment payment, String offerId) { return new Creator(payment, new Offer(offerId)); }
public static Creator Create(Payment payment, Offer offer) { return new Creator(payment, offer); }
public static Creator Create(Payment payment, int amount, String currency, Interval.PeriodWithChargeDay interval) { return new Creator(payment, amount, currency, interval); }