diff --git a/wordpress/.htaccess b/wordpress/.htaccess index 327d62ec2586a4b92b221e501366724963d4068e..86653efa26f2f2f291b9f5e0adaf8e4a37d88f88 100644 --- a/wordpress/.htaccess +++ b/wordpress/.htaccess @@ -11,6 +11,14 @@ # END W3TC Browser Cache # BEGIN WordPress + +RewriteEngine On +RewriteBase / +RewriteRule ^index\.php$ - [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule . /index.php [L] + RewriteEngine On diff --git a/wordpress/wp-content/plugins/idcommerce/css/style.css b/wordpress/wp-content/plugins/idcommerce/css/style.css index 77f42ca388785d89a614157bcd0fa51c9b3910c8..14d06d45f9263171f6cd9d3e095b3dc0c89f70d8 100644 --- a/wordpress/wp-content/plugins/idcommerce/css/style.css +++ b/wordpress/wp-content/plugins/idcommerce/css/style.css @@ -261,10 +261,6 @@ margin: 0 auto; text-align: center; } .md-requiredlogin.login-form { - border-radius: 3px; - background: rgba(236, 236, 236, 0.35); - padding: 20px; - width: 75%; max-width: 650px; margin: 10px auto; margin-bottom: 10px !important; @@ -273,7 +269,6 @@ .md-requiredlogin #loginform { background: transparent; border: none; - margin: 0 auto; box-shadow: none; width: 240px; } .md-requiredlogin #loginform p { diff --git a/wordpress/wp-content/plugins/idcommerce/js/idcommerce.js b/wordpress/wp-content/plugins/idcommerce/js/idcommerce.js index dddf8fe8d23557334c9c4e02e9e9bc9132fdf488..dafcda0eadf3986860c2ee45741bddf6b8ad6e70 100644 --- a/wordpress/wp-content/plugins/idcommerce/js/idcommerce.js +++ b/wordpress/wp-content/plugins/idcommerce/js/idcommerce.js @@ -144,6 +144,7 @@ jQuery(document).ready(function() { jQuery("#payment-form #id-main-submit").text(idc_localization_strings.complete_checkout); jQuery("#payment-form #finaldescStripe").show(); jQuery("#payment-form #finaldescCoinbase").hide(); + jQuery("#payment-form #finaldescMc").hide(); jQuery(".card-number, .card-cvc, card-expiry-month, card-expiry-year").addClass("required"); if (idset != '1') { jQuery("#payment-form #stripe-input").show(); @@ -204,6 +205,7 @@ jQuery(document).ready(function() { jQuery("#id-main-submit").text("Complete Checkout"); jQuery(".pay_selector").removeClass('active'); jQuery(this).addClass("active"); + jQuery("#finaldescMc").hide(); jQuery("#finaldescStripe").show(); jQuery("#finaldescPayPal").hide(); jQuery("#finaldescCredits").hide(); @@ -259,6 +261,7 @@ jQuery(document).ready(function() { jQuery(".pay_selector").removeClass('active'); jQuery(this).addClass("active"); jQuery("#finaldescPayPal").show(); + jQuery("#finaldescMc").hide(); jQuery("#finaldescStripe").hide(); jQuery("#finaldescCredits").hide(); jQuery("#finaldescCoinbase").hide(); @@ -303,6 +306,7 @@ jQuery(document).ready(function() { jQuery("#id-main-submit").text("Complete Checkout"); jQuery(".pay_selector").removeClass('active'); jQuery(this).addClass("active"); + jQuery("#finaldescMc").show(); jQuery("#finaldescStripe").hide(); jQuery("#finaldescPayPal").hide(); jQuery("#finaldescCredits").hide(); @@ -479,12 +483,14 @@ jQuery(document).ready(function() { jQuery('#payment-form').hide(); jQuery('.disclaimer').hide(); jQuery('.login-form').show(); + jQuery('#logged-input').hide(); }); jQuery('.hide-login').click(function(e) { e.preventDefault(); jQuery('#payment-form').show(); jQuery('.disclaimer').show(); jQuery('.login-form').hide(); + jQuery('#logged-input').show(); }); jQuery('.reveal-account').click(function(e) { e.preventDefault(); @@ -512,7 +518,10 @@ jQuery(document).ready(function() { var lname = jQuery(".last-name").val(); var email = jQuery("#payment-form .email").val(); var is_terms = ((jQuery('.idc-terms-checkbox').length > 0) ? true : false); + var is_promissory = ((jQuery('.idc-promissory-checkbox').length > 0) ? true : false); + var terms_checked = ((jQuery('.idc-terms-checkbox').length > 0) ? jQuery('.terms-checkbox-input').is(':checked') : ''); + var promissory_checked = ((jQuery('.idc-promissory-checkbox').length > 0) ? jQuery('.promissory-checkbox-input').is(':checked') : ''); var pw = jQuery(".pw").val(); var cpw = jQuery(".cpw").val(); @@ -526,7 +535,7 @@ jQuery(document).ready(function() { var error = true; } else if (fname.length < 1 || lname.length < 1 || pw.length < 5 || validateEmail(email) == false) { - jQuery(".payment-errors").append("Please complete all fields and ensure password 5+ characters."); + jQuery(".payment-errors").text("Please complete all fields and ensure password 5+ characters."); jQuery("#id-main-submit").removeAttr("disabled"); jQuery("#id-main-submit").text("Continue"); var error = true; @@ -534,7 +543,7 @@ jQuery(document).ready(function() { } else { if (fname.length < 1 || lname.length < 1 || validateEmail(email) == false) { - jQuery(".payment-errors").append("Please complete all fields."); + jQuery(".payment-errors").text("Please complete all fields."); jQuery("#id-main-submit").removeAttr("disabled"); jQuery("#id-main-submit").text("Continue"); var error = true; @@ -553,6 +562,16 @@ jQuery(document).ready(function() { } } + if(is_promissory && !jQuery('#pay-with-stripe').hasClass('active')) { + if(!promissory_checked) { + var promissory_message = jQuery('#idc-hdn-error-promissory').val(); + jQuery(".payment-errors").text("Please read our " + promissory_message); + jQuery("#id-main-submit").removeAttr("disabled"); + jQuery("#id-main-submit").text("Continue"); + var error = true; + } + } + if (error) { return false; } diff --git a/wordpress/wp-content/themes/backer/functions.php b/wordpress/wp-content/themes/backer/functions.php index d3d8e375810f4bd7db271e2596d05b22c5eb7517..8e2c2ad7989aec79423cc1aa610e8f3df78361ae 100644 --- a/wordpress/wp-content/themes/backer/functions.php +++ b/wordpress/wp-content/themes/backer/functions.php @@ -32,6 +32,7 @@ include( 'includes/metaboxes.php' ); include( 'includes/plugins.php' ); include( 'includes/widget.php' ); include( 'includes/ignitiondeck-functions.php' ); +include( 'includes/idcommerce-shortcodes.php' ); if ( ! function_exists( 'aq_resize' ) ) { include( 'includes/aq_resizer.php' ); diff --git a/wordpress/wp-content/themes/backer/includes/idcommerce-shortcodes.php b/wordpress/wp-content/themes/backer/includes/idcommerce-shortcodes.php new file mode 100644 index 0000000000000000000000000000000000000000..18449e94edbd4681b888eebb774ed05ee1e0160e --- /dev/null +++ b/wordpress/wp-content/themes/backer/includes/idcommerce-shortcodes.php @@ -0,0 +1,297 @@ + 0) { + if ($global_currency == 'BTC' || $global_currency == 'credits') { + $pwyw_price = sprintf('%f', floatval($_GET['price'])); + } + else { + $pwyw_price = floatval(esc_attr($_GET['price'])); + } + } + else if (isset($_POST['price']) && $_POST['price'] > 0) { + if ($global_currency == 'BTC' || $global_currency == 'credits') { + $pwyw_price = sprintf('%f', floatval($_POST['price'])); + } + else { + $pwyw_price = floatval(esc_attr($_POST['price'])); + } + } + } + + if (isset($_GET['level']) && $_GET['level'] > 0) { + $payment_level = $_GET['level']; + } else { + $payment_level = 1; + } + + // get the user info + if (is_user_logged_in()) { + global $current_user; + get_currentuserinfo(); + $email = $current_user->user_email; + $fname = $current_user->user_firstname; + $lname = $current_user->user_lastname; + $member = new ID_Member($current_user->ID); + $user_data = ID_Member::user_levels($current_user->ID); + if (!empty($user_data)) { + $user_levels = unserialize($user_data->access_level); + } + else { + $user_levels = null; + } + // lets see how many levels this user owns + if (is_array($user_levels)) { + foreach ($user_levels as $level) { + if ($level == $product_id) { + $renewable = ID_Member_Level::is_level_renewable($level); + if (!$renewable) { + $already_valid = true; + } + } + } + } + } + $settings = get_option('md_receipt_settings'); + if (!empty($settings)) { + if (!is_array($settings)) { + $settings = unserialize($settings); + } + $coname = $settings['coname']; + $guest_checkout = $settings['guest_checkout']; + } + else { + $coname = ''; + $guest_checkout = 0; + } + // Settings assigning to general variable + $general = maybe_unserialize($settings); + + $gateways = get_option('memberdeck_gateways'); + if (!empty($gateways)) { + // gateways are saved and we can now get settings from Stripe and Paypal + if (is_array($gateways)) { + $mc = $gateways['manual_checkout']; + $pp_email = $gateways['pp_email']; + $test_email = $gateways['test_email']; + $pk = $gateways['pk']; + $sk = $gateways['sk']; + $tpk = $gateways['tpk']; + $tsk = $gateways['tsk']; + $test = $gateways['test']; + $epp = $gateways['epp']; + $es = $gateways['es']; + $esc = $gateways['esc']; + $bk = $gateways['bk']; + $btk = $gateways['btk']; + $eb = $gateways['eb']; + $ecb = (isset($gateways['ecb']) ? $gateways['ecb'] : '0'); //Coinbase + $eauthnet = (isset($gateways['eauthnet']) ? $gateways['eauthnet'] : '0'); //Authorize.Net + $eppadap = (isset($gateways['eppadap']) ? $gateways['eppadap'] : '0'); + if (isset($first_data) && $first_data) { + $gateway_id = $gateways['gateway_id']; + $fd_pw = $gateways['fd_pw']; + $efd = $gateways['efd']; + } + } + } + + // Now we check for Stripe connect data + if (function_exists('is_id_pro') && is_id_pro()) { + $settings = get_option('memberdeck_gateways'); + if (!empty($settings)) { + if (is_array($settings)) { + if ($settings['es'] == '1') { + // Stripe is active, so we use the id that is set above + $customer_id = $customer_id; + } + else if ($settings['eb'] == '1') { + $balanced_customer_id = balanced_customer_id(); + $customer_id = $balanced_customer_id; + } + else if ($settings['efd'] == '1') { + $fd_card_details = fd_customer_id(); + if (!empty($fd_card_details)) { + $customer_id = $fd_card_details['fd_token']; + } + } + else if ($settings['eauthnet'] == '1') { + $authorize_customer_id = authnet_customer_id(); + if (!empty($authorize_customer_id)) { + $customer_id = $authorize_customer_id['authorizenet_payment_profile_id']; + } else { + $customer_id = ""; + } + } + $esc = $settings['esc']; + $check_claim = apply_filters('md_level_owner', get_option('md_level_'.$product_id.'_owner')); + if (!empty($check_claim)) { + if ($esc == '1') { + $md_sc_creds = get_sc_params($check_claim); + if (!empty($md_sc_creds)) { + $sc_accesstoken = $md_sc_creds->access_token; + $sc_pubkey = $md_sc_creds->stripe_publishable_key; + } + } + if ($epp == '1') { + $claimed_paypal = get_user_meta($check_claim, 'md_paypal_email', true); + } + } + } + } + } + if ($es == 1) { + if (!class_exists('Stripe')) { + require_once IDC_PATH.'/lib/Stripe.php'; + } + if (isset($test) && $test == '1') { + Stripe::setApiKey($tsk); + Stripe::setApiVersion($stripe_api_version); + } + else { + Stripe::setApiKey($sk); + Stripe::setApiVersion($stripe_api_version); + } + // get stripe currency + $stripe_currency = 'USD'; + $stripe_symbol = '$'; + $settings = get_option('memberdeck_gateways'); + if (!empty($settings)) { + if (is_array($settings)) { + $stripe_currency = $settings['stripe_currency']; + $stripe_symbol = md_stripe_currency_symbol($stripe_currency); + } + } + } + else if ($eb == 1) { + if (isset($test) && $test == '1') { + $burl = $gateways['bturl']; + } + else { + $burl = $gateways['burl']; + } + } + else if (isset($efd) && $efd == 1) { + $endpoint = 'https://api.globalgatewaye4.firstdata.com/transaction/v12'; + $wsdl = 'https://api.globalgatewaye4.firstdata.com/transaction/v12/wsdl'; + } + + // use that id to get our level data + $return = ID_Member_Level::get_level($product_id); + // we have that data, lets store it in vars + $level_name = $return->level_name; + if (isset($renewable) && $renewable) { + $level_price = $return->renewal_price; + } + else { + $level_price = $return->level_price; + if (isset($pwyw_price) && $pwyw_price > $level_price) { + $level_price = $pwyw_price; + } + } + $txn_type = $return->txn_type; + $currency = memberdeck_pp_currency(); + if (!empty($currency)) { + $pp_currency = $currency['code']; + $pp_symbol = $currency['symbol']; + } + else { + $pp_currency = 'USD'; + $pp_symbol = '$'; + } + // If payment gateway for CC payments is Authorize.Net, and level is recurring, make instant_checkout false + if ($return->level_type == 'recurring' && $gateways['eauthnet'] == 1) { + $instant_checkout = false; + } + + $type = $return->level_type; + $recurring = $return->recurring_type; + $limit_term = $return->limit_term; + $term_length = $return->term_length; + + $credit_value = $return->credit_value; + $cf_level = false; + if ($crowdfunding) { + $cf_assignments = get_assignments_by_level($product_id); + if (!empty($cf_assignments)) { + $project_id = $cf_assignments[0]->project_id; + $project = new ID_Project($project_id); + $the_project = $project->the_project(); + $post_id = $project->get_project_postid(); + $id_disclaimer = get_post_meta($post_id, 'ign_disclaimer', true); + } + } + + // Getting credits value, if the product can be purchased using credits and if the user have credits, then add an option to purhcase using credits + $paybycrd = 0; + $member_credits = 0; + if (isset($general['enable_credits']) && $general['enable_credits'] == 1) { + if (isset($member)) { + $member_credits = $member->get_user_credits(); + } + if ($member_credits > 0) { + if (isset($pwyw_price) && $global_currency == 'credits') { + $credit_value = $pwyw_price; + } + if ($credit_value > 0 && $credit_value <= $member_credits) { + $paybycrd = 1; + } + } + } + + if ($ecb) { + $cb_currency = (isset($gateways['cb_currency']) ? $gateways['cb_currency'] : 'BTC'); + } + + if (!isset($already_valid) || $return->enable_multiples) { + // they don't own this level, send forth the template + $level_price = apply_filters('idc_product_price', $level_price, $product_id, $return); + if ($level_price !== '' && $level_price > 0) { + if ($global_currency == 'BTC' || $global_currency == 'credits') { + $level_price = sprintf('%f', (float) $level_price); + } + else { + $level_price = number_format(floatval($level_price), 2, '.', ','); + } + } + + // Getting the option to show terms checkbox and page content + $receipt_settings = get_option( "md_receipt_settings" ); + if (!is_array($receipt_settings)) { + $receipt_settings = unserialize($receipt_settings); + } + // Getting the content of the terms page + if (!empty($receipt_settings['terms_page'])) { + $terms_content = get_post( $receipt_settings['terms_page'] ); + } + if (!empty($receipt_settings['privacy_page'])) { + $privacy_content = get_post( $receipt_settings['privacy_page'] ); + } + + include_once dirname(__FILE__).'/ignitiondeck-templates/_checkoutForm.php'; + $content = ob_get_contents(); + } + else { + // they already own this one + $content = '

