protected static Types.Payment PaymentJsonHelperToPayment(PaymentJsonHelper helper)
        {
            string batchId = null;

            if (helper.Batch != null)
            {
                batchId = helper.Batch.Id;
            }
            Types.Recipient recipient = RecipientJsonHelperToRecipient(helper.Recipient);

            Types.Payment payment = new Types.Payment(recipient, helper.SourceAmount, helper.SourceCurrency, helper.TargetAmount, helper.TargetCurrency, helper.Id, helper.Memo, helper.ExchangeRate, helper.Fees, helper.RecipientFees, helper.FxRate, helper.ProcessedAt, helper.CreatedAt, helper.UpdatedAt, helper.MerchantFees, batchId, helper.Status, helper.Compliance);
            return(payment);
        }
        protected static Types.Recipient RecipientJsonHelperToRecipient(RecipientJsonHelper helper)
        {
            List <Types.RecipientAccount> accounts = null;

            if (helper.Accounts != null)
            {
                accounts = new List <Types.RecipientAccount>();
                foreach (Types.RecipientAccount p in helper.Accounts)
                {
                    accounts.Add(p);
                }
            }

            Types.Recipient recipient = new Types.Recipient(helper.Type, helper.Email, helper.Name, helper.FirstName, helper.LastName, helper.Id, helper.ReferenceId, helper.Status, helper.TimeZone, helper.Language, helper.Dob, helper.GravatarUrl, helper.Compliance, accounts, helper.Address);
            return(recipient);
        }