예제 #1
0
        ///<summary>Returns the full URL according to the route/route id given.</summary>
        private static string GetApiUrl(ApiRoute route)
        {
            string apiUrl = Introspection.GetOverride(Introspection.IntrospectionEntity.PayConnectRestURL, "https://payconnect.dentalxchange.com/pay/rest/PayService");

#if DEBUG
            apiUrl = "https://prelive2.dentalxchange.com/pay/rest/PayService";
#endif
            switch (route)
            {
            case ApiRoute.Root:
                //Do nothing.  This is to allow someone to quickly grab the URL without having to make a copy+paste reference.
                break;

            case ApiRoute.AccountToken:
                apiUrl += "/accountToken";
                break;

            case ApiRoute.PaymentRequest:
                apiUrl += "/paymentRequest";
                break;

            case ApiRoute.PaymentStatus:
                apiUrl += "/paymentStatus";
                break;

            default:
                break;
            }
            return(apiUrl);
        }
예제 #2
0
        ///<summary>Shows a message box on error.</summary>
        public static PayConnectService.transResponse ProcessCreditCard(PayConnectService.creditCardRequest request, long clinicNum,
                                                                        Action <string> showError)
        {
            try {
                Program prog = Programs.GetCur(ProgramName.PayConnect);
                PayConnectService.Credentials     cred = GetCredentials(prog, clinicNum);
                PayConnectService.MerchantService ms   = new PayConnectService.MerchantService();
                ms.Url = Introspection.GetOverride(Introspection.IntrospectionEntity.PayConnectRestURL, "https://webservices.dentalxchange.com/merchant/MerchantService?wsdl");
#if DEBUG
                ms.Url = "https://prelive.dentalxchange.com/merchant/MerchantService?wsdl";
#endif
                PayConnectService.transResponse response = ms.processCreditCard(cred, request);
                ms.Dispose();
                if (response.Status.code != 0 && response.Status.description.ToLower().Contains("duplicate"))
                {
                    showError(Lans.g("PayConnect", "Payment failed") + ". \r\n" + Lans.g("PayConnect", "Error message from") + " Pay Connect: \""
                              + response.Status.description + "\"\r\n"
                              + Lans.g("PayConnect", "Try using the Force Duplicate checkbox if a duplicate is intended."));
                }
                if (response.Status.code != 0 && response.Status.description.ToLower().Contains("invalid user"))
                {
                    showError(Lans.g("PayConnect", "Payment failed") + ".\r\n"
                              + Lans.g("PayConnect", "PayConnect username and password combination invalid.") + "\r\n"
                              + Lans.g("PayConnect", "Verify account settings by going to") + "\r\n"
                              + Lans.g("PayConnect", "Setup | Program Links | PayConnect. The PayConnect username and password are probably the same as the DentalXChange login ID and password."));
                }
                else if (response.Status.code != 0)               //Error
                {
                    showError(Lans.g("PayConnect", "Payment failed") + ". \r\n" + Lans.g("PayConnect", "Error message from") + " Pay Connect: \""
                              + response.Status.description + "\"");
                }
                return(response);
            }
            catch (Exception ex) {
                showError(Lans.g("PayConnect", "Payment failed") + ". \r\n" + Lans.g("PayConnect", "Error message") + ": \"" + ex.Message + "\"");
            }
            return(null);
        }
예제 #3
0
        ///<summary>Returns the full URL according to the route given.</summary>
        private string GetApiUrl(ApiRoute route)
        {
            string apiUrl = Introspection.GetOverride(Introspection.IntrospectionEntity.PDMPURL, "https://www.ilpmp.org/rxhistorySumAdp/getReport");

            if (ODBuild.IsDebug())
            {
                apiUrl = "https://openid.logicoy.com/ilpdmp/test/getReport";
            }
            switch (route)
            {
            case ApiRoute.Root:
                //Do nothing.  This is to allow someone to quickly grab the URL without having to make a copy+paste reference.
                break;

            case ApiRoute.PrescriptionSummary:
                apiUrl += "/prescriptionSummary";
                break;

            default:
                break;
            }
            return(apiUrl);
        }