Example #1
0
    function payment_button($order_id, $product_type)
    {
        if (func_num_args() > 1) {
            $product_type = func_get_arg(1);
        }
        if ($product_type == '') {
            $product_type = 'P';
            // posting package
        }
        // else product type of 'S' is a subscription.
        global $label;
        if ($product_type == 'P') {
            $order_row = JB_get_product_invoice_row($order_id);
            $prod_id = $order_row['package_id'];
        } elseif ($product_type == 'S') {
            $order_row = JB_get_subscription_invoice_row($order_id);
            $prod_id = $order_row['subscription_id'];
        } elseif ($product_type == 'M') {
            $order_row = JB_get_membership_invoice_row($order_id);
            $prod_id = $order_row['membership_id'];
        }
        ?>

		<center>
		<form id="payment_button" name="_2coform" action="<?php 
        echo _2CO_PAYMENT_ROUTINE;
        ?>
" method="post">
		
		<?php 
        /*
        Optional parameters 
        sh_cost - Shipping and handling cost, if any in your current currency. 
        c_name or c_name_[:digit] - Required for new product creation. Name of new product limited to 128 characters. 
        c_description or c_description_[:digit] - Required for new product creation. 
        Short description of the product, limited to 255 characters.
        Longer description will be stored in the 2Co product database 
        as long description, and will not show up on checkout pages. 
        c_price or c_price_[:digit] - Required for new product creation.
        Price of the product in your current currency.
        Numbers and decimal points only. Maximum value 999999.99 
        c_tangible or c_tangible_[:digit] - Y or y indicates as tangible or physical product
        N or n indicates an e-good or a service. 
        */
        if ($order_row['user_type'] == 'C') {
            // Is user type a Candiadte?
            ?>
 
			<input type="hidden" name="x_receipt_link_url" value="<?php 
            echo _2CO_CANDIDATE_X_RECEIPT_LINK_URL;
            ?>
">
			<input type="hidden" name="return_url" value="<?php 
            echo _2CO_CANDIDATE_X_RECEIPT_LINK_URL;
            ?>
">
			<?php 
        } else {
            ?>
			<input type="hidden" name="x_receipt_link_url" value="<?php 
            echo _2CO_X_RECEIPT_LINK_URL;
            ?>
">
			<input type="hidden" name="return_url" value="<?php 
            echo _2CO_X_RECEIPT_LINK_URL;
            ?>
">
			<?php 
        }
        ?>
		
		<input type="hidden" name="demo" value="<?php 
        echo _2CO_DEMO;
        ?>
">
		<input type="hidden" name="sid" value="<?php 
        echo _2CO_SID;
        ?>
">

		<input type="hidden" name="total" value="<?php 
        echo JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], 'USD');
        ?>
">
		<input type="hidden" name="cart_order_id" value="<?php 
        echo jb_prefix_order_id($product_type . $order_row['invoice_id']);
        ?>
">
	
		
		<input type="hidden" name="fixed" value="N">
		<input type="hidden" name="c_name" value="<?php 
        echo htmlentities(JB_SITE_NAME);
        ?>
 - #<?php 
        echo htmlentities($product_type . $prod_id);
        ?>
">
		<input type="hidden" name="c_description" value="<?php 
        echo htmlentities($order_row['item_name']);
        ?>
">
		<input type="hidden" name="c_price" value="<?php 
        echo JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], 'USD');
        ?>
">
		<input type="hidden" name="c_tangible" value="N">
		<!-- New parameters -->
		 
		<input type="hidden" name="c_prod" value="<?php 
        echo htmlentities($product_type . $prod_id);
        ?>
">
		<input type="hidden" name="id_type" value="1">
		
		<input type="submit" value="<?php 
        echo $label['payment_2co_submit_butt'];
        ?>
"><br>


		</form>
		</center>
		<center>
		
		<img border='0' onclick="document._2coform.submit();" src="http://www.2checkout.com/images/overview/btns/21.jpg">
		
		</center>
		<!-- automatically submit the payment button -->
		<script type="text/javascript">
			function js_submit_payment() {
			var form = document.getElementById('payment_button');
				  form.submit();
			  }
			  window.onload = js_submit_payment;
		</script>

		<?php 
    }
Example #2
0
    function payment_button($order_id, $product_type)
    {
        if (func_num_args() > 1) {
            $product_type = func_get_arg(1);
        }
        if ($product_type == '') {
            $product_type = 'P';
            // posting package
        }
        global $label;
        if ($product_type == 'P') {
            $order_row = JB_get_product_invoice_row($order_id);
        } elseif ($product_type == 'S') {
            $order_row = JB_get_subscription_invoice_row($order_id);
        } elseif ($product_type == 'M') {
            $order_row = JB_get_membership_invoice_row($order_id);
        }
        ?>
		<center>
		<?php 
        if (AUTHNET_TEST_MODE == 'YES') {
            //
            //https://test.authorize.net/gateway/transact.dll
            ?>
		
			<FORM id="payment_button" action="https://certification.authorize.net/gateway/transact.dll" method="POST">
		
		<?php 
        } else {
            ?>

			<FORM id="payment_button" action="https://secure.authorize.net/gateway/transact.dll" method="POST"> 
		
		<?php 
        }
        $loginid = AUTHNET_LOGIN_ID;
        $x_tran_key = AUTHNET_X_TRAN_KEY;
        $x_Amount = $order_row['amount'];
        $amount = JB_convert_to_currency($x_Amount, $order_row['currency_code'], AUTHNET_CURRENCY);
        $amount = number_format($amount, 2, '.', '');
        // Seed random number for security and better randomness.
        srand(time());
        $sequence = rand(1, 1000);
        $tstamp = time();
        $fingerprint = authnet_CalculateFP(AUTHNET_LOGIN_ID, AUTHNET_X_TRAN_KEY, $amount, $sequence, $tstamp, AUTHNET_CURRENCY);
        authnet_log_entry('Generated payment button with the following fingerprint' . $fingerprint);
        //echo "trans key: ".$x_tran_key.", login: $loginid seq: $sequence time: $tstamp amount $amount currency:".AUTHNET_CURRENCY." fprint $fingerprint<br>";
        echo '<input type="hidden" name="x_fp_sequence" value="' . $sequence . '">';
        echo '<input type="hidden" name="x_fp_timestamp" value="' . $tstamp . '">';
        echo '<input type="hidden" name="x_fp_hash" value="' . strtoupper($fingerprint) . '">';
        // Insert rest of the form elements similiar to the legacy weblink integration
        //echo ("<input type=\"hidden\" name=\"x_description\" value=\"" . $x_Description . "\">\n" );
        echo "<input type=\"hidden\" name=\"x_login\" value=\"" . $loginid . "\">\n";
        echo "<input type=\"hidden\" name=\"x_amount\" value=\"" . $amount . "\">\n";
        // *** IF YOU ARE PASSING CURRENCY CODE uncomment the line below *****
        echo "<input type=\"hidden\" name=\"x_currency_code\" value=\"" . AUTHNET_CURRENCY . "\">\n";
        ?>
<!--
		<INPUT type="hidden" name="x_background_url" value="<?php 
        echo AUTHNET_X_BACKGROUND_URL;
        ?>
">
		<INPUT type="hidden" name="x_logo_url" value="<?php 
        echo AUTHNET_X_LOGO_URL;
        ?>
">
		<INPUT type="hidden" name="x_color_background" value="<?php 
        echo AUTHNET_X_COLOR_BACKGROUND;
        ?>
">
		<INPUT type="hidden" name="x_color_link" value="<?php 
        echo AUTHNET_X_COLOR_LINK;
        ?>
">
		<INPUT type="hidden" name="x_color_text" value="<?php 
        echo AUTHNET_X_COLOR_TEXT;
        ?>
">

		<INPUT type="hidden" name="x_receipt_link_method" value="<?php 
        echo AUTHNET_X_RECEIPT_LINK_METHOD;
        ?>
">
		<?php 
        if ($order_row['user_type'] == 'C') {
            // Is user type a Candiadte?
            ?>
 
			<INPUT type="hidden" name="x_receipt_link_url" value="<?php 
            echo AUTHNET_CANDIDATE_X_RECEIPT_LINK_URL;
            ?>
">
		<?php 
        } else {
            ?>
			<INPUT type="hidden" name="x_receipt_link_url" value="<?php 
            echo jb_escape_html(AUTHNET_X_RECEIPT_LINK_URL);
            ?>
">
		<?php 
        }
        ?>
		<INPUT type="hidden" name="x_receipt_link_text" value="<?php 
        echo jb_escape_html(AUTHNET_X_RECEIPT_LINK_TEXT);
        ?>
">

		
		<INPUT type="hidden" name="x_header_html_payment_form" value="<?php 
        echo htmlentities(AUTHNET_X_HEADER_HTML_PAYMENT_FORM);
        ?>
">
		<INPUT type="hidden" name="x_footer_html_payment_form" value="<?php 
        echo htmlentities(AUTHNET_X_FOOTER_HTML_PAYMENT_FORM);
        ?>
">
-->
		<INPUT type="hidden" name="x_cust_id" value="<?php 
        if ($product_type == 'M') {
            // membership invoice
            echo $order_row['user_id'];
        } else {
            echo $order_row['employer_id'];
        }
        ?>
">

		
		<INPUT type="hidden" name="x_relay_response" value="TRUE">
		<INPUT type="hidden" name="x_relay_url" value="<?php 
        echo AUTHNET_X_RELAY_URL;
        ?>
">
	
		<INPUT type="hidden" name="x_invoice_num" value="<?php 
        echo jb_prefix_order_id($product_type . $order_row['invoice_id']);
        ?>
">
		<INPUT type="hidden" name="x_description" value="<?php 
        echo JB_escape_html(JB_SITE_NAME);
        ?>
">
		
		<INPUT type="hidden" name="x_show_form" value="PAYMENT_FORM">
		<?php 
        if (AUTHNET_TEST_MODE == 'YES') {
            ?>
			<INPUT type="hidden" name="x_test_request" value="TRUE">
		<?php 
        } else {
            ?>
			<INPUT type="hidden" name="x_test_request" value="FALSE">
		<?php 
        }
        ?>
		<INPUT type="submit" value="<?php 
        echo $label['pay_by_authnet_button'];
        ?>
">
		</FORM>
</center>
<!-- automatically submit the payment button -->
		<script type="text/javascript">
			function js_submit_payment() {
			var form = document.getElementById('payment_button');
				  form.submit();
			  }
			  window.onload = js_submit_payment;
		</script>


		<?php 
    }