'.__('You already own this product. Please', 'memberdeck').' '.__('logout', 'memberdeck').' '.__('and create a new account in order to purchase again', 'memberdeck').'.

'; + } + ob_end_clean(); + return $content; +} + +?> \ No newline at end of file diff --git a/wordpress/wp-content/themes/backer/includes/ignitiondeck-templates/_checkoutForm.php b/wordpress/wp-content/themes/backer/includes/ignitiondeck-templates/_checkoutForm.php new file mode 100644 index 0000000000000000000000000000000000000000..6d93a4b574b0c774190cd81c541467029a2a9e0f --- /dev/null +++ b/wordpress/wp-content/themes/backer/includes/ignitiondeck-templates/_checkoutForm.php @@ -0,0 +1,249 @@ +
+
+ + + +
data-free="" data-txn-type="" data-renewable="" data-limit-term="" data-term-limit="" data-scpk="" data-claimedpp="" data-pay-by-credits=""> +
+ 0) { ?> +
+
+

Pay by check?

+

+ You can pay by check if you'd like, just go to our + + Pay by check checkout. + +

+
+
+

Pay by card?

+

+ You can pay right now by using our + + Pay by card checkout. + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+

Our Promise

+

Blocpower guarantees that your payment will be securely stored in our bank account until the project is completed.

+
+
+ +
+ +

Register

+

+
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+ + + + +
+ +
+ + + +
+ + +

Payment Information

+ +
data-idset="" data-symbol="" data-customer-id="" style=""> +

Your payment method will not be charged at this time. If the project is succesfully funded, your payment method will be charged $ when the project ends.

+
+
+ + +
+
+ + +
+
+ + / +
+
+ +
> +

Please send your check to the address below. Your check for $ will be cashed when the project ends.

+

Make check payable to Blocpower for $

+

Send check to:

+

Blocpower
+ P.O. Box 123543
+ Brooklyn, NY 11201

+ +
+
+ + +
+
+
+ +
+ +
+ + +


.

+ + + + + + + + + + + + +
+ + + + +
+
+ +
+ '.$id_disclaimer.'

' : ''); ?> +
+ + +
+
+ post_content); ?> +
+
+
+
+ post_content); ?> +
+
+ + + +
+
+ + + +
+ + + +balanced.init("'.$burl.'"); jQuery("#payment-form").show()'; +} ?> +'; + // For mini browser + /*echo '';*/ +} +?> diff --git a/wordpress/wp-content/themes/backer/style.css b/wordpress/wp-content/themes/backer/style.css index ebf6b295188cd61ccf1533a2cb9f5597e980ce49..7a0f0455373a2edf84c54e8478534e7570071032 100644 --- a/wordpress/wp-content/themes/backer/style.css +++ b/wordpress/wp-content/themes/backer/style.css @@ -86,6 +86,7 @@ html:not(.ie8) body { .content-wrapper { padding: 50px; background: #fff; + overflow: hidden; } .left { @@ -1832,16 +1833,7 @@ ul.md-projects-list { .ignitiondeck .form-row p { margin: 0; } -/*.memberdeck form a, .memberdeck a { - color: #333; -}*/ -/*.memberdeck .idc-terms-checkbox { - background: #eee; - border-radius: 5px; - line-height: 20px; - margin: 0; - padding-top: 8px; -}*/ + .memberdeck .idc-terms-checkbox .form-row { margin-top: 0; } @@ -1918,14 +1910,47 @@ input.terms-checkbox-input { line-height: 24px; } .memberdeck #payment-form { - background: none; - margin: 0; - padding: 0; + background: none; + margin: 0; + padding: 0; + width: 100%; + max-width: none; + overflow: hidden; + color: #585858; +} + +.memberdeck .right-column { + width: 25%; + float: right; +} + +.memberdeck .left-column { + width: 75%; + max-width: 650px; + float: left; +} + +.memberdeck .payment-type-selector { + padding-bottom: 20px; +} + +.memberdeck .pay_selector{ + display: block; +} +.memberdeck .pay_selector.active{ + display: none; +} + +.memberdeck #payment-form h3 { + margin-bottom: .5rem; +} +.memberdeck .highlight{ + color: #F75146; } -/*.memberdeck #payment-form .checkout-header { - margin-bottom: 50px; -}*/ +.memberdeck .idc-terms-checkbox{ + padding: 0; +} /* Notices */ .memberdeck p.success, .memberdeck p.error, .memberdeck p.info, .memberdeck .md-profile h2 + p, .ignitiondeck .notification {