This commit is contained in:
Myat Zin Wai Maw
2019-12-09 17:27:38 +06:30
parent b0f6368248
commit 5b3a62917d
16 changed files with 509 additions and 263 deletions

View File

@@ -533,11 +533,8 @@ class SalePayment < ApplicationRecord
payment_status = false
#Next time - validate if the vochure number is valid - within
# customer_data = Customer.find_by_customer_id(self.sale.customer_id)
account_no = self.payment_reference
# if account_no.to_i <= 0
# account_no = customer_data.membership_id
# end
# self.sale.customer.update_attributes(paypar_account_no: )
membership_setting = MembershipSetting.find_by_membership_type_and_shop_code("paypar_url",self.sale.shop_code)
membership_data = SalePayment.create_payment(membership_setting.gateway_url,"PAYMAL",account_no,self.received_amount,self.sale.sale_id)
@@ -548,7 +545,7 @@ class SalePayment < ApplicationRecord
if membership_data["status"]==true
self.payment_method = "paymal"
self.payment_amount = self.received_amount
self.payment_reference = self.voucher_no
# self.payment_reference = self.voucher_no
self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f
self.payment_status = "paid"
payment_status = self.save!