Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Method" /> class.
 /// </summary>
 /// <param name="methodType">Unique ID for the payment method type. (required).</param>
 /// <param name="methodId">The unique ID of this payment method if it was previously registered with a registration/method or if it is currently being registered. Must be unique for the entire system (not just within a specific merchant or industry). Mandatory if being used inside a registration/method..</param>
 /// <param name="methodAlias">The address that should be used to send billing information for this payment method..</param>
 /// <param name="card">card (required).</param>
 /// <param name="provider">The wallet provider. This field should be normalized before sending through the API..</param>
 /// <param name="userDefined">A JSON object that can carry any additional information about the method that might be helpful for fraud detection..</param>
 public Method(MethodTypeEnum methodType = default(MethodTypeEnum), string methodId = default(string), string methodAlias = default(string), Card card = default(Card), string provider = default(string), Object userDefined = default(Object))
 {
     this.MethodType = methodType;
     // to ensure "card" is required (not null)
     this.Card        = card ?? throw new ArgumentNullException("card is a required property for Method and cannot be null");
     this.MethodId    = methodId;
     this.MethodAlias = methodAlias;
     this.Provider    = provider;
     this.UserDefined = userDefined;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RegistrationMethod" /> class.
 /// </summary>
 /// <param name="methodType">Unique ID for the payment method type. (required).</param>
 /// <param name="methodId">The unique ID of this payment method if it was previously registered with a registration/method or if it is currently being registered. Must be unique for the entire system (not just within a specific merchant or industry). Mandatory if being used inside a registration/method..</param>
 /// <param name="userDefined">A JSON object that carries any additional information that might be helpful for fraud detection..</param>
 /// <param name="billingPhoneNumber">The address that should be used to send billing information for this payment method..</param>
 /// <param name="methodAlias">The address that should be used to send billing information for this payment method..</param>
 /// <param name="card">card (required).</param>
 /// <param name="methodAddress">methodAddress.</param>
 public RegistrationMethod(MethodTypeEnum methodType = default(MethodTypeEnum), string methodId = default(string), Object userDefined = default(Object), string billingPhoneNumber = default(string), string methodAlias = default(string), FraudRegistrationCard card = default(FraudRegistrationCard), FraudAddress methodAddress = default(FraudAddress))
 {
     this.MethodType = methodType;
     // to ensure "card" is required (not null)
     this.Card               = card ?? throw new ArgumentNullException("card is a required property for RegistrationMethod and cannot be null");
     this.MethodId           = methodId;
     this.UserDefined        = userDefined;
     this.BillingPhoneNumber = billingPhoneNumber;
     this.MethodAlias        = methodAlias;
     this.MethodAddress      = methodAddress;
 }
Exemplo n.º 3
0
        public static IAmortizationScheduleDomain GetAmortizationScheduleInstance(this MethodTypeEnum method, IAmortizationScheduleService dependenceInjection)
        {
            switch (method)
            {
            case MethodTypeEnum.French:
                return(new AmortizationScheduleFrenchDomain(dependenceInjection));

            case MethodTypeEnum.Germany:
                return(new AmortizationScheduleGermanyDomain(dependenceInjection));

            case MethodTypeEnum.Mexican:
                return(new AmortizationScheduleMexicanDomain(dependenceInjection));

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 4
0
        public async Task <string> CallAsync(string method, string Request, MethodTypeEnum MethodType, string token)
        {
            HttpRequestMessage http = new HttpRequestMessage();

            http.Method     = new HttpMethod(MethodType.ToString());
            http.RequestUri = new Uri(_options.ApiUrl + method);
            http.Content    = new StringContent(Request);
            http.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(_options.ContentType);
            HttpClient connect = new HttpClient();

            if (token != null)
            {
                connect.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _options.AuthanticationKey);
            }
            var response = await connect.SendAsync(http);

            var responseString = response.Content.ReadAsStringAsync();

            return(responseString.Result);
        }
        /// <summary>
        /// This method returns a MethodTypeEnum for the string given.
        /// </summary>
        /// <param name="methodTypeSource"></param>
        /// <returns></returns>
        public static MethodTypeEnum ParseMethodType(string methodTypeSource)
        {
            // initial value
            MethodTypeEnum methodType = MethodTypeEnum.Unknown;

            // determine MethodType for each case
            switch (methodTypeSource)
            {
            case "Delete By":
            case "Delete_By":

                // set methodType
                methodType = MethodTypeEnum.Delete_By;

                // required
                break;

            case "Find By":
            case "Find_By":

                // set methodType
                methodType = MethodTypeEnum.Find_By;

                // required
                break;

            case "Load By":
            case "Load_By":

                // set methodType
                methodType = MethodTypeEnum.Load_By;

                // required
                break;
            }

            // return value
            return(methodType);
        }
 public AmortizationScheduleDomain(IAmortizationScheduleService dependenceInjection, MethodTypeEnum method)
 {
     AmortizationScheduleContract = method.GetAmortizationScheduleInstance(dependenceInjection);
 }