tpaga 0.4.3.1 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef867960bb07f3111083e37fb167d82ee2991d7b
4
- data.tar.gz: 6611bc51f6ff5af18420becd4476ac0b217bebcd
3
+ metadata.gz: 83c8b3f51adb0e6fe9aca0c357530a6abc1cf4a8
4
+ data.tar.gz: dd0ea4ba5196633acfe7185732a81ba96b20ece6
5
5
  SHA512:
6
- metadata.gz: f87f8383f62626c84d4f494f64a9b2a39044ec2e71d2abd8b71b134a40864d8c5caecbf7764e3298257e202538ae43836937a4917f6a648fa1487be71276d380
7
- data.tar.gz: 5772923c50f6fb1bb113db0c57805cd07623f43b6ae9849b47635eb0d5f403c11c9bff47d8dabf7fb944ba39b636ee6038c19b6b7e4d8586d15e33120a9eb88d
6
+ metadata.gz: 995b03a1e0bc33e1033d81bd989770ddf408600e976d53db226ca508982f97e8a7ba97dced509b289210c671f77a387aeb48cd529c3b0ef97907d731c682ebef
7
+ data.tar.gz: 00765b28c9254b1f90925ed78cef9fe7d354707c7b2380713b14916e44e94cb6800734cee97cd8b94099a8675622b60786bfd877fe322e3a587c994bb932e617
@@ -22,6 +22,7 @@ require 'tpaga/models/davi_plata_chargeback'
22
22
  require 'tpaga/models/davi_plata_verification'
23
23
  require 'tpaga/models/api_errors_item'
24
24
  require 'tpaga/models/api_error'
25
+ require 'tpaga/models/token'
25
26
 
26
27
  # APIs
27
28
  require 'tpaga/api/chargeback_api'
@@ -30,6 +31,7 @@ require 'tpaga/api/davi_plata_api'
30
31
  require 'tpaga/api/charge_api'
31
32
  require 'tpaga/api/credit_card_api'
32
33
  require 'tpaga/api/refund_api'
34
+ require 'tpaga/api/token_api'
33
35
 
34
36
  module Tpaga
35
37
  # Initialize the default configuration
@@ -0,0 +1,61 @@
1
+ require "uri"
2
+
3
+ module Tpaga
4
+ class TokenApi
5
+ basePath = "https://sandbox.tpaga.co/api"
6
+
7
+ # Adds a new Credit Card payment method to the Customer
8
+ # Creates a new `CreditCard` and associates it to the `Customer`
9
+ # @param customer_id Identificaiton of `Customer` to associate the new `CreditCard`
10
+ # @param body The `Token` object which representes the `CreditCard` to be associated to the `Customer`\n- **token** the identification of the token which represents the `CreditCard`.
11
+ # @param [Hash] opts the optional parameters
12
+ # @return [CreditCard]
13
+ def self.add_credit_card_token(customer_id, body, opts = {})
14
+
15
+ # verify the required parameter 'customer_id' is set
16
+ raise "Missing the required parameter 'customer_id' when calling add_credit_card_token" if customer_id.nil?
17
+
18
+ # verify the required parameter 'body' is set
19
+ raise "Missing the required parameter 'body' when calling add_credit_card_token" if body.nil?
20
+
21
+ # resource path
22
+ path = "/customer/{customer_id}/credit_card_token".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s)
23
+
24
+ # query parameters
25
+ query_params = {}
26
+
27
+ # header parameters
28
+ header_params = {}
29
+
30
+ # HTTP header 'Accept' (if needed)
31
+ _header_accept = ['application/json']
32
+ _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
33
+
34
+ # HTTP header 'Content-Type'
35
+ _header_content_type = []
36
+ header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
37
+
38
+ # form parameters
39
+ form_params = {}
40
+
41
+ # http body (model)
42
+ post_body = Swagger::Request.object_to_http_body(body)
43
+
44
+
45
+ auth_names = ['api_key']
46
+ response = Swagger::Request.new(:POST, path,
47
+ {:params => query_params,
48
+ :headers => header_params,
49
+ :form_params => form_params,
50
+ :body => post_body,
51
+ :auth_names => auth_names}).make.body
52
+ obj = CreditCard.new() and obj.build_from_hash(response)
53
+
54
+
55
+ end
56
+ end
57
+ end
58
+
59
+
60
+
61
+
@@ -0,0 +1,45 @@
1
+ module Tpaga
2
+ #
3
+ class Token < BaseObject
4
+ attr_accessor :token, :used
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ # The token identification
10
+ :'token' => :'token',
11
+
12
+ # If the token was already used
13
+ :'used' => :'used'
14
+
15
+ }
16
+ end
17
+
18
+ # attribute type
19
+ def self.swagger_types
20
+ {
21
+ :'token' => :'String',
22
+ :'used' => :'BOOLEAN'
23
+
24
+ }
25
+ end
26
+
27
+ def initialize(attributes = {})
28
+ return if !attributes.is_a?(Hash) || attributes.empty?
29
+
30
+ # convert string to symbol for hash key
31
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
32
+
33
+
34
+ if attributes[:'token']
35
+ @token = attributes[:'token']
36
+ end
37
+
38
+ if attributes[:'used']
39
+ @used = attributes[:'used']
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+ end
@@ -1,5 +1,5 @@
1
1
  module Tpaga
