예제 #1
0
        /// <summary>
        /// Get Billing Token in exchange of Credit Card and Billing Information
        /// </summary>
        /// <param name="tokenRequest">TokenRequest containing billing information</param>
        /// <returns>TokenResponse</returns>
        public async Task <TokenResponse> get(TokenRequest tokenRequest, bool isPreProd)
        {
            try
            {
                var context = new ValidationContext(tokenRequest);
                var results = new List <ValidationResult>();

                var isValid = Validator.TryValidateObject(tokenRequest, context, results, true);

                if (!isValid)
                {
                    TokenResponse tokenResponse = new TokenResponse();
                    foreach (var validationResult in results)
                    {
                        tokenResponse.addError(new Error(string.Join(", ", validationResult.MemberNames), validationResult.ErrorMessage));
                    }
                    return(await Task.FromResult <TokenResponse>(tokenResponse));
                }
                else
                {
                    BillingGateway billingGateway = GatewayFactory.getBillingGateway(billingProvider);

                    return(await billingGateway.getBillingToken(tokenRequest, isPreProd));
                }
            }
            catch (Exception ex)
            {
                TokenResponse tokenResponse = new TokenResponse();
                tokenResponse.addError(new Error("unknown", "Unknown Exception"));
                return(tokenResponse);
            }
        }
예제 #2
0
 public YellowstonePathology.YpiConnect.Contract.Billing.BillingAccessionCollection GetBillingAccessionsByReportNo(string reportNo, YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccount webServiceAccount)
 {
     BillingGateway gateway = new BillingGateway();
     YellowstonePathology.YpiConnect.Contract.Billing.BillingAccessionCollection billingAccessionCollection = null;
     if (webServiceAccount.PrimaryClientId == 0)
     {
         billingAccessionCollection = gateway.GetBillingAccessionsByReportNo(reportNo, webServiceAccount);
     }
     else
     {
         billingAccessionCollection = gateway.GetBillingAccessionsByReportNoClient(reportNo, webServiceAccount);
     }
     return billingAccessionCollection;
 }
예제 #3
0
 public YellowstonePathology.YpiConnect.Contract.Billing.BillingAccessionCollection GetBillingAccessionsByLastNameAndFirstName(string lastName, string firstName, YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccount webServiceAccount)
 {
     BillingGateway gateway = new BillingGateway();
     YellowstonePathology.YpiConnect.Contract.Billing.BillingAccessionCollection billingAccessionCollection = null;
     if (webServiceAccount.PrimaryClientId == 0)
     {
         billingAccessionCollection = gateway.GetBillingAccessionsByLastNameAndFirstName(lastName, firstName, webServiceAccount);
     }
     else
     {
         billingAccessionCollection = gateway.GetBillingAccessionsByLastNameAndFirstNameClient(lastName, firstName, webServiceAccount);
     }
     return billingAccessionCollection;
 }
예제 #4
0
 public YellowstonePathology.YpiConnect.Contract.Billing.BillingAccessionCollection GetBillingAccessionsByBirthdate(DateTime birthdate, YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccount webServiceAccount)
 {
     BillingGateway gateway = new BillingGateway();
     YellowstonePathology.YpiConnect.Contract.Billing.BillingAccessionCollection billingAccessionCollection = null;
     if (webServiceAccount.PrimaryClientId == 0)
     {
         billingAccessionCollection = gateway.GetBillingAccessionsByBirthdate(birthdate, webServiceAccount);
     }
     else
     {
         billingAccessionCollection = gateway.GetBillingAccessionsByBirthdateClient(birthdate, webServiceAccount);
     }
     return billingAccessionCollection;
 }
예제 #5
0
 public YellowstonePathology.YpiConnect.Contract.Billing.BillingDetail GetBillingDetail(string reportNo, bool getMemoryStream, YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccount webServiceAccount)
 {
     BillingGateway gateway = new BillingGateway();
     return gateway.GetBillingDetail(reportNo, getMemoryStream, webServiceAccount);
 }