Example #3
0
    }
}
?>


<?php 
if ($_REQUEST['action'] == 'confirm') {
    /*
    	$sql = "update package_invoices set status='Confirmed' where invoice_id='".$_REQUEST['invoice_id']."'";
    	JB_mysql_query($sql) or die(mysql_error()) ;
    */
    JB_confirm_package_invoice($_REQUEST['invoice_id']);
    $JBMarkup->ok_msg('Order Confirmed');
}
if ($_REQUEST['action'] == 'complete') {
    $invoice_row = JB_get_product_invoice_row($_REQUEST['invoice_id']);
    if (isset($invoice_row['employer_id'])) {
        $txn_prefix = 'E';
    } else {
        $txn_prefix = 'P';
    }
    JB_complete_package_invoice($_REQUEST['invoice_id'], '');
    JB_debit_transaction($_REQUEST['invoice_id'], $invoice_row['amount'], $invoice_row['currency_code'], $txn_prefix . 'P' . $_REQUEST['invoice_id'], $reason_code, 'Admin', 'P');
    $JBMarkup->ok_msg('Order Completed.');
}
if ($_REQUEST['action'] == 'void') {
    JB_void_package_invoice($_REQUEST['invoice_id']);
    $JBMarkup->ok_msg('Order set to Void.');
}
if ($_REQUEST['action'] == 'cancel') {
    JB_cancel_package_invoice($_REQUEST['invoice_id']);
Example #4
0
    function payment_button($invoice_id, $product_type)
    {
        if (func_num_args() > 1) {
            $product_type = func_get_arg(1);
        }
        if ($product_type == '') {
            $product_type = 'P';
            // posting package
        }
        if ($product_type == 'P') {
            $order_row = JB_get_product_invoice_row($invoice_id);
        } elseif ($product_type == 'S') {
            $order_row = JB_get_subscription_invoice_row($invoice_id);
        } elseif ($product_type == 'M') {
            $order_row = JB_get_membership_invoice_row($invoice_id);
        }
        ?>
		<form id='payment_button' action="<?php 
        if (NOCHEX_TEST == 'Y') {
            echo "https://www.nochex.com/nochex.dll/apc/testapc";
        } else {
            echo "https://www.nochex.com/nochex.dll/checkout";
        }
        ?>
" name="form1" method="post" target="_parent">
		  
		<input type="hidden" value="<?php 
        echo trim(NOCHEX_EMAIL);
        ?>
" name="email"/>
		<input type="hidden" value="<?php 
        echo number_format(JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], NOCHEX_CURRENCY), 2, '.', '');
        ?>
