Skip to content

Instantly share code, notes, and snippets.

@iaditya
Created May 25, 2017 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaditya/9de11a5f32bd0fa254af4c1ab0b58eb0 to your computer and use it in GitHub Desktop.
Save iaditya/9de11a5f32bd0fa254af4c1ab0b58eb0 to your computer and use it in GitHub Desktop.
<div class="payments form col-lg-10 col-md-9 columns">
<?= $this->Form->create($payment);
//$url = $this->Url->build()
?>
<fieldset>
<legend><?= __('Submit Payment') ?></legend>
<div style="float: right">
<?= $this->Html->link('Cancel Appointment', ['controller' => 'Events', 'action' => 'cancelAppointment', $event_id], ['class' => 'btn-primary btn']) ?>
</div>
<?php
echo $this->Form->hidden('user_id', ['value' => $user->id]);
echo $this->Form->hidden('patient_id', ['value' => $patient_id]);
echo $this->Form->hidden('provider_id', ['value' => $provider_id]);
echo $this->Form->hidden('facility_id', ['value' => $facility_id]);
echo $this->Form->hidden('slots', ['value' => $slots]);
echo $this->Form->hidden('event_id', ['value'=>$event_id]);
echo $this->Form->hidden('payment_date');
echo $this->Form->hidden('currency',['value' => 'INR']);
// echo $this->Form->input('discount_id', ['options' => $discounts, 'empty' => true]);
echo "<BR> <B>";
echo "Number of Slots Booked:".$slots;
echo "<BR> ";
echo "Fees Per Slot: Rs.".$paymentsetting->price_per_slot_india;
echo "<BR> ";
echo "Total Slot Fees: Rs.".$paymentsetting->price_per_slot_india*$slots;
echo "<BR> ";
echo "Convenience Charges: Rs.".$tdsetting->domestic_convenience_fee;
echo "<BR> ";
$total_payment = ($paymentsetting->price_per_slot_india*$slots)+ $tdsetting->domestic_convenience_fee;
$payment_gateway_fees = $tdsetting->domestic_processing_fee +
(($total_payment*$tdsetting->domestic_processing_percent)/100);
echo "Payment Gateway Charges: Rs.".$payment_gateway_fees ;
echo "<BR> ";
$total_amount = $total_payment + $payment_gateway_fees;
echo "Total Fees: Rs.".$total_amount ;
echo "</B>";
echo "<BR> ";
echo "<BR> ";
echo "<BR> ";
echo $this->Form->hidden('total_amount',['value' => $total_amount]);
echo $this->Form->hidden('discount_amount',['value' => 0]);
echo $this->Form->hidden('final_amount' ,['value' => $total_amount]);
// echo $this->Form->input('transactionid');
//echo $this->Form->input('status');
echo $this->Form->hidden('tid',['id'=>'id']);
echo $this->Form->hidden('language',['value' => 'EN']);
// echo $this->Form->hidden('redirect_url',['value'=> $this->Url->build(array('controller' => 'payments', 'action' => 'ccavResponseHandler'), true)]);
// echo $this->Form->hidden('cancel_url',['value'=> $this->Url->build(array('controller' => 'payments', 'action' => 'ccavResponseHandler'), true)]);
if (IS_PROD) {
echo $this->Form->hidden('redirect_url',['value'=> 'https://app.talkadoc.com/payments/ccavResponseHandler']);
echo $this->Form->hidden('cancel_url',['value'=> 'https://app.talkadoc.com/payments/ccavResponseHandler']);
}
if (IS_TEST) {
echo $this->Form->hidden('redirect_url',['value'=> 'http://testapp.talkadoc.com/payments/ccavResponseHandler']);
echo $this->Form->hidden('cancel_url',['value'=> 'http://testapp.talkadoc.com/payments/ccavResponseHandler']);
}
echo $this->Form->input('billing_email',['required'=>true,'value' => $user->email]);
echo $this->Form->input('billing_name' ,['value' => $user->full_name,'required'=>true]);
$billing_address = ($patient->patient_address['door_number'] ? $patient->patient_address['door_number'] : "") .($patient->patient_address['apartment_name'] ? $patient->patient_address['apartment_name'] : "");
echo $this->Form->input('billing_address' ,['required'=>true,'value' => $billing_address]);
echo $this->Form->input('billing_city' ,['required'=>true,'value' => $patient->patient_address['city']]);
// echo $this->Form->input('billing_district' ,['required'=>true,'value' => $patient->patient_address['district']]);
echo $this->Form->input('billing_state' ,['required'=>true,'value' => $patient->patient_address['state']['name']]);
echo $this->Form->input('billing_zip' ,['required'=>true,'value' => $patient->patient_address['postal_code']]);
echo $this->Form->input('billing_country' ,['required'=>true,'value' => $patient->patient_address['country']]);
echo $this->Form->input('billing_tel' ,['required'=>true,'value' => $user->mobile]);
?>
</fieldset>
<?= $this->Form->button(__('Submit'), ['class' => 'btn-success']) ?>
<?= $this->Html->link('Cancel Appointment', ['controller' => 'Events', 'action' => 'cancelAppointment', $event_id], ['class' => 'btn-primary btn', 'style' => 'float:right;']) ?>
<?= $this->Form->end() ?>
</div>
<script>
/**
window.onload = function() {
var d = new Date().getTime();
document.getElementById("tid").value = d;
};
**/
window.onbeforeunload = function (e) {
e = e || window.event;
// For IE and Firefox prior to version 4
if (e) {
e.returnValue = 'Sure?';
}
// For Safari
return 'Sure?';
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment