callback kbzpay
This commit is contained in:
15
app/controllers/api/payment/callback_controller.rb
Normal file
15
app/controllers/api/payment/callback_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class Api::Payment::CallbackController < Api::ApiController
|
||||
|
||||
skip_before_action :authenticate
|
||||
|
||||
def kbzpay
|
||||
Rails.logger.info params[:Request]
|
||||
callback_value = params[:Request]
|
||||
trade_status = params[:Request][:trade_status]
|
||||
total_amount = params[:Request][:total_amount]
|
||||
if trade_status == "PAY_SUCCESS"
|
||||
merch_order_id = params[:Request][:merch_order_id]
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -53,8 +53,4 @@ class Api::Payment::MobilepaymentController < Api::ApiController
|
||||
|
||||
end
|
||||
|
||||
def kbz_pay
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -102,6 +102,8 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
|
||||
status, qr = KbzPay.pay(amount, receipt_no)
|
||||
|
||||
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount,nil,nil,nil)
|
||||
|
||||
result = {
|
||||
|
||||
Reference in New Issue
Block a user