Class: Culqi::Token

Inherits:
Object
  • Object
show all
Extended by:
Get, List, Post
Defined in:
lib/culqi/token.rb

Constant Summary collapse

URL =
'/tokens/'

Class Method Summary collapse

Methods included from List

initialize, list, verifyClassValidationList

Methods included from Post

create, initialize, verifyClassValidation

Methods included from Get

get, initialize, verifyClassValidationGet

Class Method Details

.createYape(params = {}, rsa_key = '', rsa_id = '') ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/culqi/token.rb', line 17

def self.createYape(params={}, rsa_key='', rsa_id='')
  begin
    key = ''
    puts params
    if @url.include? 'token'
      TokenValidation.create_token_yape_validation(params)
      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
    end
  rescue CustomException => e
    return e.message
  end
end