add paymal payment

This commit is contained in:
phyusin
2018-03-30 16:53:38 +06:30
parent ac5987fbb5
commit fc8d8eea4a
6 changed files with 51 additions and 54 deletions

2
Gemfile Executable file → Normal file
View File

@@ -1,5 +1,5 @@
source 'https://rubygems.org'
ruby '2.4.0'
ruby '2.4.1'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"

0
Gemfile.lock Executable file → Normal file
View File

View File

@@ -26,7 +26,7 @@ _MASTER_ = "/   MASTER PAYMENT";
_MPU_ = "/   MPU PAYMENT";
_ALIPAY_ = "/   Alipay";
_JUNCTIONPAY_ = "/   JunctionPay";
_PAYMAL_ = "/   Paymal";
_PAYMAL_ = "/   PAYMAL";
_OTHER_CHARGES_ = "/   CHARGES";
_OTHER_PAYMENTS_ = "/   OTHER PAYMENT";
_PAYMENTS_ = "/   PAYMENT";

View File

@@ -49,15 +49,12 @@ class SalePayment < ApplicationRecord
payment_status = paypar_payment
when "foc"
payment_status = foc_payment
<<<<<<< HEAD
when "paymal"
payment_status = paymal_payment
=======
when "JunctionPay"
payment_status = junction_pay_payment
when "alipay"
payment_status = external_terminal_card_payment(:alipay)
>>>>>>> 996392a041cb5f92a3b2985cbd0379210132d829
else
puts "it was something else"
end
@@ -360,7 +357,6 @@ class SalePayment < ApplicationRecord
end
<<<<<<< HEAD
def paymal_payment
payment_status = false
@@ -386,7 +382,10 @@ class SalePayment < ApplicationRecord
else
sale_update_payment_status(0)
end
=======
return payment_status
end
def junction_pay_payment
payment_status = false
@@ -398,10 +397,7 @@ class SalePayment < ApplicationRecord
self.payment_status = "paid"
payment_method = self.save!
sale_update_payment_status(self.received_amount)
>>>>>>> 996392a041cb5f92a3b2985cbd0379210132d829
return payment_status
end
def sale_update_payment_status(paid_amount,check_foc = false)

View File

@@ -9,7 +9,6 @@
</span>
</ol>
</div> -->
<h5>PayMal Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-5">
<div class="card m-l-10 m-t-10" style="padding:0px 20px;">
@@ -110,11 +109,13 @@
<script type="text/javascript">
var cashier_type = "<%= @cashier_type %>";
$(document).ready(function() {
setHeaderBreadCrumb(_PAYMAL_);
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
else {
$('#paymentamt').attr("value",parseFloat("<%= @payment_prices %>") - parseFloat(localStorage.getItem("cash")));
}
});
$(document).on('click', '.cashier_number', function(event){
event.stopPropagation();
event.preventDefault();