tiki-payment-single.tpl 6.39 KB
Newer Older
1
<div {if isset($iPluginMemberpayment)}id="pluginMemberpayment{$iPluginMemberpayment}" {elseif isset($datachannel_execution)}id="{$datachannel_execution}" {/if}class="payment">
2
	{if isset($wp_member_title)}
3
		{wiki}{tr _0=$wp_member_group.groupName _4=$wp_member_group.expireAfter _5=$wp_member_group.expireAfterYear}{$wp_member_title}{/tr}{/wiki}
4 5 6
	{else} 
		<h2>{$payment_info.description|escape}</h2>
	{/if}
changi67's avatar
changi67 committed
7
	<p>{tr}Status:{/tr} <strong>{$payment_info.state|escape}</strong></p>
8
	{if $payment_info.fullview and !empty($payment_detail)}
lphuberdeau's avatar
lphuberdeau committed
9 10 11
		<div class="clearfix wikitext">
			{$payment_detail}
		</div>
12 13
	{/if}
	<p>
14
		{if $payment_info.state eq 'past'}
changi67's avatar
changi67 committed
15
			{tr}Paid amount:{/tr} {$payment_info.amount_original|escape} {$payment_info.currency|escape}<br />
16
		{else}
changi67's avatar
changi67 committed
17 18
			{tr}Initial amount:{/tr} {$payment_info.amount_original|escape} {$payment_info.currency|escape}<br />
			{tr}Amount remaining:{/tr} <strong>{$payment_info.amount_remaining|escape} {$payment_info.currency|escape}</strong><br />
19
			{tr _0=$payment_info.request_date|tiki_short_date _1=$payment_info.due_date|tiki_short_date}Payment request was sent on %0 and is due by %1.{/tr}<br />
20
		{/if}
21 22 23
		{if ( $payment_info.state eq 'outstanding' || $payment_info.state eq 'overdue' )}
			{if $prefs.payment_system eq 'paypal' && $prefs.payment_paypal_business neq ''}
				<form action="{$prefs.payment_paypal_environment|escape}" method="post">
24 25 26 27 28
					<input type="hidden" name="business" value="{$prefs.payment_paypal_business|escape}" />
					<input type="hidden" name="cmd" value="_xclick" />
					<input type="hidden" name="item_name" value="{$payment_info.description|escape}" />
					<input type="hidden" name="amount" value="{$payment_info.amount_remaining_raw|escape}" />
					<input type="hidden" name="currency_code" value="{$prefs.payment_currency|escape}" />
29
					<input type="hidden" name="invoice" value="{$prefs.payment_invoice_prefix|escape}{$payment_info.paymentRequestId|escape}" />
30
					<input type="hidden" name="return" value="{$payment_info.returnurl|escape}" />
31
					{*<input type="hidden" name="rm" value="2" />*}
32
					{if $prefs.payment_paypal_ipn eq 'y'}
33
						<input type="hidden" name="notify_url" value="{$payment_info.paypal_ipn|escape}" />
34
					{/if}
35 36 37
					{tr}Pay with Credit Card through Paypal:{/tr} <input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_paynow_LG.gif" alt="PayPal" title="{tr}Pay with Paypal{/tr}"/> 
					<br /><input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif" border="0" alt="PayPal" />
				</form> 
38
			{elseif $prefs.payment_system eq 'cclite' && $prefs.payment_cclite_gateway neq ''}
39
				{if (!empty($ccresult) or !empty($ccresult2)) and $ccresult_ok}
40 41 42 43 44 45
					<form action="{query _type='relative'}" method="post">
						<input type="hidden" name="invoice" value="{$payment_info.paymentRequestId|escape}" />
						<input type="hidden" name="cookietab" value="1" />
						<input type="submit" value="{tr}Refresh page{/tr}" />
					</form>
					{remarksbox title="{tr}Payment info{/tr}" type="info"}
46 47
						{$ccresult}<br />
						{$ccresult2}
48 49 50 51 52
					{/remarksbox}
				{else}
					<form action="{query _type='relative'}" method="post">
						<input type="hidden" name="invoice" value="{$payment_info.paymentRequestId|escape}" />
						<input type="hidden" name="cclite_payment_amount" value="{$payment_info.amount_remaining|escape}" />
