Inheritance: BaseModel
Example #1
0
        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;

        }
Example #2
0
        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();
        }
Example #3
0
        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));
 }
Example #8
0
 static internal void ValidatesPayment(Payment payment)
 {
     if (payment == null || String.IsNullOrWhiteSpace(payment.Id))
         throw new ArgumentException("Payment or its Id can not be blank");
 }
Example #9
0
 public Payment.Filter ByCardType(Payment.CardTypes cardType)
 {
     this.cardType = cardType.ToString();
     return this;
 }
Example #10
0
 internal Creator(Payment payment, Offer offer)
 {
     this.Payment = payment;
     this.Offer = offer;
 }
Example #11
0
 internal Creator(Payment payment, int amount, String currency, Interval.PeriodWithChargeDay interval)
 {
     Payment = payment;
     Amount = amount;
     Currency = currency;
     this.Interval = interval;
 }
Example #12
0
        public static Creator Create(Payment payment, String offerId)
        {
            return new Creator(payment, new Offer(offerId));

        }
Example #13
0
 public static Creator Create(Payment payment, Offer offer)
 {
     return new Creator(payment, offer);
 }
Example #14
0
        public static Creator Create(Payment payment, int amount, String currency, Interval.PeriodWithChargeDay interval)
        {
            return new Creator(payment, amount, currency, interval);

        }