/// <summary> /// Mark an application as cancelled and notify the underwriter, /// only possible if application is /// DRAFT, /// REFERRED, /// INFO-NEEDED, /// ACTION-CUSTOMER, /// ACTION-RETAILER, /// ACTION-LENDER, /// ACCEPTED, /// DEPOSIT-PAID, /// PARTIALLY-ACTIVATED, /// SIGNED. /// </summary> /// <param name="applicationId"></param> /// <param name="amount"></param> /// <param name="reference"></param> /// <param name="comment"></param> /// <param name="products"></param> public DividoCancellationResponse Cancellation(string applicationId, decimal amount, string reference, string comment, List <DividoProduct> products) { Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("application", applicationId); parameters.Add("amount", amount.ToString()); parameters.Add("reference", reference); parameters.Add("comment", comment); PostDataCalculator.Merge(ref parameters, new List <IConvertibleToPostData>(products), "products"); return(Requestor.Post <DividoCancellationResponse>("cancellation", parameters)); }
/// <summary> /// Finalize an existing accepted credit application, /// will update the loan agreement and return an url to the contract signing. /// This only applies to Credit Requests created directSign = false. /// </summary> /// <param name="applicationId"></param> /// <param name="deposit"></param> /// <param name="financeId"></param> /// <param name="amount"></param> /// <param name="products"></param> /// <param name="redirectUrl"></param> public DividoFinalizeCreditRequestResponse FinalizeCreditRequest(string applicationId, decimal deposit, string financeId, decimal amount, List <DividoProduct> products, string redirectUrl) { Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("application", applicationId); parameters.Add("deposit", deposit.ToString()); parameters.Add("finance", financeId.ToString()); parameters.Add("amount", amount.ToString()); parameters.Add("redirectUrl", redirectUrl); PostDataCalculator.Merge(ref parameters, new List <IConvertibleToPostData>(products), "products"); return(Requestor.Post <DividoFinalizeCreditRequestResponse>("creditrequest/finalize", parameters)); }
/// <summary> /// /// Activate whole or part of an application and initialise a payout from the underwriter. /// Activate part of the application by specifing the products that should be activated. /// If no product data is submitted, the whole application will be activated. /// </summary> /// <param name="applicationId"></param> /// <param name="amount"></param> /// <param name="deliveryMethod"></param> /// <param name="trackingNumber"></param> /// <param name="reference"></param> /// <param name="comment"></param> /// <param name="products"></param> public DividoActivationResponse Activation(string applicationId, decimal amount, string deliveryMethod, string trackingNumber, string reference, string comment, List <DividoProduct> products = null) { Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("application", applicationId); parameters.Add("amount", amount.ToString()); parameters.Add("deliveryMethod", deliveryMethod); parameters.Add("trackingNumber", trackingNumber); parameters.Add("reference", reference); parameters.Add("comment", comment); if (products != null) { PostDataCalculator.Merge(ref parameters, new List <IConvertibleToPostData>(products), "products"); } return(Requestor.Post <DividoActivationResponse>("activation", parameters)); }
Dictionary <string, string> IConvertibleToPostData.GetPostKeys() { Dictionary <string, string> values = new Dictionary <string, string>(); values.Add("firstName", FirstName); values.Add("middleNames", MiddleNames); values.Add("lastName", LastName); values.Add("country", Country); values.Add("gender", Gender); values.Add("email", Email); values.Add("phoneNumber", PhoneNumber); values.Add("dateOfBirthYear", DateOfBirthYear.ToString()); values.Add("dateOfBirthMonth", DateOfBirthMonth.ToString()); values.Add("dateOfBirthDay", DateOfBirthDay.ToString()); PostDataCalculator.Merge(ref values, Bank, "bank"); PostDataCalculator.Merge(ref values, ShippingAddress, "shippingAddress"); PostDataCalculator.Merge(ref values, BillingAddress, "address"); return(values); }
/// <summary> /// The credit request creates a new proposal and return a URL to the Divido application form. /// </summary> /// <param name="deposit"></param> /// <param name="financeId"></param> /// <param name="countryCode"></param> /// <param name="language"></param> /// <param name="totalAmount"></param> /// <param name="reference"></param> /// <param name="currency"></param> /// <param name="customer"></param> /// <param name="products"></param> /// <param name="directSign"></param> /// <param name="responseUrl"></param> /// <param name="checkoutUrl"></param> /// <param name="redirectUrl"></param> public DividoCreditRequestResponse CreditRequest(decimal deposit, string financeId, string countryCode, string language, decimal totalAmount, string reference, string currency, DividoCustomer customer, List <DividoProduct> products, bool directSign = true, string responseUrl = null, string checkoutUrl = null, string redirectUrl = null) { Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("deposit", deposit.ToString()); parameters.Add("finance", financeId); parameters.Add("directSign", directSign.ToString()); parameters.Add("country", countryCode); parameters.Add("language", language); parameters.Add("currency", currency); parameters.Add("amount", totalAmount.ToString()); parameters.Add("reference", reference); PostDataCalculator.Merge(ref parameters, customer, "customer"); PostDataCalculator.Merge(ref parameters, new List <IConvertibleToPostData>(products), "products"); parameters.Add("responseUrl", responseUrl); parameters.Add("checkoutUrl", checkoutUrl); parameters.Add("redirectUrl", redirectUrl); return(Requestor.Post <DividoCreditRequestResponse>("creditrequest", parameters)); }