Class: Api::Vendor::V1::Pointx::ConversionRateController

Inherits:
BaseController show all
Defined in:
app/controllers/api/vendor/v1/pointx/conversion_rate_controller.rb

Overview

PointX conversion rate API for internal frontend team POST /api/vendor/v1/pointx/conversion_rate

Instance Method Summary collapse

Methods inherited from BaseController

#authenticate!, #identity_cache_memoization

Methods inherited from ApplicationController

#after_sign_in_path_for, #after_sign_out_path_for, #default_url_options, #identity_cache_memoization, #render_not_found, #routing_error, search_params_key=

Methods included from LogrageCustomLogger

#append_info_to_payload

Methods included from ControllerHelpers

#check_boolean_param, #get_banners, #inventory_params, #reservation_params

Instance Method Details

#showObject

Returns PointX conversion rate from AdminSetting for frontend UI



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/api/vendor/v1/pointx/conversion_rate_controller.rb', line 9

def show
  render json: {
    pointx_conversion_rate: AdminSetting.pointx_conversion_rate,
  }, status: :ok
rescue StandardError => e
  BUSINESS_LOGGER.set_business_context({ vendor_name: ApiVendorV1::Constants::POINTX_VENDOR_NAME })
  BUSINESS_LOGGER.error('Error retrieving PointX conversion rate', { error: e.message })
  APMErrorHandler.report(e.message, context: { controller: 'pointx', action: 'conversion_rate' })

  render json: {
    error: 'Sorry, Something went wrong',
  }, status: :internal_server_error
end