Module: PayPal::SDK::Core::OpenIDConnect::SetAPI

Included in:
RequestDataType
Defined in:
lib/paypal-sdk/core/openid_connect/set_api.rb

Instance Method Summary collapse

Instance Method Details

#client_id=(client_id) ⇒ Object

Override client id



25
26
27
# File 'lib/paypal-sdk/core/openid_connect/set_api.rb', line 25

def client_id=(client_id)
  set_config(:client_id => client_id)
end

#client_secret=(client_secret) ⇒ Object

Override client secret



30
31
32
# File 'lib/paypal-sdk/core/openid_connect/set_api.rb', line 30

def client_secret=(client_secret)
  set_config(:client_secret => client_secret)
end

#set_config(*args) ⇒ Object Also known as: config=, set_api, api=

Set new api

Examples

payment.set_config(:development)
payment.set_config(:client_id => "XYZ", :client_secret => "SECRET")
payment.set_config
payment.api = API.new(:development)


11
12
13
14
15
16
17
18
19
# File 'lib/paypal-sdk/core/openid_connect/set_api.rb', line 11

def set_config(*args)
  if args[0].is_a?(API)
    @api = args[0]
  else
    @api ||= API.new({})
    @api.set_config(*args)  # Just override the configuration and Not
    @api
  end
end