public static function ajaxPayment()
 {
     $status = BraintreePayment::processPayment();
     if ($status == PAYMENT_PRO_COMPLETED) {
         payment_pro_cart_drop();
         osc_add_flash_ok_message(sprintf(__('Success! Please write down this transaction ID in case you have any problem: %s', 'payment_pro'), Params::getParam('braintree_transaction_id')));
     } else {
         if ($status == PAYMENT_PRO_ALREADY_PAID) {
             payment_pro_cart_drop();
             osc_add_flash_warning_message(__('Warning! This payment was already paid', 'payment_pro'));
         } else {
             osc_add_flash_error_message(__('There were an error processing your payment', 'payment_pro'));
         }
     }
     payment_pro_js_redirect_to(osc_route_url('payment-pro-done', array('tx' => Params::getParam('braintree_transaction_id'))));
 }
 public static function ajaxPayment()
 {
     $status = BraintreePayment::processPayment();
     if ($status == PAYMENT_COMPLETED) {
         printf(__('Success! Please write down this transaction ID in case you have any problem: %s', 'payment'), Params::getParam('braintree_transaction_id'));
     } else {
         if ($status == PAYMENT_ALREADY_PAID) {
             _e('Warning! This payment was already paid', 'payment');
         } else {
             _e('There were an error processing your payment', 'payment');
         }
     }
 }
Esempio n. 3
0
<?php

$status = BraintreePayment::processPayment();
if ($status == PAYMENT_COMPLETED) {
    echo "<h1>Success! Transaction ID: " . Params::getParam('braintree_transaction_id') . "</h1>";
} else {
    if ($status == PAYMENT_ALREADY_PAID) {
        echo "<h1>Warning! This payment was already paid</h1>";
    } else {
        echo "<h1>Error: " . $result->message . "</h1>";
    }
}
Esempio n. 4
0
             if (osc_get_preference('blockchain_enabled', 'payment')) {
                 Blockchain::button($category_fee, sprintf(__("Premium fee for item %d at %s", "paypal"), $item['pk_i_id'], osc_page_title()), "201x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
             }
             if (osc_get_preference('braintree_enabled', 'payment')) {
                 BraintreePayment::button($category_fee, sprintf(__("Premium fee for item %d at %s", "paypal"), $item['pk_i_id'], osc_page_title()), "201x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
             }
         }
     } else {
         if (osc_get_preference('paypal_enabled', 'payment')) {
             Paypal::button($category_fee, sprintf(__("Premium fee for item %d at %s", "paypal"), $item['pk_i_id'], osc_page_title()), "201x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
         }
         if (osc_get_preference('blockchain_enabled', 'payment')) {
             Blockchain::button($category_fee, sprintf(__("Premium fee for item %d at %s", "paypal"), $item['pk_i_id'], osc_page_title()), "201x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
         }
         if (osc_get_preference('braintree_enabled', 'payment')) {
             BraintreePayment::button($category_fee, sprintf(__("Premium fee for item %d at %s", "paypal"), $item['pk_i_id'], osc_page_title()), "201x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
         }
     }
     ?>
         </div>
         <div style="clear:both;"></div>
         <div name="result_div" id="result_div"></div>
         <script type="text/javascript">
             var rd = document.getElementById("result_div");
         </script>
     </div>
     <?php 
 } else {
     // PRICE IS ZERO!
     ?>
         <h1><?php 
Esempio n. 5
0
             if (osc_get_preference('blockchain_enabled', 'payment')) {
                 Blockchain::button($category_fee, sprintf(__('Publish fee for item %d at %s', 'payment'), $item['pk_i_id'], osc_page_title()), "101x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
             }
             if (osc_get_preference('braintree_enabled', 'payment')) {
                 BraintreePayment::button($category_fee, sprintf(__('Publish fee for item %d at %s', 'payment'), $item['pk_i_id'], osc_page_title()), "101x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
             }
         }
     } else {
         if (osc_get_preference('paypal_enabled', 'payment')) {
             Paypal::button($category_fee, sprintf(__('Publish fee for item %d at %s', 'payment'), $item['pk_i_id'], osc_page_title()), "101x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
         }
         if (osc_get_preference('blockchain_enabled', 'payment')) {
             Blockchain::button($category_fee, sprintf(__('Publish fee for item %d at %s', 'payment'), $item['pk_i_id'], osc_page_title()), "101x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
         }
         if (osc_get_preference('braintree_enabled', 'payment')) {
             BraintreePayment::button($category_fee, sprintf(__('Publish fee for item %d at %s', 'payment'), $item['pk_i_id'], osc_page_title()), "101x" . $item['fk_i_category_id'] . "x" . $item['pk_i_id'], array('user' => $item['fk_i_user_id'], 'itemid' => $item['pk_i_id'], 'email' => $item['s_contact_email']));
         }
     }
     ?>
         </div>
         <div style="clear:both;"></div>
         <div name="result_div" id="result_div"></div>
         <script type="text/javascript">
             var rd = document.getElementById("result_div");
         </script>
     </div>
     <?php 
 } else {
     // PRICE IS ZERO!
     ?>
         <h1><?php 
Esempio n. 6
0
function payment_buttons_js()
{
    if (osc_get_preference('paypal_enabled', 'payment') == 1) {
        ?>
        <div name="result_div" id="result_div"></div>
        <script type="text/javascript">
            var rd = document.getElementById("result_div");
        </script>
        <?php 
    }
    if (osc_get_preference('braintree_enabled', 'payment') == 1) {
        BraintreePayment::dialogJS();
    }
    if (osc_get_preference('stripe_enabled', 'payment') == 1) {
        StripePayment::dialogJS();
    }
    if (osc_get_preference('coinjar_enabled', 'payment') == 1) {
        CoinjarPayment::dialogJS();
    }
}
Esempio n. 7
0
            <div>
                <?php 
        Blockchain::button($pack, sprintf(__("Credit for %s %s at %s", "payment"), $pack, osc_get_preference("currency", "payment"), osc_page_title()), '301x' . $pack, array('user' => @$user['pk_i_id'], 'itemid' => @$user['pk_i_id'], 'email' => @$user['s_email']));
        ?>
           </div>
        <?php 
    }
    if (osc_get_preference('braintree_enabled', 'payment') == 1) {
        ?>
            <div>
                <?php 
        BraintreePayment::button($pack, sprintf(__("Credit for %s %s at %s", "payment"), $pack, osc_get_preference("currency", "payment"), osc_page_title()), '301x' . $pack, array('user' => @$user['pk_i_id'], 'itemid' => @$user['pk_i_id'], 'email' => @$user['s_email']));
        ?>
            </div>
        <?php 
    }
    ?>
    </div>
    <div style="clear:both;"></div>
    <br/>
<?php 
}
?>
<div name="result_div" id="result_div"></div>
<script type="text/javascript">
    var rd = document.getElementById("result_div");
</script>
<?php 
if (osc_get_preference('braintree_enable', 'payment') == 1) {
    BraintreePayment::dialogJS();
}