コード例 #1
0
        public String ProcessAutoBillGetGatewayStatus(int OriginalRecurringOrderNumber, out String RecurringSubscriptionID, out DateTime StartDate, out DateTime NextPaymentDate, out decimal AggregateAmount, out String RecurringStatus, out String LatestPaymentIdentifier, out DateTime EndingDate)
        {
            // retry a payment for the current billing period after the gateway auto-bill attempt failed
            String Status = AppLogic.ro_OK;
            String GW     = AppLogic.ActivePaymentGatewayCleaned();

            RecurringSubscriptionID = AppLogic.GetRecurringSubscriptionIDFromOrder(OriginalRecurringOrderNumber);
            StartDate               = DateTime.MinValue;
            NextPaymentDate         = DateTime.MinValue;
            AggregateAmount         = 0.0M;
            RecurringStatus         = String.Empty;
            LatestPaymentIdentifier = String.Empty;
            EndingDate              = DateTime.MinValue;

            if (RecurringSubscriptionID.Length != 0)
            {
                if (GW == Gateway.ro_GWPAYFLOWPRO)
                {
                    Status = PayFlowProController.RecurringBillingInquiry(RecurringSubscriptionID, out StartDate, out NextPaymentDate, out AggregateAmount, out RecurringStatus, out LatestPaymentIdentifier, out EndingDate);
                }
                else
                {
                    Status = "Invalid Gateway";
                }
            }
            return(Status);
        }
コード例 #2
0
        public String ProcessAutoBillGetAdminButtons(int OriginalRecurringOrderNumber, out bool ShowCancelButton, out bool ShowRetryButton, out bool ShowRestartButton, out String GatewayStatus)
        {
            String result = AppLogic.ro_OK;

            // These are the default values that will be returned for gateways
            // that don't support getting realtime status.
            ShowCancelButton  = true;
            ShowRetryButton   = false;
            ShowRestartButton = false;
            GatewayStatus     = String.Empty;

            DateTime StartDate               = DateTime.MinValue;
            DateTime NextPaymentDate         = DateTime.MinValue;
            Decimal  AggregateAmount         = 0.0M;
            String   RecurringStatus         = String.Empty;
            String   LatestPaymentIdentifier = String.Empty;
            DateTime EndingDate              = DateTime.MinValue;

            String GW = AppLogic.ActivePaymentGatewayCleaned();
            String RecurringSubscriptionID = AppLogic.GetRecurringSubscriptionIDFromOrder(OriginalRecurringOrderNumber);

            if (RecurringSubscriptionID.Length != 0)
            {
                if (GW == Gateway.ro_GWPAYFLOWPRO)
                {
                    result = PayFlowProController.RecurringBillingInquiry(RecurringSubscriptionID, out StartDate, out NextPaymentDate, out AggregateAmount, out RecurringStatus, out LatestPaymentIdentifier, out EndingDate);

                    if (result == AppLogic.ro_OK)
                    {
                        GatewayStatus = "Payflow Gateway Status: " + RecurringStatus;

                        switch (RecurringStatus)
                        {
                        case "VENDOR INACTIVE":
                            ShowCancelButton  = false;
                            ShowRetryButton   = false;
                            ShowRestartButton = false;
                            break;

                        case "DEACTIVATED BY MERCHANT":
                            ShowCancelButton  = false;
                            ShowRetryButton   = false;
                            ShowRestartButton = true;
                            break;

                        case "EXPIRED":
                            ShowCancelButton  = false;
                            ShowRetryButton   = false;
                            ShowRestartButton = true;
                            break;

                        case "TOO MANY FAILURES":
                            ShowCancelButton  = false;
                            ShowRetryButton   = true;
                            ShowRestartButton = true;
                            break;

                        case "ACTIVE":
                            ShowCancelButton  = true;
                            ShowRetryButton   = false;
                            ShowRestartButton = false;
                            break;

                        case "RETRYING CURRENT PAYMENT":
                            ShowCancelButton  = true;
                            ShowRetryButton   = true;
                            ShowRestartButton = false;
                            break;
                        }
                    }
                }
            }
            return(result);
        }