class PaymentGatewayAudit < ApplicationRecord
  def self.record(
    receipt_no:,
    gateway_name:,
    request_method: nil,
    endpoint_url:,
    event_type:,
    request_body: {},
    response_body: {},
    shop_code:
  )
    payment_gateway_audit = PaymentGatewayAudit.new
    payment_gateway_audit.receipt_no = receipt_no
    payment_gateway_audit.payment_gateway_name = gateway_name
    payment_gateway_audit.event_type = event_type
    payment_gateway_audit.request_method = request_method
    payment_gateway_audit.endpoint_url = endpoint_url
    payment_gateway_audit.request_body = request_body
    payment_gateway_audit.response_body = response_body
    payment_gateway_audit.shop_code = shop_code

    payment_gateway_audit.save!
  end
end
