Module: Culqi::Post

Included in:
Card, Charge, Customer, Order, Plan, Refund, Subscription, Token, Yape
Defined in:
lib/operation/post.rb

Instance Method Summary collapse

Instance Method Details

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



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/operation/post.rb', line 9

def create(params={}, rsa_key='', rsa_id='')
  key = ''
  puts params
  if @url.include? 'token'
    if(rsa_key != '')
      params = Encrypt.encrypt_with_aes_rsa(params, rsa_key, true)
    end
    key = Culqi.public_key 
    response, statuscode = Culqi.connect(@url, key, params, 'post', Culqi::READ_TIMEOUT, true, rsa_id)
    return response, statuscode
  else
    key = Culqi.secret_key
    response, statuscode = Culqi.connect(@url, key, params, 'post', Culqi::READ_TIMEOUT, false, '')
    return response, statuscode
  end
  
end

#initializeObject



5
6
7
# File 'lib/operation/post.rb', line 5

def initialize
  @url = ''
end