Module: Culqi::Update

Included in:
Customer, Order
Defined in:
lib/operation/update.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



6
7
8
# File 'lib/operation/update.rb', line 6

def initialize
  @url = ''
end

#update(id, params = {}, rsa_key = '', rsa_id = '') ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/operation/update.rb', line 10

def update(id, params={}, rsa_key='', rsa_id='')
  error = verifyClassValidationGet(@url, id)
  if error
    return error
  end
  if(rsa_key != '')
    params = Encrypt.encrypt_with_aes_rsa(params, rsa_key, true)
  end
  response, statusCode = Culqi.connect("#{@url}#{id}/", Culqi.secret_key, params, 'patch', Culqi::READ_TIMEOUT, rsa_id)
  return response, statusCode
end