53
						<input type="submit" value="{tr}Trade with Cclite{/tr}" />
54
					</form>
55
					{if (!empty($ccresult) or !empty($ccresult2))}
56
						{remarksbox title="{tr}Payment problem{/tr}" type="info"}
57 58
							{$ccresult}<br />
							{$ccresult2}
59 60 61
						{/remarksbox}
					{/if}
				{/if}
62 63 64 65 66 67 68 69 70 71 72 73
			{elseif $prefs.payment_system eq 'tikicredits'}
				<form action="{query _type='relative'}" method="post">
					{tr}Pay with Tiki User Credits:{/tr} 
					<table class="normal">
						<tr>
							<th>{tr}Credit type{/tr}</th>
							<th>{tr}Credits left{/tr}</th>
							<th>{tr}Amount to pay{/tr}</th>
							<th>{tr}Pay using{/tr}</th>
						</tr>
						{foreach key=id item=data from=$userpaycredits}
						<tr>
74 75 76 77
							<td class="text">{$data.display_text|escape}</td>
							<td class="text">{$data.remain|escape}</td>
							<td class="integer">{$data.price|escape}</td>
							<td class="text"><input type="radio" name="tiki_credit_type" value="{$id|escape}" {if !$data.enough}disabled="disabled"{/if} /></td>
78 79 80 81 82 83 84 85 86 87 88
						</tr>
						{/foreach}
						<tr>
							<td colspan="4">
								<input type="hidden" name="invoice" value="{$payment_info.paymentRequestId|escape}" />
								<input type="hidden" name="tiki_credit_amount" value="{$payment_info.amount_remaining|escape}" />
								<input type="submit" name="tiki_credit_pay" value="{tr}Pay with Tiki User Credits{/tr}" />
							</td>
						</tr>
					</table>
				</form>
89
			{/if}
90
			
91 92 93
			{if !empty($prefs.payment_manual)}
				{capture name=wp_payment_manual}wiki:{$prefs.payment_manual}{/capture}
				{include file=$smarty.capture.wp_payment_manual}
94
			{/if}
95 96 97 98
		{/if}
	</p>

	{if $payment_info.fullview && $payment_info.payments|@count}
99
		{if count($payment_info.payments) ne 1}<ol>{else}<ul>{/if}
100 101 102
			{foreach from=$payment_info.payments item=payment}
				<li>
					{if $payment.type eq 'user'}
103
						{include file='tiki-payment-user.tpl' payment=$payment currency=$payment_info.currency}
104
					{elseif $payment.type eq 'paypal'}
105
						{include file='tiki-payment-paypal.tpl' payment=$payment}
106
					{elseif $payment.type eq 'cclite'}
107
						{include file='tiki-payment-cclite.tpl' payment=$payment}
108
					{elseif $payment.type eq 'tikicredits'}
109
						{include file='tiki-payment-tikicredits.tpl' payment=$payment}
110 111 112
					{/if}
				</li>
			{/foreach}
113
		{if count($payment_info.payments) ne 1}</ol>{else}</ul>{/if}
114 115 116 117 118 119 120 121 122
	{/if}

	{if $payment_info.state eq 'outstanding' || $payment_info.state eq 'overdue'}

		{permission type=payment object=$payment.paymentRequestId name=payment_manual}
			<form method="post" action="tiki-payment.php">
				<fieldset>
					<legend>{tr}Manual payment entry{/tr}</legend>

123
					<p><input type="text" name="manual_amount" class="right" />&nbsp;{$payment_info.currency|escape}</p>
124 125
					<p><label for="payment-note">{tr}Note{/tr}</label></p>
					<p><textarea id="payment-note" name="note" style="width: 98%;" rows="6"></textarea></p>
126
					<p><input type="submit" value="{tr}Enter payment{/tr}" /><input type="hidden" name="invoice" value="{$payment_info.paymentRequestId|escape}" /></p>
127 128 129 130 131
				</fieldset>
			</form>
		{/permission}
	{/if}
</div>