2
2
  module Swagger
3
- VERSION = "0.4.3.1"
3
+ VERSION = "0.4.4"
4
4
  end
5
5
  end
Binary file
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.authors = ["Sebastian Ortiz V."]
11
11
  s.email = ["sebastian@tpaga.co"]
12
12
  s.homepage = "https://tpaga.co"
13
+ s.license = 'Apache License, v2.0'
13
14
  s.summary = %q{TPaga API Ruby Bindings powered by Swagger}
14
15
  s.description = %q{TPaga Payment Gateway API
15
16
 
@@ -22,7 +23,6 @@ Gem::Specification.new do |s|
22
23
  s.add_runtime_dependency 'json', '~> 1.4', '>= 1.4.6'
23
24
 
24
25
  s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? }
25
- s.test_files = `find spec/*`.split("\n")
26
26
  s.executables = []
27
27
  s.require_paths = ["lib"]
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tpaga
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3.1
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Ortiz V.
@@ -89,6 +89,7 @@ files:
89
89
  - lib/tpaga/api/customer_api.rb
90
90
  - lib/tpaga/api/davi_plata_api.rb
91
91
  - lib/tpaga/api/refund_api.rb
92
+ - lib/tpaga/api/token_api.rb
92
93
  - lib/tpaga/models/address.rb
93
94
  - lib/tpaga/models/api_error.rb
94
95
  - lib/tpaga/models/api_errors_item.rb
@@ -104,15 +105,18 @@ files:
104
105
  - lib/tpaga/models/davi_plata_charge.rb
105
106
  - lib/tpaga/models/davi_plata_chargeback.rb
106
107
  - lib/tpaga/models/davi_plata_verification.rb
108
+ - lib/tpaga/models/token.rb
107
109
  - lib/tpaga/monkey.rb
108
110
  - lib/tpaga/swagger.rb
109
111
  - lib/tpaga/swagger/configuration.rb
110
112
  - lib/tpaga/swagger/request.rb
111
113
  - lib/tpaga/swagger/response.rb
112
114
  - lib/tpaga/swagger/version.rb
115
+ - tpaga-0.4.3.1.gem
113
116
  - tpaga.gemspec
114
117
  homepage: https://tpaga.co
115
- licenses: []
118
+ licenses:
119
+ - Apache License, v2.0
116
120
  metadata: {}
117
121
  post_install_message:
118
122
  rdoc_options: []
@@ -130,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
134
  version: '0'
131
135
  requirements: []
132
136
  rubyforge_project:
133
- rubygems_version: 2.4.6
137
+ rubygems_version: 2.4.8
134
138
  signing_key:
135
139
  specification_version: 4
136
140
  summary: TPaga API Ruby Bindings powered by Swagger