Exemple #1
1
/**
 * Payment gateway
 */
function aviators_submission_paypal_payment_gateway()
{
    $payment_gateway = aviators_settings_get_value('submission', 'common', 'payment_gateway');
    if ($payment_gateway == 'paypal') {
        require_once AVIATORS_DIR . "/libraries/paypal-digital-goods/paypal-digital-goods.class.php";
        require_once AVIATORS_DIR . "/libraries/paypal-digital-goods/paypal-configuration.class.php";
        require_once AVIATORS_DIR . "/libraries/paypal-digital-goods/paypal-purchase.class.php";
        if (aviators_settings_get_value('submission', 'paypal', 'sandbox') == 'on') {
            $username = aviators_settings_get_value('submission', 'paypal', 'sandbox_username');
            $password = aviators_settings_get_value('submission', 'paypal', 'sandbox_password');
            $signature = aviators_settings_get_value('submission', 'paypal', 'sandbox_signature');
        } else {
            $username = aviators_settings_get_value('submission', 'paypal', 'username');
            $password = aviators_settings_get_value('submission', 'paypal', 'password');
            $signature = aviators_settings_get_value('submission', 'paypal', 'signature');
            PayPal_Digital_Goods_Configuration::environment('live');
        }
        PayPal_Digital_Goods_Configuration::username($username);
        PayPal_Digital_Goods_Configuration::password($password);
        PayPal_Digital_Goods_Configuration::signature($signature);
        PayPal_Digital_Goods_Configuration::business_name(get_bloginfo('name'));
    }
}