<xf:title>{{ phrase('payment_provider_log') }}</xf:title>

<div class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:formrow label="{{ phrase('action') }}">
				{{ $entry.log_type == 'payment' ? phrase('payment')
					: ($entry.log_type == 'info' ? phrase('information')
					: ($entry.log_type == 'error' ? phrase('error')
					: ($entry.log_type == 'cancel' ? phrase('cancellation')
					: ($entry.log_type))))
				}}{$xf.language.label_separator}
				<span dir="auto">{$entry.log_message}</span>
			</xf:formrow>

			<xf:formrow label="{{ phrase('user') }}">
				<xf:if is="$purchaseRequest.User">
					<xf:username user="$purchaseRequest.User" href="{{ link('logs/payment-provider', null, {'user_id': $purchaseRequest.User.user_id}) }}" />
				<xf:else />
					{{ phrase('unknown_user') }}
				</xf:if>
			</xf:formrow>

			<xf:formrow label="{{ phrase('date') }}">
				<xf:date time="{$entry.log_date}" />
			</xf:formrow>

			<xf:formrow label="{{ phrase('purchase_request_key') }}">
				<xf:if is="$entry.purchase_request_key">
					<a href="{{ link('logs/payment-provider', null, {'purchase_request_key': $entry.purchase_request_key}) }}">
						{$entry.purchase_request_key}
					</a>
				<xf:else />
					{{ phrase('n_a') }}
				</xf:if>
			</xf:formrow>

			<xf:formrow label="{{ phrase('transaction_id') }}">
				<xf:if is="$entry.transaction_id">
					<a href="{{ link('logs/payment-provider', null, {'transaction_id': $entry.transaction_id}) }}">
						{$entry.transaction_id}
					</a>
				<xf:else />
					{{ phrase('n_a') }}
				</xf:if>
			</xf:formrow>

			<xf:formrow label="{{ phrase('subscriber_id') }}">
				<xf:if is="$entry.subscriber_id">
					<a href="{{ link('logs/payment-provider', null, {'subscriber_id': $entry.subscriber_id}) }}">
						{$entry.subscriber_id}
					</a>
				<xf:else />
					{{ phrase('n_a') }}
				</xf:if>
			</xf:formrow>

			<xf:formrow label="{{ phrase('payment_profile') }}">
				<xf:if is="$purchaseRequest.PaymentProfile">
					<a href="{{ link('logs/payment-provider', null, {'payment_profile_id': $purchaseRequest.PaymentProfile.payment_profile_id}) }}">
						{$purchaseRequest.PaymentProfile.title}
					</a>
				<xf:else />
					{{ phrase('unknown_profile') }}
				</xf:if>
			</xf:formrow>
		</div>
	</div>
</div>

<xf:if is="$purchasable && $purchasableItem">
	<div class="block">
		<div class="block-container">
			<div class="block-body">
				<xf:formrow label="{{ phrase('purchasable_details') }}">
					<a href="{{ link('logs/payment-provider', null, {'purchasable_type_id': {$purchasable.purchasable_type_id}}) }}">
						{$purchasable.title}
					</a>
				</xf:formrow>

				<xf:formrow label="{{ phrase('purchasable_item') }}">
					<a href="{$purchasableItem.link}">{$purchasableItem.title}</a>
				</xf:formrow>
			</div>
		</div>
	</div>
</xf:if>

<div class="block">
	<div class="block-container">
		<h2 class="block-header">{{ phrase('log_details') }}</h2>
		<div class="block-body block-body--contained block-row" dir="ltr">
			{{ dump_simple($entry.log_details) }}
		</div>
	</div>
</div>