" name="amount"/>
		<input type="hidden" value="<?php 
        echo jb_prefix_order_id($product_type . $order_row['invoice_id']);
        ?>
" name="ordernumber" />
		<input type="hidden" value="<?php 
        echo jb_escape_html($order_row['item_name']);
        ?>
" name="description" />
		<?php 
        if (trim(NOCHEX_LOGO_URL) != '') {
            ?>
			<input type="hidden" value="<?php 
            echo NOCHEX_LOGO_URL;
            ?>
" name="logo" />
		<?php 
        }
        ?>

		<input type="hidden" value="<?php 
        echo trim(NOCHEX_APC_URL);
        ?>
" name="responderurl"/>

		<?php 
        if ($order_row['user_type'] == 'C') {
            ?>
			<input type="hidden" value="<?php 
            echo NOCHEX_CANDIDATE_RETURN_URL;
            ?>
" name="returnurl"/>
		<?php 
        } else {
            ?>
			<input type="hidden" value="<?php 
            echo NOCHEX_RETURN_URL;
            ?>
" name="returnurl"/>
		<?php 
        }
        ?>
		<?php 
        if ($order_row['user_type'] == 'C') {
            ?>
			<input type="hidden" value="<?php 
            echo NOCHEX_CANDIDATE_CANCEL_RETURN_URL;
            ?>
" name="cancel"/>
		<?php 
        } else {
            ?>
			<input type="hidden" value="<?php 
            echo NOCHEX_CANCEL_RETURN_URL;
            ?>
" name="cancel"/>
		<?php 
        }
        ?>
		<p align="center">
		<input target="_parent" type="image" alt="I accept payment using NOCHEX" src="<?php 
        echo NOCHEX_BUTTON_URL;
        ?>
" border="0" name="submit" />

		</P>	  

		</p>
	</form>
<!-- automatically submit the payment button -->
		<script type="text/javascript">
			function js_submit_payment() {
			var form = document.getElementById('payment_button');
				  form.submit();
			  }
			  window.onload = js_submit_payment;
		</script>
	<?php 
    }
