Class: Mercadopago::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/mercadopago/config/config.rb

Overview

Holds SDK-wide configuration constants: version, API base URL, User-Agent header, tracking identifiers, and MIME types.

Instances are created internally by MPBase and RequestOptions; there is no need to instantiate this class directly.

Constant Summary collapse

@@VERSION =

Current SDK version following SemVer.

'3.0.1'
@@USER_AGENT =

User-Agent string sent with every HTTP request for server-side tracking.

"MercadoPago Ruby SDK v#{@@VERSION}"
@@PRODUCT_ID =

Internal product identifier registered with the MercadoPago platform.

'bc32a7vtrpp001u8nhjg'
@@TRACKING_ID =

Tracking string that reports Ruby version and SDK version to the API.

"platform:#{RUBY_VERSION},type:SDK#{@@VERSION},so;"
@@API_BASE_URL =

Base URL for all MercadoPago REST API endpoints.

'https://api.mercadopago.com'
@@MIME_JSON =

MIME type used for JSON request/response bodies.

'application/json'
@@MIME_FORM =

MIME type used for form-encoded request bodies.

'application/x-www-form-urlencoded'

Instance Method Summary collapse

Instance Method Details

#api_base_urlString

Returns MercadoPago API base URL.

Returns:

  • (String)

    MercadoPago API base URL



53
54
55
# File 'lib/mercadopago/config/config.rb', line 53

def api_base_url
  @@API_BASE_URL
end

#mime_formString

Returns form-encoded MIME type.

Returns:

  • (String)

    form-encoded MIME type



63
64
65
# File 'lib/mercadopago/config/config.rb', line 63

def mime_form
  @@MIME_FORM
end

#mime_jsonString

Returns JSON MIME type.

Returns:

  • (String)

    JSON MIME type



58
59
60
# File 'lib/mercadopago/config/config.rb', line 58

def mime_json
  @@MIME_JSON
end

#product_idString

Returns MercadoPago internal product identifier.

Returns:

  • (String)

    MercadoPago internal product identifier



43
44
45
# File 'lib/mercadopago/config/config.rb', line 43

def product_id
  @@PRODUCT_ID
end

#tracking_idString

Returns tracking string with Ruby and SDK versions.

Returns:

  • (String)

    tracking string with Ruby and SDK versions



48
49
50
# File 'lib/mercadopago/config/config.rb', line 48

def tracking_id
  @@TRACKING_ID
end

#user_agentString

Returns User-Agent header value.

Returns:

  • (String)

    User-Agent header value



38
39
40
# File 'lib/mercadopago/config/config.rb', line 38

def user_agent
  @@USER_AGENT
end

#versionString

Returns current SDK version (e.g. “3.0.0”).

Returns:

  • (String)

    current SDK version (e.g. “3.0.0”)



33
34
35
# File 'lib/mercadopago/config/config.rb', line 33

def version
  @@VERSION
end