Exemple #1
0
        public static async Task <InstalmentLink> Create(
            Int64 supplierId,
            String customerEmail,
            String invoiceIdentifier,
            Decimal invoiceValue,
            CommunicationOption communication,
            Session session
            )
        {
            String emailCustomer;

            if (communication == CommunicationOption.NotifyCustomer)
            {
                emailCustomer = "true";
            }
            else
            {
                emailCustomer = "false";
            }

            String stringSupplierId   = supplierId.ToString();
            String stringInvoiceValue = Math.Round(invoiceValue, 2).ToString();

            CreatePayload payload = new CreatePayload(
                stringSupplierId,
                stringInvoiceValue,
                customerEmail,
                invoiceIdentifier,
                emailCustomer
                );

            String resultBody = await ApiRequest.Make <CreatePayload>(
                path : InstalmentLink.path,
                body : payload,
                method : HttpMethod.Post,
                session : session
                );

            var decodePayload = ApiRequest.DecodeResponse <DecodePayload>(
                resultBody
                );

            var link = new InstalmentLink(
                decodePayload.public_id,
                decodePayload.supplier,
                decodePayload.invitee_email,
                Convert.ToDecimal(decodePayload.invoice_amount),
                decodePayload.invoice_identifier
                );

            return(link);
        }
Exemple #2
0
        private static string GetCommunicationOptionLabel(CommunicationOption co)
        {
            switch (co)
            {
            case CommunicationOption.NoAil:
                return("No Ail");

            case CommunicationOption.NoJohnsons:
                return("No Johnsons");

            case CommunicationOption.NoUnionCalling:
                return("No Union Calling");

            //case CommunicationOption.NoMailouts:
            //    return "No Mailouts";
            //case CommunicationOption.NoNewsletterByEmail:
            //    return "No Newsletters by Email";
            //case CommunicationOption.NoNewsletterByMail:
            //    return "No Newsletters by Mail";
            default:
                return("Missing Label");
            }
        }
Exemple #3
0
 /// <summary>
 /// communication option
 /// </summary>
 public void SelectCommunicationOption()
 {
     CommunicationOption.Wait(3).Click();
 }