Example #5
0
    function payment_button($order_id, $product_type)
    {
        if (func_num_args() > 1) {
            $product_type = func_get_arg(1);
        }
        if ($product_type == '') {
            $product_type = 'P';
            // posting package
        }
        global $label;
        if ($product_type == 'P') {
            $order_row = JB_get_product_invoice_row($order_id);
        } elseif ($product_type == 'S') {
            $order_row = JB_get_subscription_invoice_row($order_id);
        } elseif ($product_type == 'M') {
            $order_row = JB_get_membership_invoice_row($order_id);
        }
        $Checksum = cc_getCheckSum(CCAVENUE_MERCHANT_ID, JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], CCAVENUE_CURRENCY), jb_prefix_order_id($product_type . $order_row['invoice_id']), CCAVENUE_REDIRECT_URL, CCAVENUE_WORKING_KEY);
        ?>

		<form id="payment_button" method="post" action="https://www.ccavenue.com/shopzone/cc_details.jsp">
		<input type=hidden name=Merchant_Id value="<?php 
        echo CCAVENUE_MERCHANT_ID;
        ?>
">
		<input type=hidden name=Amount value="<?php 
        echo JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], CCAVENUE_CURRENCY);
        ?>
">
		<input type=hidden name=Order_Id value="<?php 
        echo jb_prefix_order_id($product_type . $order_row['invoice_id']);
        ?>
">
		<!--<input type=hidden name=ActionID value="TXN">-->
		<?php 
        if ($order_row['user_type'] == 'C') {
            ?>
		
			<input type='hidden' name='Redirect_Url' value="<?php 
            echo CCAVENUE_CANDIDATE_REDIRECT_URL;
            ?>
">
		<?php 
        } else {
            ?>
			<input type=hidden name=Redirect_Url value="<?php 
            echo CCAVENUE_REDIRECT_URL;
            ?>
">
		<?php 
        }
        ?>

		<input type=hidden name=Checksum value="<?php 
        echo $Checksum;
        ?>
">
		
		<input type="hidden" name="Merchant_Param" value="<?php 
        echo $order_id;
        ?>
"> 
		<center>
		<INPUT TYPE="submit" value="<?php 
        echo $label['pay_by_ccavenue_button'];
        ?>
">
		</center>
		</form>
		<!-- automatically submit the payment button -->
		<script type="text/javascript">
			function js_submit_payment() {
			var form = document.getElementById('payment_button');
				  form.submit();
			  }
			  window.onload = js_submit_payment;
		</script>



		<?php 
    }
Example #6
0
    function payment_button($order_id, $product_type)
    {
        if (func_num_args() > 1) {
            $product_type = func_get_arg(1);
        }
        if ($product_type == '') {
            $product_type = 'P';
            // posting package
        }
        global $label;
        if ($product_type == 'P') {
            $order_row = JB_get_product_invoice_row($order_id);
        } elseif ($product_type == 'S') {
            $order_row = JB_get_subscription_invoice_row($order_id);
        } elseif ($product_type == 'M') {
            $order_row = JB_get_membership_invoice_row($order_id);
        }
        ?>

<form id="payment_button" action="https://www.e-gold.com/sci_asp/payments.asp" method="post" >
<input type="hidden" name="PAYEE_ACCOUNT" value="<?php 
        echo EGOLD_PAYEE_ACCOUNT;
        ?>
">
<input type="hidden" name="PAYEE_NAME" value="<?php 
        echo JB_escape_html(JB_SITE_NAME);
        ?>
">
<input type="hidden" name="PAYMENT_AMOUNT"  value="<?php 
        echo JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], $this->get_currency());
        ?>
">
<input type="hidden" name="PAYMENT_UNITS" value="<?php 
        echo EGOLD_PAYMENT_UNITS;
        ?>
">
<input type="hidden" name="PAYMENT_METAL_ID" value="<?php 
        echo EGOLD_PAYMENT_METAL_ID;
        ?>
">
<input type="hidden" name="PAYMENT_ID" value="<?php 
        echo jb_prefix_order_id($product_type . $order_row['invoice_id']);
        ?>
">
<input type="hidden" name="STATUS_URL" value="<?php 
        echo EGOLD_STATUS_URL;
        ?>
