<?php

/**
 * Adds a PayPal button shortcode
 *
 * This function will display a paypal
 * button when the shortcode is used.
 *
 * @function add_paypal()
 *
 * @uses ow_global_var(), svg()
 *
 * @return (string) The paypal button

 * @deprecated 1.1.0	Paypal integration is now done with an external plugin.
 *
 */
function add_paypal() {
	
	ob_start();
	?>
	
	<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
	<input type="hidden" name="cmd" value="_xclick" />
	<input type="hidden" name="business" value="<?php echo ow_global_var( 'paypal_merchant_id' ); ?>" />
	<input type="hidden" name="lc" value="GB" />
	<input type="hidden" name="amount" value="" />
	<input type="hidden" name="currency_code" value="GBP" />
	<input type="hidden" name="cn" value="Add special instructions to the seller" />
	<input type="hidden" name="no_shipping" value="2" />
	<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted" />
	<button type="submit" id="paypal-button" class="call-to-action"><?php svg( 'social-icons/paypal' ); ?> Pay with PayPal</button>
	</form>
	
	<?php
	
	return ob_get_clean();
}
add_shortcode( 'paypal', 'add_paypal' );