public Payment(string name, double value, TypePayment payment)
 {
     this.payment = payment;
     this.name    = this.payment.AddPayment(name);
     this.value   = value;
     this.confirm = false;
 }
Esempio n. 2
0
 public Contract(string contractid, string licensePlates, Customer customer, string startDate, string endDate, int cost, string payments, TypePayment typepayment, TypeRent typeRent)
 {
     this.contractid    = contractid;
     this.licensePlates = licensePlates;
     this.customer      = customer;
     this.startDate     = startDate;
     this.endDate       = endDate;
     this.cost          = cost;
     this.payments      = payments;
     this.typepayment   = typepayment;
     this.typeRent      = typeRent;
 }
Esempio n. 3
0
        public static Payment GetPayment(TypePayment typePayment)
        {
            switch (typePayment)
            {
            case TypePayment.CARD:
                return(new CardPayment());

            case TypePayment.PAYPAL:
                return(new PayPalPayment());

            case TypePayment.TRANSFER:
                return(new WireTransferPayment());

            default:
                return(new CardPayment());
            }
        }
Esempio n. 4
0
 public MainPayment(TypePayment typePayment)
 {
     payment = FactoryPayment.GetPayment(typePayment);
 }
 public void SetType(TypePayment pType)
 {
     typePayment = pType;
 }
        /// <summary>
        /// Insert or update customer billing address
        /// </summary>
        /// <param name="settings">Inserted/updated settings</param>
        /// <param name="referenceCustomer">(mandatory) the customer reference</param>
        /// <param name="typePayment">(optional) the payment type</param>
        /// <param name="dateNextBilling">(optional) next billing date. If null, the customer won't be billed until the next time he subscribes.</param>
        public virtual RequestReport SaveCustomerPaymentSettings(out SettingsPayment settings, object referenceCustomer, TypePayment typePayment, DateTime?dateNextBilling)
        {
            settings = null;

            // create the request
            RequestFluent request;
            var           result = this.CreateRequest(out request, EndpointsV1.CustomerSettingsPayment);

            // if succeeded
            if (result.IsSuccess())
            {
                // append all parameters
                request
                .AddUrlParameter(EndpointParametersV1.ReferenceCustomer, this.ToString(referenceCustomer));

                // build the address to send
                var addressToSend = new SettingsPayment
                {
                    TypePayment     = typePayment,
                    DateNextBilling = dateNextBilling
                };

                // send the request
                var response = this.Send(request, addressToSend);

                // handle the response
                result = this.HandleResponse(out settings, response);
            }
            return(result);
        }