">
<?php 
        if ($order_row['user_type'] == 'C') {
            ?>
	<input type="hidden" name="PAYMENT_URL" value="<?php 
            echo EGOLD_CANDIDATE_PAYMENT_URL;
            ?>
">
<?php 
        } else {
            ?>
	<input type="hidden" name="PAYMENT_URL" value="<?php 
            echo EGOLD_PAYMENT_URL;
            ?>
">
<?php 
        }
        ?>
<input type="hidden" name="PAYMENT_URL_METHOD" value="POST">
<?php 
        if ($order_row['user_type'] == 'C') {
            ?>
	<input type="hidden" name="NOPAYMENT_URL" value="<?php 
            echo EGOLD_CANDIDATE_NOPAYMENT_URL;
            ?>
">
<?php 
        } else {
            ?>
	<input type="hidden" name="NOPAYMENT_URL" value="<?php 
            echo EGOLD_NOPAYMENT_URL;
            ?>
">
<?php 
        }
        ?>
<input type="hidden" name="NOPAYMENT_URL_METHOD" value="POST">
<input type="hidden" name="BAGGAGE_FIELDS" value="ORDER_NUM CUST_NUM">

<input type="hidden" name="ORDER_NUM" value="<?php 
        echo $order_row['invoice_id'];
        ?>
">
<input type="hidden" name="CUST_NUM" value="<?php 
        if ($product_type == 'M') {
            echo $order_row['user_id'];
        } else {
            echo $order_row['employer_id'];
        }
        ?>
">
<center>
<input type="submit" value="<?php 
        echo $label['pay_by_egold_button'];
        ?>
">
</center>
</form>
<!-- automatically submit the payment button -->
		<script type="text/javascript">
			function js_submit_payment() {
			var form = document.getElementById('payment_button');
				  form.submit();
			  }
			  window.onload = js_submit_payment;
		</script>
		

		<?php 
    }
Example #7
0
    function payment_button($order_id, $product_type)
    {
        $order_row = array();
        if (func_num_args() > 1) {
            $product_type = func_get_arg(1);
        }
        if ($product_type == '') {
            $product_type = 'P';
            // posting package
        }
        global $label;
        if ($product_type == 'P') {
            $order_row = JB_get_product_invoice_row($order_id);
        } elseif ($product_type == 'S') {
            $order_row = JB_get_subscription_invoice_row($order_id);
        } elseif ($product_type == 'M') {
            $order_row = JB_get_membership_invoice_row($order_id);
        }
        if ($product_type == 'S') {
            // subscription payments.
            if (PAYPAL_AUTO_REBILL == 'YES') {
                $this->paypal_subscr_button($order_row, $product_type);
            } else {
                // just a normal payment button
                $this->paypal_button($order_row, $product_type);
            }
        } elseif ($product_type == 'P') {
            // posting credits
            $this->paypal_button($order_row, $product_type);
        } elseif ($product_type == 'M' && $order_row['months_duration'] > 0) {
            // membership payment subscription button
            if (PAYPAL_AUTO_REBILL == 'YES') {
                $this->paypal_subscr_button($order_row, $product_type);
            } else {
                // just a normal payment button
                $this->paypal_button($order_row, $product_type);
            }
        } elseif ($product_type == 'M' && $order_row['months_duration'] == '0') {
            // membership payment button
            $this->paypal_button($order_row, $product_type);
        }
        ?>
		<!-- automatically submit the payment button -->
		<script type="text/javascript">
			function js_submit_payment() {
			var form = document.getElementById('payment_button');
				  form.submit();
			  }
			  window.onload = js_submit_payment;
		</script>

		<?php 
    }
