PrintErrorPage($errorMessage);
        exit;
    }
    if ($providerConf['Debug']) {
        writeDebugLog('PayPal checkout external call', '--------------', true);
        writeDebugLog('Conf', $providerConf, false);
        writeDebugLog('GET', $_GET, false);
        writeDebugLog('POST', $_POST, false);
    }
    if ($_POST['txn_type'] == 'subscr_signup') {
        if ($providerConf['Debug']) {
            writeDebugLog('Subscription event', 'Subscription signup', false);
        }
        // do nothing as subscription already initiated
    } elseif ($_POST['txn_type'] == 'subscr_cancel') {
        if ($providerConf['Debug']) {
            writeDebugLog('Subscription event', 'Subscription cancellation', false);
        }
        cancelSubscription($_REQUEST['item_number']);
    } elseif ($_POST['txn_type'] == 'subscr_payment') {
        $res = initiateSubscriptionTransaction($_REQUEST['item_number']);
        if ($providerConf['Debug']) {
            writeDebugLog('Subscription event', "Subscription payment. Base transaction ID: {$_REQUEST['item_number']} New transaction ID: {$res}", false);
        }
        if ($res !== false) {
            moduleAcceptPayment(true, $res);
        }
    } else {
        moduleAcceptPayment(false);
    }
}
Example #2
0
function dispatcher($type)
{
    switch ($type) {
        case 'LoginAttempt':
            loginAttempt();
            break;
        case 'GetInitialCart':
            getInitialCart();
            break;
        case 'AddItemToCart':
            addItemToCart();
            break;
        case 'RemoveItemFromCart':
            removeItemFromCart();
            break;
        case 'EmptyCart':
            emptyCart();
            break;
        case 'RefreshCatalog':
            refreshCatalog();
            break;
        case 'GetGuidedSellingValues':
            getGuidedSellingValues();
            break;
        case 'ReadCatalog':
            readCatalog();
            break;
        case 'GetSubscriptions':
            getSubscriptions();
            break;
        case 'SetAmendSubId':
            setAmendSubId();
            break;
        case 'GetAmendSubscription':
            getAmendSubscription();
            break;
        case 'PreviewAddRatePlan':
            previewAddRatePlan();
            break;
        case 'AddRatePlan':
            addRatePlan();
            break;
        case 'PreviewRemoveRatePlan':
            previewRemoveRatePlan();
            break;
        case 'RemoveRatePlan':
            removeRatePlan();
            break;
        case 'PreviewUpdateRatePlan':
            previewUpdateRatePlan();
            break;
        case 'UpdateRatePlan':
            updateRatePlan();
            break;
        case 'GetUpgradeDowngradePlans':
            getUpgradeDowngradePlans();
            break;
        case 'PreviewPlanUpgradeDowngrade':
            previewPlanUpgradeDowngrade();
            break;
        case 'PlanUpgradeDowngrade':
            planUpgradeDowngrade();
            break;
        case 'PreviewRenewSubscription':
            previewRenewSubscription();
            break;
        case 'RenewSubscription':
            renewSubscription();
            break;
        case 'CancelSubscription':
            cancelSubscription();
            break;
        case 'GetAccountSummary':
            getAccountSummary();
            break;
        case 'GetContactSummary':
            getContactSummary();
            break;
        case 'GetPaymentMethodSummary':
            getPaymentMethodSummary();
            break;
        case 'GetInvoiceSummary':
            getInvoiceSummary();
            break;
        case 'GetBillingPreview':
            getBillingPreview();
            break;
        case 'GetUsageSummary':
            getUsageSummary();
            break;
        case 'GetCompleteSummary':
            getCompleteSummary();
            break;
        case 'UpdateContact':
            updateContact();
            break;
        case 'CheckEmailAvailability':
            checkEmailAvailability();
            break;
        case 'UpdatePaymentMethod':
            updatePaymentMethod();
            break;
        case 'RemovePaymentMethod':
            removePaymentMethod();
            break;
        case 'GetNewIframeSrc':
            getNewIframeSrc();
            break;
        case 'GetExistingIframeSrc':
            getExistingIframeSrc();
            break;
        case 'SubscribeWithCurrentCart':
            subscribeWithCurrentCart();
            break;
        case 'PreviewCurrentCart':
            previewCurrentCart();
            break;
        case 'IsUserLoggedIn':
            isUserLoggedIn();
            break;
            // begin new code for Partner - Ming
        // begin new code for Partner - Ming
        case 'GetHierarchy':
            getHierarchy();
            break;
        case 'GoToAccountView':
            goToAccountView();
            break;
        case 'GetAccountInfo':
            getAccountInfo();
            break;
        case 'GetSubConfirmInfo':
            getSubConfirmInfo();
            break;
        case 'IsPartnerLoggedIn':
            isPartnerLoggedIn();
            break;
            // end new code for Partner - Ming
            // HPM 2.0 begin
        // end new code for Partner - Ming
        // HPM 2.0 begin
        case 'SubscribeHPM2':
            subscribeHPM2();
            break;
            // HPM 2.0 end
            // Start Promo
        // HPM 2.0 end
        // Start Promo
        case 'PromoValidate':
            promoValidate();
            break;
            // End Promo
            // Start Set Account Data
        // End Promo
        // Start Set Account Data
        case 'SetAccountInfo':
            setAccountInfo();
            break;
            // End Set Account Data
            // Start Get Address Data
        // End Set Account Data
        // Start Get Address Data
        case 'GetAddressInfo':
            getAddressInfo();
            break;
            // End Set Account Data
            // Start Get Formatting Data
        // End Set Account Data
        // Start Get Formatting Data
        case 'GetFormatting':
            getFormatting();
            break;
            // End Set Formatting Data
        // End Set Formatting Data
        default:
            addErrors(null, 'no action specified');
    }
}