Example #1
0
 *      You should have received a copy of the GNU Affero General Public
 * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (Params::getParam('plugin_action') == 'done') {
    osc_set_preference('default_premium_cost', Params::getParam("default_premium_cost") ? Params::getParam("default_premium_cost") : '1.0', 'payment', 'STRING');
    osc_set_preference('allow_premium', Params::getParam("allow_premium") ? Params::getParam("allow_premium") : '0', 'payment', 'BOOLEAN');
    osc_set_preference('default_publish_cost', Params::getParam("default_premium_cost") ? Params::getParam("default_publish_cost") : '1.0', 'payment', 'STRING');
    osc_set_preference('pay_per_post', Params::getParam("pay_per_post") ? Params::getParam("pay_per_post") : '0', 'payment', 'BOOLEAN');
    osc_set_preference('premium_days', Params::getParam("premium_days") ? Params::getParam("premium_days") : '7', 'payment', 'INTEGER');
    osc_set_preference('currency', Params::getParam("currency") ? Params::getParam("currency") : 'USD', 'payment', 'STRING');
    osc_set_preference('pack_price_1', Params::getParam("pack_price_1"), 'payment', 'STRING');
    osc_set_preference('pack_price_2', Params::getParam("pack_price_2"), 'payment', 'STRING');
    osc_set_preference('pack_price_3', Params::getParam("pack_price_3"), 'payment', 'STRING');
    osc_set_preference('paypal_api_username', payment_crypt(Params::getParam("paypal_api_username")), 'payment', 'STRING');
    osc_set_preference('paypal_api_password', payment_crypt(Params::getParam("paypal_api_password")), 'payment', 'STRING');
    osc_set_preference('paypal_api_signature', payment_crypt(Params::getParam("paypal_api_signature")), 'payment', 'STRING');
    osc_set_preference('paypal_email', Params::getParam("paypal_email"), 'payment', 'STRING');
    osc_set_preference('paypal_standard', Params::getParam("paypal_standard") ? Params::getParam("paypal_standard") : '0', 'payment', 'BOOLEAN');
    osc_set_preference('paypal_sandbox', Params::getParam("paypal_sandbox") ? Params::getParam("paypal_sandbox") : '0', 'payment', 'BOOLEAN');
    osc_set_preference('paypal_enabled', Params::getParam("paypal_enabled") ? Params::getParam("paypal_enabled") : '0', 'payment', 'BOOLEAN');
    /*osc_set_preference('blockchain_btc_address', Params::getParam("blockchain_btc_address") ? Params::getParam("blockchain_btc_address") : '', 'payment', 'STRING');
            osc_set_preference('blockchain_enabled', Params::getParam("blockchain_enabled") ? Params::getParam("blockchain_enabled") : '0', 'payment', 'BOOLEAN');
    
            osc_set_preference('braintree_merchant_id', payment_crypt(Params::getParam("braintree_merchant_id")), 'payment', 'STRING');
            osc_set_preference('braintree_public_key', payment_crypt(Params::getParam("braintree_public_key")), 'payment', 'STRING');
            osc_set_preference('braintree_private_key', payment_crypt(Params::getParam("braintree_private_key")), 'payment', 'STRING');
            osc_set_preference('braintree_encryption_key', payment_crypt(Params::getParam("braintree_encryption_key")), 'payment', 'STRING');
            osc_set_preference('braintree_sandbox', (Params::getParam("braintree_sandbox") == 'sandbox') ? 'sandbox' : 'production', 'payment', 'STRING');
            osc_set_preference('braintree_enabled', Params::getParam("braintree_enabled") ? Params::getParam("braintree_enabled") : '0', 'payment', 'BOOLEAN');*/
    // HACK : This will make possible use of the flash messages ;)
    ob_get_clean();
Example #2
0
 public function install()
 {
     $this->import('payment/struct.sql');
     osc_set_preference('version', '200', 'payment', 'INTEGER');
     osc_set_preference('default_premium_cost', '1.0', 'payment', 'STRING');
     osc_set_preference('allow_premium', '0', 'payment', 'BOOLEAN');
     osc_set_preference('default_publish_cost', '1.0', 'payment', 'STRING');
     osc_set_preference('pay_per_post', '0', 'payment', 'BOOLEAN');
     osc_set_preference('premium_days', '7', 'payment', 'INTEGER');
     osc_set_preference('currency', 'USD', 'payment', 'STRING');
     osc_set_preference('pack_price_1', '', 'payment', 'STRING');
     osc_set_preference('pack_price_2', '', 'payment', 'STRING');
     osc_set_preference('pack_price_3', '', 'payment', 'STRING');
     osc_set_preference('paypal_api_username', payment_crypt(''), 'payment', 'STRING');
     osc_set_preference('paypal_api_password', payment_crypt(''), 'payment', 'STRING');
     osc_set_preference('paypal_api_signature', payment_crypt(''), 'payment', 'STRING');
     osc_set_preference('paypal_email', '', 'payment', 'STRING');
     osc_set_preference('paypal_standard', '1', 'payment', 'BOOLEAN');
     osc_set_preference('paypal_sandbox', '1', 'payment', 'BOOLEAN');
     osc_set_preference('paypal_enabled', '0', 'payment', 'BOOLEAN');
     osc_set_preference('blockchain_btc_address', '', 'payment', 'STRING');
     osc_set_preference('blockchain_enabled', '0', 'payment', 'BOOLEAN');
     osc_set_preference('braintree_merchant_id', payment_crypt(''), 'payment', 'STRING');
     osc_set_preference('braintree_public_key', payment_crypt(''), 'payment', 'STRING');
     osc_set_preference('braintree_private_key', payment_crypt(''), 'payment', 'STRING');
     osc_set_preference('braintree_encryption_key', payment_crypt(''), 'payment', 'STRING');
     osc_set_preference('braintree_sandbox', 'sandbox', 'payment', 'STRING');
     osc_set_preference('braintree_enabled', '0', 'payment', 'BOOLEAN');
     $this->dao->select('pk_i_id');
     $this->dao->from(DB_TABLE_PREFIX . 't_item');
     $result = $this->dao->get();
     if ($result) {
         $items = $result->result();
         $date = date("Y-m-d H:i:s");
         foreach ($items as $item) {
             $this->createItem($item['pk_i_id'], 1, $date);
         }
     }
     $description[osc_language()]['s_title'] = '{WEB_TITLE} - Publish option for your ad: {ITEM_TITLE}';
     $description[osc_language()]['s_text'] = '<p>Hi {CONTACT_NAME}!</p><p>We just published your item ({ITEM_TITLE}) on {WEB_TITLE}.</p><p>{START_PUBLISH_FEE}</p><p>In order to make your ad available to anyone on {WEB_TITLE}, you should complete the process and pay the publish fee. You could do that on the following link: {PUBLISH_LINK}</p><p>{END_PUBLISH_FEE}</p><p>{START_PREMIUM_FEE}</p><p>You could make your ad premium and make it to appear on top result of the searches made on {WEB_TITLE}. You could do that on the following link: {PREMIUM_LINK}</p><p>{END_PREMIUM_FEE}</p><p>This is an automatic email, if you already did that, please ignore this email.</p><p>Thanks</p>';
     $res = Page::newInstance()->insert(array('s_internal_name' => 'email_payment', 'b_indelible' => '1'), $description);
 }
Example #3
0
    osc_set_preference('braintree_private_key', payment_crypt(Params::getParam("braintree_private_key")), 'payment', 'STRING');
    osc_set_preference('braintree_encryption_key', payment_crypt(Params::getParam("braintree_encryption_key")), 'payment', 'STRING');
    osc_set_preference('braintree_sandbox', Params::getParam("braintree_sandbox") == 'sandbox' ? 'sandbox' : 'production', 'payment', 'STRING');
    osc_set_preference('braintree_enabled', Params::getParam("braintree_enabled") ? Params::getParam("braintree_enabled") : '0', 'payment', 'BOOLEAN');
    osc_set_preference('stripe_secret_key', payment_crypt(Params::getParam("stripe_secret_key")), 'payment', 'STRING');
    osc_set_preference('stripe_public_key', payment_crypt(Params::getParam("stripe_public_key")), 'payment', 'STRING');
    osc_set_preference('stripe_secret_key_test', payment_crypt(Params::getParam("stripe_secret_key_test")), 'payment', 'STRING');
    osc_set_preference('stripe_public_key_test', payment_crypt(Params::getParam("stripe_public_key_test")), 'payment', 'STRING');
    osc_set_preference('stripe_sandbox', Params::getParam("stripe_sandbox") ? Params::getParam("stripe_sandbox") : '0', 'payment', 'BOOLEAN');
    osc_set_preference('stripe_enabled', Params::getParam("stripe_enabled") ? Params::getParam("stripe_enabled") : '0', 'payment', 'BOOLEAN');
    osc_set_preference('coinjar_merchant_user', payment_crypt(Params::getParam("coinjar_merchant_user")), 'payment', 'STRING');
    osc_set_preference('coinjar_merchant_password', payment_crypt(Params::getParam("coinjar_merchant_password")), 'payment', 'STRING');
    osc_set_preference('coinjar_api_key', payment_crypt(Params::getParam("coinjar_api_key")), 'payment', 'STRING');
    osc_set_preference('coinjar_sb_merchant_user', payment_crypt(Params::getParam("coinjar_sb_merchant_user")), 'payment', 'STRING');
    osc_set_preference('coinjar_sb_merchant_password', payment_crypt(Params::getParam("coinjar_sb_merchant_password")), 'payment', 'STRING');
    osc_set_preference('coinjar_sb_api_key', payment_crypt(Params::getParam("coinjar_sb_api_key")), 'payment', 'STRING');
    osc_set_preference('coinjar_merchant_reference', Params::getParam("coinjar_merchant_reference"), 'payment', 'STRING');
    osc_set_preference('coinjar_sandbox', Params::getParam("coinjar_sandbox") ? Params::getParam("coinjar_sandbox") : '0', 'payment', 'BOOLEAN');
    osc_set_preference('coinjar_enabled', Params::getParam("coinjar_enabled") ? Params::getParam("coinjar_enabled") : '0', 'payment', 'BOOLEAN');
    // HACK : This will make possible use of the flash messages ;)
    ob_get_clean();
    osc_add_flash_ok_message(__('Congratulations, the plugin is now configured', 'payment'), 'admin');
    osc_redirect_to(osc_route_admin_url('payment-admin-conf'));
}
?>

<script type="text/javascript" >
    $(document).ready(function(){
        $("#dialog-paypal").dialog({
            autoOpen: false,
            modal: true,