Example #8
0
    function payment_button($order_id, $product_type)
    {
        if ($product_type == '') {
            $product_type = 'P';
            // posting package
        }
        global $label;
        if ($product_type == 'P') {
            $order_row = JB_get_product_invoice_row($order_id);
            $item_id = $order_row['package_id'];
        } elseif ($product_type == 'S') {
            $order_row = JB_get_subscription_invoice_row($order_id);
            $item_id = $order_row['subscription_id'];
        } elseif ($product_type == 'M') {
            $order_row = JB_get_membership_invoice_row($order_id);
            $item_id = $order_row['membership_id'];
        }
        //print_r($order_row);
        if ($order_row['status'] != 'Confirmed') {
            // Only Confirmed orders can be sent to checkout.
            //echo '<a href=""></a>';
            return;
        }
        if (isset($order_row['employer_id'])) {
            $user_type = 'E';
            $user_id = $order_row['employer_id'];
        } else {
            $user_type = 'C';
            $user_id = $order_row['user_id'];
        }
        $google_msg = $label['payment_google_msg'];
        $google_msg = str_replace('%CONTACT_EMAIL%', JB_SITE_CONTACT_EMAIL, $google_msg);
        $args = array('item-name' => $order_row['item_name'], 'item-description' => JB_SITE_NAME . ' - ' . $order_row['item_name'] . ' (' . $product_type . $order_row['invoice_id'] . ')', 'digital-content-description' => $google_msg, 'user_type' => $user_type, 'user_id' => $user_id, 'product_type' => $product_type, 'currency' => GOOGLE_CHECKOUT_CURRENCY, 'unit-price' => JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], GOOGLE_CHECKOUT_CURRENCY), 'item_id' => $item_id, 'product_type' => $product_type, 'merchant-item-id' => $order_row['invoice_id']);
        //  http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Tag_Reference.html#tag_checkout-shopping-cart
        $res = JB_GoogleCheckoutAPIcall('checkout-shopping-cart', $args);
        //print_r($res);
        jb_googc_log_entry('(' . $product_type . $order_row['invoice_id'] . ') - Jamit sent \'checkout-shopping-cart\', Google replied with the following checkout URL:' . $res->{'redirect-url'});
        ?>

		<p style="text-align: center;">

		<a href="<?php 
        echo $res->{'redirect-url'};
        ?>
">
		<img  src="https://checkout.google.com/buttons/checkout.gif?merchant_id=455364569475924&w=180&h=46&style=white&variant=text&loc=en_US" border="0">
		</a>
		</p>

		<!-- automatically redirect to the cart -->
		<script type="text/javascript">
			function js_redirect_google() {
				window.location='<?php 
        echo $res->{'redirect-url'};
        ?>
'
			  }
			  window.onload = js_redirect_google;
		</script>

		<?php 
    }
