kbz pay method
This commit is contained in:
@@ -105,17 +105,17 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
#TODO :: KBZPAY ( QR )
|
||||
# On/Off setting ( show or not qr )
|
||||
# qrCode = "00020101021202021110500346KBZ005ab0ed5c1ed09d1c4585ff1313170389160831435294600062000040732kp1e78f7efddca190042638341afb88d50200006KBZPay0106KBZPay5303MMK5802MM62170813PAY_BY_QRCODE64060002my6304FBBD"
|
||||
kbz_pay_setting = PaymentMethodSetting.where(:payment_method => KbzPay::KBZ_PAY).last
|
||||
kbz_pay_method = PaymentMethodSetting.where(:payment_method => KbzPay::KBZ_PAY).last
|
||||
|
||||
status = false
|
||||
qr = nil
|
||||
|
||||
if !kbz_pay_setting.nil?
|
||||
if kbz_pay_setting.is_active == true
|
||||
if !kbz_pay_method.nil?
|
||||
if kbz_pay_method.is_active == true
|
||||
sale_payment = SalePayment.new
|
||||
sale_payment.process_kbz_payment(sale_id, sale_data.grand_total, 0, 'pending')
|
||||
|
||||
status, qr = KbzPay.pay(sale_data.grand_total, sale_payment.sale_payment_id)
|
||||
status, qr = KbzPay.pay(sale_data.grand_total, sale_payment.sale_payment_id, kbz_pay_method.gateway_url, kbz_pay_method.auth_token, kbz_pay_method.merchant_account_id, kbz_pay_method.additional_parameters)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2,16 +2,20 @@ class KbzPay
|
||||
|
||||
KBZ_PAY = 'KBZPay'
|
||||
|
||||
def self.pay(amount, receipt_no)
|
||||
def self.pay(amount, receipt_no, url, key, app_id, code)
|
||||
|
||||
datetime = DateTime.now.strftime("%d%m%Y%H%M")
|
||||
kbz_app_id = "kp1e78f7efddca190042638341afb88d"
|
||||
kbz_merch_code = "200004"
|
||||
kbz_app_id = app_id
|
||||
kbz_merch_code = code
|
||||
# kbz_app_id = "kp1e78f7efddca190042638341afb88d"
|
||||
# kbz_merch_code = "200004"
|
||||
kbz_method = 'kbz.payment.precreate'
|
||||
kbz_trade_type = "PAY_BY_QRCODE"
|
||||
kbz_api_key = "code2lab123456"
|
||||
kbz_api_key = key
|
||||
# kbz_api_key = "code2lab123456"
|
||||
kbz_version = "1.0"
|
||||
kbz_provider_url = "http://api.kbzpay.com/payment/gateway/uat/precreate"
|
||||
kbz_provider_url = url
|
||||
# kbz_provider_url = "http://api.kbzpay.com/payment/gateway/uat/precreate"
|
||||
kbz_currency = "MMK"
|
||||
kbz_callback_url = "https://staging-v2.doemal.com/api/v3/ordering/kbz_callback"
|
||||
nounce_str = SecureRandom.base64(32).first(32).upcase
|
||||
|
||||
Reference in New Issue
Block a user