function JB_display_package_invoice($invoice_id)
{
    global $label;
    $invoice_row = JB_get_product_invoice_row($invoice_id);
    ?>

	   <table border="0" id="invoice" cellpadding="3"  cellspacing="0">
		<tr>
		   <td class="field"><?php 
    echo $label['package_invoice_no'];
    ?>
</td>
		   <td class="value" valign="top">
		   P<?php 
    echo $invoice_row['invoice_id'];
    ?>
</td>
		 </tr>
		 <tr>
		   <td class="field"><?php 
    echo $label['package_invoice_desr'];
    ?>
</td>
		   <td class="value" valign="top">
		   <?php 
    echo $invoice_row['item_name'];
    ?>
</td>
		 </tr>
		 <tr>
		   <td class="field"><?php 
    echo $label['package_invoice_quantity'];
    ?>
</td>
		   <td class="value" valign="top">
		   <?php 
    echo $invoice_row['posts_quantity'];
    ?>
</td>
		 </tr>
		 <tr>
		   <td class="field"><?php 
    echo $label['package_invoice_price'];
    ?>
&nbsp; 
		   </td>
		   <td class="value" valign="top">
		   <?php 
    echo JB_convert_to_default_currency_formatted($invoice_row['currency_code'], $invoice_row['amount'], true);
    ?>
</td>
		 </tr>

		  <tr>
		   <td class="field"><?php 
    echo $label['package_invoice_p_type'];
    ?>
&nbsp;
		   </td>
		   <td class="value" valign="top">
		  
		   <?php 
    if ($invoice_row['premium'] == 'Y') {
        echo $label['package_invoice_pr_posts'];
    } else {
        echo $label['package_invoice_std_posts'];
    }
    ?>
			</td>
		 </tr>
		
		 <tr>
		   <td class="field"><?php 
    echo $label['package_invoice_status'];
    ?>
&nbsp;
		   </td>
		   <td class="value" valign="top">
		   <?php 
    echo JB_get_invoice_status_label($invoice_row['status']);
    ?>
		   </td>
		 </tr>
		  <?php 
    JBPLUG_do_callback('display_package_invoice', $invoice_row);
    ?>
	   </table>
	   <?php 
}
Example #10
0
    function payment_button($order_id, $product_type)
    {
        if (func_num_args() > 1) {
            $product_type = func_get_arg(1);
        }
        if ($product_type == '') {
            $product_type = 'P';
            // posting package
        }
        global $label;
        if ($product_type == 'P') {
            $order_row = JB_get_product_invoice_row($order_id);
        } elseif ($product_type == 'S') {
            $order_row = JB_get_subscription_invoice_row($order_id);
        } elseif ($product_type == 'M') {
            $order_row = JB_get_membership_invoice_row($order_id);
        }
        ?>

<form id="payment_button" action="https://www.moneybookers.com/app/payment.pl" method="post" >
<input type="hidden" name="pay_to_email" value="<?php 
        echo MONEYBOOKERS_EMAIL;
        ?>
">
<input type="hidden" name="status_url" value="<?php 
        echo MONEYBOOKERS_STATUS_URL;
        ?>
">
<input type="hidden" name="language" value="<?php 
        echo MONEYBOOKERS_LANGUAGE;
        ?>
">
<input type="hidden" name="transaction_id" value="<?php 
        echo jb_prefix_order_id($product_type . $order_row['invoice_id']);
        ?>
">
<input type="hidden" name="amount" value="<?php 
        echo JB_convert_to_currency($order_row['amount'], $order_row['currency_code'], MONEYBOOKERS_CURRENCY);
        ?>
">
<input type="hidden" name="currency" value="<?php 
        echo MONEYBOOKERS_CURRENCY;
        ?>
">
<?php 
        if ($order_row['user_type'] == 'C') {
            ?>
<input type="hidden" name="cancel_url" value="<?php 
            echo MONEYBOOKERS_CANDIDATE_CANCEL_URL;
            ?>
">
<?php 
        } else {
            ?>
<input type="hidden" name="cancel_url" value="<?php 
            echo MONEYBOOKERS_CANCEL_URL;
            ?>
">
<?php 
        }
        if ($order_row['user_type'] == 'C') {
            ?>
<input type="hidden" name="return_url" value="<?php 
            echo MONEYBOOKERS_CANDIDATE_RETURN_URL;
            ?>
">
<?php 
        } else {
            ?>
<input type="hidden" name="return_url" value="<?php 
            echo MONEYBOOKERS_RETURN_URL;
            ?>
">
<?php 
        }
        ?>
<input type="hidden" name="detail1_description" value="<?php 
        echo JB_escape_html(JB_SITE_NAME) . " - " . htmlentities($order_row['item_name']);
        ?>
">
<input type="hidden" name="detail1_text" value="<?php 
        echo JB_escape_html(JB_SITE_NAME) . " - " . htmlentities($order_row['item_name']);
        ?>
">
<input type="submit" value="<?php 
        echo $label['pay_by_moneybookers_button'];
        ?>
">
</form>
<!-- automatically submit the payment button -->
		<script type="text/javascript">
			function js_submit_payment() {
			var form = document.getElementById('payment_button');
				  form.submit();
			  }
			  window.onload = js_submit_payment;
		</script>
		

		<?php 
    }