tpaga 0.0.3 → 0.0.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 +4 -4
- data/lib/tpaga.rb +28 -21
- data/lib/tpaga/api/charge_api.rb +133 -100
- data/lib/tpaga/api/chargeback_api.rb +88 -0
- data/lib/tpaga/api/credit_card_api.rb +220 -0
- data/lib/tpaga/api/customer_api.rb +84 -326
- data/lib/tpaga/api/davi_plata_api.rb +340 -0
- data/lib/tpaga/models/address.rb +47 -54
- data/lib/tpaga/models/api_error.rb +38 -0
- data/lib/tpaga/models/api_errors_item.rb +60 -0
- data/lib/tpaga/models/base_object.rb +85 -0
- data/lib/tpaga/models/billing_address.rb +76 -0
- data/lib/tpaga/models/city.rb +40 -51
- data/lib/tpaga/models/credit_card.rb +148 -0
- data/lib/tpaga/models/credit_card_charge.rb +116 -0
- data/lib/tpaga/models/credit_card_create.rb +76 -0
- data/lib/tpaga/models/customer.rb +68 -63
- data/lib/tpaga/models/davi_plata.rb +92 -0
- data/lib/tpaga/models/davi_plata_charge.rb +108 -0
- data/lib/tpaga/models/davi_plata_chargeback.rb +60 -0
- data/lib/tpaga/models/davi_plata_verification.rb +44 -0
- data/lib/tpaga/monkey.rb +1 -1
- data/lib/tpaga/swagger.rb +64 -87
- data/lib/tpaga/swagger/configuration.rb +24 -27
- data/lib/tpaga/swagger/request.rb +247 -192
- data/lib/tpaga/swagger/response.rb +52 -53
- data/lib/tpaga/swagger/version.rb +3 -4
- data/tpaga.gemspec +8 -9
- metadata +20 -12
- data/lib/tpaga/models/billingaddress.rb +0 -75
- data/lib/tpaga/models/charge.rb +0 -91
- data/lib/tpaga/models/creditcard.rb +0 -107
- data/lib/tpaga/models/creditcardcreate.rb +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e645d8c398c5989bdd7847ae837244f4ebcc996c
|
4
|
+
data.tar.gz: db610df63165ad8ee39972e6c513224632d3baf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b38ef1440a3eb443b9b705f83788a3f420b4dea2a7bdfbb2b1330a5629f7cedb62597e9651b038e20bbdf641ef12a12070eca14d50dd7a7acf62dcbb5d5bfaf6
|
7
|
+
data.tar.gz: 6a0ae9aaf5e100be696e00aa543fc10a61f4f2a189440278b144a75ad52cca7c65e2cd054889b885ce9d42a636005d227bb835b74355f548b1aa1e33e2bc3f2a
|
data/lib/tpaga.rb
CHANGED
@@ -1,28 +1,35 @@
|
|
1
|
-
# Create the base module
|
2
|
-
module Tpaga
|
3
|
-
|
4
1
|
# Swagger common files
|
5
|
-
require 'tpaga/monkey
|
6
|
-
require 'tpaga/swagger
|
7
|
-
require 'tpaga/swagger/configuration
|
8
|
-
require 'tpaga/swagger/request
|
9
|
-
require 'tpaga/swagger/response
|
10
|
-
require 'tpaga/swagger/version
|
11
|
-
|
2
|
+
require 'tpaga/monkey'
|
3
|
+
require 'tpaga/swagger'
|
4
|
+
require 'tpaga/swagger/configuration'
|
5
|
+
require 'tpaga/swagger/request'
|
6
|
+
require 'tpaga/swagger/response'
|
7
|
+
require 'tpaga/swagger/version'
|
12
8
|
|
13
9
|
# Models
|
14
|
-
require 'tpaga/models/
|
15
|
-
require 'tpaga/models/
|
16
|
-
require 'tpaga/models/
|
17
|
-
require 'tpaga/models/
|
18
|
-
require 'tpaga/models/
|
19
|
-
require 'tpaga/models/
|
20
|
-
require 'tpaga/models/
|
21
|
-
|
10
|
+
require 'tpaga/models/base_object'
|
11
|
+
require 'tpaga/models/city'
|
12
|
+
require 'tpaga/models/address'
|
13
|
+
require 'tpaga/models/customer'
|
14
|
+
require 'tpaga/models/credit_card'
|
15
|
+
require 'tpaga/models/credit_card_create'
|
16
|
+
require 'tpaga/models/billing_address'
|
17
|
+
require 'tpaga/models/credit_card_charge'
|
18
|
+
require 'tpaga/models/davi_plata'
|
19
|
+
require 'tpaga/models/davi_plata_charge'
|
20
|
+
require 'tpaga/models/davi_plata_chargeback'
|
21
|
+
require 'tpaga/models/davi_plata_verification'
|
22
|
+
require 'tpaga/models/api_errors_item'
|
23
|
+
require 'tpaga/models/api_error'
|
22
24
|
|
23
25
|
# APIs
|
24
|
-
require 'tpaga/api/
|
25
|
-
require 'tpaga/api/customer_api
|
26
|
-
|
26
|
+
require 'tpaga/api/chargeback_api'
|
27
|
+
require 'tpaga/api/customer_api'
|
28
|
+
require 'tpaga/api/davi_plata_api'
|
29
|
+
require 'tpaga/api/charge_api'
|
30
|
+
require 'tpaga/api/credit_card_api'
|
27
31
|
|
32
|
+
module Tpaga
|
33
|
+
# Initialize the default configuration
|
34
|
+
Swagger.configuration ||= Swagger::Configuration.new
|
28
35
|
end
|
data/lib/tpaga/api/charge_api.rb
CHANGED
@@ -1,135 +1,168 @@
|
|
1
1
|
require "uri"
|
2
2
|
|
3
3
|
module Tpaga
|
4
|
-
class
|
5
|
-
|
6
|
-
|
4
|
+
class ChargeApi
|
5
|
+
basePath = "https://sandbox.tpaga.co/api"
|
6
|
+
# apiInvoker = APIInvoker
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
# Adds a new CreditCardCharge to Customer's CreditCard
|
9
|
+
# Creates a new `CreditCardCharge` and associates it to a `CreditCard`.
|
10
|
+
# @param body The `CreditCardCharge` object to be generated to a `CreditCard` it has the following fields\n- **id** its the id of the `CreditCardCharge` thats going to be generated after creation.\n- **creditCard** which is the identificator of the `CreditCard` to be charged\n- **customer** which is the id of the `Customer` associated with the `CreditCard`\n- **amount** which is the full amount of the charge\n- **currency** its the 3-letter ISO code for the currency.\n- **installments** its the amount of payments to divide the charge amount, it can be minumum 1 maximum 36\n- **taxAmount** the amount that accounts as taxes.\n- **paid** its the status of the charge. true if its paid, false if its not.\n- **description** which is the desciption of the charge being made.\n- **orderId** commerce order identificator
|
11
|
+
# @param [Hash] opts the optional parameters
|
12
|
+
# @return [CreditCardCharge]
|
13
|
+
def self.add_credit_card_charge(body, opts = {})
|
14
|
+
|
15
|
+
# verify the required parameter 'body' is set
|
16
|
+
raise "Missing the required parameter 'body' when calling add_credit_card_charge" if body.nil?
|
17
|
+
|
18
|
+
|
19
|
+
# resource path
|
20
|
+
path = "/charge/credit_card".sub('{format}', 'json')
|
11
21
|
|
12
|
-
|
22
|
+
# query parameters
|
23
|
+
query_params = {}
|
13
24
|
|
14
|
-
|
15
|
-
|
16
|
-
# @param body Charge object that needs to be authorized.
|
17
|
-
# @return Charge
|
18
|
-
def self.add_charge (body,opts={})
|
19
|
-
query_param_keys = []
|
25
|
+
# header parameters
|
26
|
+
header_params = {}
|
20
27
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
options = {
|
25
|
-
}.merge(opts)
|
28
|
+
# HTTP header 'Accept' (if needed)
|
29
|
+
_header_accept = []
|
30
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
26
31
|
|
27
|
-
|
28
|
-
|
32
|
+
# HTTP header 'Content-Type'
|
33
|
+
_header_content_type = []
|
34
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
29
35
|
|
30
|
-
|
36
|
+
# form parameters
|
37
|
+
form_params = {}
|
31
38
|
|
32
|
-
|
33
|
-
|
39
|
+
# http body (model)
|
40
|
+
post_body = Swagger::Request.object_to_http_body(body)
|
34
41
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
42
|
+
|
43
|
+
auth_names = ['api_key']
|
44
|
+
response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
45
|
+
obj = CreditCardCharge.new() and obj.build_from_hash(response)
|
39
46
|
end
|
40
47
|
|
41
|
-
#
|
42
|
-
|
43
|
-
#
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
48
|
+
# Retrieve a CreditCardCharge by ID
|
49
|
+
# Get the details of an existing `CreditCardCharge`. This method only requires an unique `CreditCardCharge` identifier `id` that was returned upon `CreditCardCharge` creation.
|
50
|
+
# @param id Identification of `CreditCardCharge` that needs to be retrieved
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [CreditCardCharge]
|
53
|
+
def self.get_credit_card_charge_by_id(id, opts = {})
|
54
|
+
|
55
|
+
# verify the required parameter 'id' is set
|
56
|
+
raise "Missing the required parameter 'id' when calling get_credit_card_charge_by_id" if id.nil?
|
57
|
+
|
58
|
+
|
59
|
+
# resource path
|
60
|
+
path = "/charge/credit_card/{id}".sub('{format}', 'json').sub('{' + 'id' + '}', id.to_s)
|
61
|
+
|
62
|
+
# query parameters
|
63
|
+
query_params = {}
|
64
|
+
|
65
|
+
# header parameters
|
66
|
+
header_params = {}
|
67
|
+
|
68
|
+
# HTTP header 'Accept' (if needed)
|
69
|
+
_header_accept = []
|
70
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
71
|
+
|
72
|
+
# HTTP header 'Content-Type'
|
73
|
+
_header_content_type = []
|
74
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
75
|
+
|
76
|
+
# form parameters
|
77
|
+
form_params = {}
|
78
|
+
|
79
|
+
# http body (model)
|
80
|
+
post_body = nil
|
81
|
+
|
82
|
+
|
83
|
+
auth_names = ['api_key']
|
84
|
+
response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
85
|
+
obj = CreditCardCharge.new() and obj.build_from_hash(response)
|
68
86
|
end
|
69
|
-
# form parameter
|
70
|
-
form_parameter_hash = {}
|
71
|
-
|
72
87
|
|
88
|
+
# Adds a new DaviPlataCharge to Customer's DaviPlata
|
89
|
+
# Creates a new `DaviPlataCharge` and associates it to a `DaviPlata`.
|
90
|
+
# @param body The `DaviPlataCharge` object to be generated to a `DaviPlata`. It has the following fields\n- **id** its the id of the `DaviPlataCharge` thats going to be generated after creation.\n- **daviPlata** which is the identificator of the `DaviPlata` to be charged\n- **customer** which is the id of the `Customer` associated with the `DaviPlata`\n- **amount** which is the full amount of the charge\n- **currency** its the 3-letter ISO code for the currency.\n- **taxAmount** the amount that accounts as taxes.\n- **paid** its the status of the charge. true if its paid, false if its not.\n- **description** which is the desciption of the charge being made.\n- **orderId** commerce order identificator
|
91
|
+
# @param [Hash] opts the optional parameters
|
92
|
+
# @return [DaviPlataCharge]
|
93
|
+
def self.add_davi_plata_charge(body, opts = {})
|
73
94
|
|
74
|
-
|
75
|
-
|
95
|
+
# verify the required parameter 'body' is set
|
96
|
+
raise "Missing the required parameter 'body' when calling add_davi_plata_charge" if body.nil?
|
76
97
|
|
77
|
-
response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :form_params => form_parameter_hash, :body=>post_body, :require_auth => require_auth }).make.body
|
78
|
-
Charge.new(response)
|
79
98
|
|
80
|
-
|
99
|
+
# resource path
|
100
|
+
path = "/charge/daviplata".sub('{format}', 'json')
|
81
101
|
|
102
|
+
# query parameters
|
103
|
+
query_params = {}
|
82
104
|
|
105
|
+
# header parameters
|
106
|
+
header_params = {}
|
83
107
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
# @return Charge
|
88
|
-
def self.get_charge_by_id (id,opts={})
|
89
|
-
query_param_keys = []
|
108
|
+
# HTTP header 'Accept' (if needed)
|
109
|
+
_header_accept = []
|
110
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
90
111
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
options = {
|
95
|
-
}.merge(opts)
|
112
|
+
# HTTP header 'Content-Type'
|
113
|
+
_header_content_type = []
|
114
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
96
115
|
|
97
|
-
|
98
|
-
|
116
|
+
# form parameters
|
117
|
+
form_params = {}
|
99
118
|
|
100
|
-
|
119
|
+
# http body (model)
|
120
|
+
post_body = Swagger::Request.object_to_http_body(body)
|
101
121
|
|
102
|
-
#resource path
|
103
|
-
path = "/charge/{id}".sub('{' + 'id' + '}', escapeString(id))
|
104
|
-
|
105
122
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
query_param_keys.include? key
|
123
|
+
auth_names = ['api_key']
|
124
|
+
response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
125
|
+
obj = DaviPlataCharge.new() and obj.build_from_hash(response)
|
110
126
|
end
|
111
127
|
|
112
|
-
#
|
113
|
-
|
114
|
-
#
|
115
|
-
|
116
|
-
|
128
|
+
# Retrieve a DaviPlataCharge by ID
|
129
|
+
# Get the details of an existing `DaviPlataCharge`. This method only requires an unique `DaviPlataCharge` identifier `id` that was returned upon `DaviPlataCharge` creation.
|
130
|
+
# @param id Identification of `DaviPlataCharge` that needs to be retrieved
|
131
|
+
# @param [Hash] opts the optional parameters
|
132
|
+
# @return [DaviPlataCharge]
|
133
|
+
def self.get_davi_plata_charge_by_id(id, opts = {})
|
117
134
|
|
118
|
-
|
119
|
-
|
120
|
-
# form parameter
|
121
|
-
form_parameter_hash = {}
|
122
|
-
|
135
|
+
# verify the required parameter 'id' is set
|
136
|
+
raise "Missing the required parameter 'id' when calling get_davi_plata_charge_by_id" if id.nil?
|
123
137
|
|
124
138
|
|
125
|
-
|
126
|
-
|
139
|
+
# resource path
|
140
|
+
path = "/charge/daviplata/{id}".sub('{format}', 'json').sub('{' + 'id' + '}', id.to_s)
|
127
141
|
|
128
|
-
|
129
|
-
|
142
|
+
# query parameters
|
143
|
+
query_params = {}
|
130
144
|
|
131
|
-
|
145
|
+
# header parameters
|
146
|
+
header_params = {}
|
132
147
|
|
133
|
-
|
134
|
-
|
148
|
+
# HTTP header 'Accept' (if needed)
|
149
|
+
_header_accept = []
|
150
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
151
|
+
|
152
|
+
# HTTP header 'Content-Type'
|
153
|
+
_header_content_type = []
|
154
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
135
155
|
|
156
|
+
# form parameters
|
157
|
+
form_params = {}
|
158
|
+
|
159
|
+
# http body (model)
|
160
|
+
post_body = nil
|
161
|
+
|
162
|
+
|
163
|
+
auth_names = ['api_key']
|
164
|
+
response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
165
|
+
obj = DaviPlataCharge.new() and obj.build_from_hash(response)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require "uri"
|
2
|
+
|
3
|
+
module Tpaga
|
4
|
+
class ChargebackApi
|
5
|
+
basePath = "https://sandbox.tpaga.co/api"
|
6
|
+
# apiInvoker = APIInvoker
|
7
|
+
|
8
|
+
# Adds a new DaviPlataChargeback to Customer's DaviPlata
|
9
|
+
# Creates a new `DaviPlataChargeback` and associates it to a `DaviPlata`.
|
10
|
+
# @param body The `DaviPlataChargeback` to be applied to a `DaviPlata`. It has the following fields\n- **id** its the id of the `DaviPlataChargeback` thats going to be generated after creation.\n- **daviPlata** its the id of the `DaviPlata` to be reinbursed.\n- **daviPlataCharge** its the id of the `DaviPlataCharge` to apply the Chargeback.\n- **reimbursed** its the status of the chargeback, true if its been reinbursed or false if its still pending.
|
11
|
+
# @param [Hash] opts the optional parameters
|
12
|
+
# @return [DaviPlataChargeback]
|
13
|
+
def self.add_davi_plata_chargeback(body, opts = {})
|
14
|
+
|
15
|
+
# verify the required parameter 'body' is set
|
16
|
+
raise "Missing the required parameter 'body' when calling add_davi_plata_chargeback" if body.nil?
|
17
|
+
|
18
|
+
|
19
|
+
# resource path
|
20
|
+
path = "/chargeback/daviplata".sub('{format}', 'json')
|
21
|
+
|
22
|
+
# query parameters
|
23
|
+
query_params = {}
|
24
|
+
|
25
|
+
# header parameters
|
26
|
+
header_params = {}
|
27
|
+
|
28
|
+
# HTTP header 'Accept' (if needed)
|
29
|
+
_header_accept = []
|
30
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
31
|
+
|
32
|
+
# HTTP header 'Content-Type'
|
33
|
+
_header_content_type = []
|
34
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
35
|
+
|
36
|
+
# form parameters
|
37
|
+
form_params = {}
|
38
|
+
|
39
|
+
# http body (model)
|
40
|
+
post_body = Swagger::Request.object_to_http_body(body)
|
41
|
+
|
42
|
+
|
43
|
+
auth_names = ['api_key']
|
44
|
+
response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
45
|
+
obj = DaviPlataChargeback.new() and obj.build_from_hash(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Retrieve a DaviPlataChargeback by ID
|
49
|
+
# Get the details of an existing `DaviPlataChargeback`. This method only requires an unique `DaviPlataChargeback` identifier `id` that was returned upon `DaviPlataChargeback` creation.
|
50
|
+
# @param id Identification of `DaviPlataChargeback` to be retrieved
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [DaviPlataChargeback]
|
53
|
+
def self.get_davi_plata_chargeback_by_id(id, opts = {})
|
54
|
+
|
55
|
+
# verify the required parameter 'id' is set
|
56
|
+
raise "Missing the required parameter 'id' when calling get_davi_plata_chargeback_by_id" if id.nil?
|
57
|
+
|
58
|
+
|
59
|
+
# resource path
|
60
|
+
path = "/chargeback/daviplata/{id}".sub('{format}', 'json').sub('{' + 'id' + '}', id.to_s)
|
61
|
+
|
62
|
+
# query parameters
|
63
|
+
query_params = {}
|
64
|
+
|
65
|
+
# header parameters
|
66
|
+
header_params = {}
|
67
|
+
|
68
|
+
# HTTP header 'Accept' (if needed)
|
69
|
+
_header_accept = []
|
70
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
71
|
+
|
72
|
+
# HTTP header 'Content-Type'
|
73
|
+
_header_content_type = []
|
74
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
75
|
+
|
76
|
+
# form parameters
|
77
|
+
form_params = {}
|
78
|
+
|
79
|
+
# http body (model)
|
80
|
+
post_body = nil
|
81
|
+
|
82
|
+
|
83
|
+
auth_names = ['api_key']
|
84
|
+
response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
85
|
+
obj = DaviPlataChargeback.new() and obj.build_from_hash(response)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,220 @@
|
|
1
|
+
require "uri"
|
2
|
+
|
3
|
+
module Tpaga
|
4
|
+
class CreditCardApi
|
5
|
+
basePath = "https://sandbox.tpaga.co/api"
|
6
|
+
# apiInvoker = APIInvoker
|
7
|
+
|
8
|
+
# Adds a new CreditCardCharge to Customer's CreditCard
|
9
|
+
# Creates a new `CreditCardCharge` and associates it to a `CreditCard`.
|
10
|
+
# @param body The `CreditCardCharge` object to be generated to a `CreditCard` it has the following fields\n- **id** its the id of the `CreditCardCharge` thats going to be generated after creation.\n- **creditCard** which is the identificator of the `CreditCard` to be charged\n- **customer** which is the id of the `Customer` associated with the `CreditCard`\n- **amount** which is the full amount of the charge\n- **currency** its the 3-letter ISO code for the currency.\n- **installments** its the amount of payments to divide the charge amount, it can be minumum 1 maximum 36\n- **taxAmount** the amount that accounts as taxes.\n- **paid** its the status of the charge. true if its paid, false if its not.\n- **description** which is the desciption of the charge being made.\n- **orderId** commerce order identificator
|
11
|
+
# @param [Hash] opts the optional parameters
|
12
|
+
# @return [CreditCardCharge]
|
13
|
+
def self.add_credit_card_charge(body, opts = {})
|
14
|
+
|
15
|
+
# verify the required parameter 'body' is set
|
16
|
+
raise "Missing the required parameter 'body' when calling add_credit_card_charge" if body.nil?
|
17
|
+
|
18
|
+
|
19
|
+
# resource path
|
20
|
+
path = "/charge/credit_card".sub('{format}', 'json')
|
21
|
+
|
22
|
+
# query parameters
|
23
|
+
query_params = {}
|
24
|
+
|
25
|
+
# header parameters
|
26
|
+
header_params = {}
|
27
|
+
|
28
|
+
# HTTP header 'Accept' (if needed)
|
29
|
+
_header_accept = []
|
30
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
31
|
+
|
32
|
+
# HTTP header 'Content-Type'
|
33
|
+
_header_content_type = []
|
34
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
35
|
+
|
36
|
+
# form parameters
|
37
|
+
form_params = {}
|
38
|
+
|
39
|
+
# http body (model)
|
40
|
+
post_body = Swagger::Request.object_to_http_body(body)
|
41
|
+
|
42
|
+
|
43
|
+
auth_names = ['api_key']
|
44
|
+
response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
45
|
+
obj = CreditCardCharge.new() and obj.build_from_hash(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Retrieve a CreditCardCharge by ID
|
49
|
+
# Get the details of an existing `CreditCardCharge`. This method only requires an unique `CreditCardCharge` identifier `id` that was returned upon `CreditCardCharge` creation.
|
50
|
+
# @param id Identification of `CreditCardCharge` that needs to be retrieved
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [CreditCardCharge]
|
53
|
+
def self.get_credit_card_charge_by_id(id, opts = {})
|
54
|
+
|
55
|
+
# verify the required parameter 'id' is set
|
56
|
+
raise "Missing the required parameter 'id' when calling get_credit_card_charge_by_id" if id.nil?
|
57
|
+
|
58
|
+
|
59
|
+
# resource path
|
60
|
+
path = "/charge/credit_card/{id}".sub('{format}', 'json').sub('{' + 'id' + '}', id.to_s)
|
61
|
+
|
62
|
+
# query parameters
|
63
|
+
query_params = {}
|
64
|
+
|
65
|
+
# header parameters
|
66
|
+
header_params = {}
|
67
|
+
|
68
|
+
# HTTP header 'Accept' (if needed)
|
69
|
+
_header_accept = []
|
70
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
71
|
+
|
72
|
+
# HTTP header 'Content-Type'
|
73
|
+
_header_content_type = []
|
74
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
75
|
+
|
76
|
+
# form parameters
|
77
|
+
form_params = {}
|
78
|
+
|
79
|
+
# http body (model)
|
80
|
+
post_body = nil
|
81
|
+
|
82
|
+
|
83
|
+
auth_names = ['api_key']
|
84
|
+
response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
85
|
+
obj = CreditCardCharge.new() and obj.build_from_hash(response)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Adds a new Credit Card payment method to the Customer
|
89
|
+
# Creates a new `CreditCard` and associates it to the `Customer`
|
90
|
+
# @param customer_id Identificaiton of `Customer` to associate the new `CreditCard`
|
91
|
+
# @param body The `CreditCard` object to be associated to the `Customer`, it has the following fields\n- **primaryAccountNumber** which is the number as it appears on the credit card.\n- **cardVerificationCode** which is the security code usually found in the back o the credit card.\n- **expirationMonth** which is the month of expiration of the credit card, its entered as a numeric value with single digits or double digits like 5 or 05 to represent may.\n- **expirationYear** which is the year of expiration of the credit card in its complete numeric value.\n- **cardHolderName** which is the name of the card holder exactly as it appears on the credit card.\n- **billingAddress** which is the billing address of the credit card that consists of two address lines, the city, the country, the postalCode and the state of the address.
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [CreditCard]
|
94
|
+
def self.add_credit_card(customer_id, body, opts = {})
|
95
|
+
|
96
|
+
# verify the required parameter 'customer_id' is set
|
97
|
+
raise "Missing the required parameter 'customer_id' when calling add_credit_card" if customer_id.nil?
|
98
|
+
|
99
|
+
# verify the required parameter 'body' is set
|
100
|
+
raise "Missing the required parameter 'body' when calling add_credit_card" if body.nil?
|
101
|
+
|
102
|
+
|
103
|
+
# resource path
|
104
|
+
path = "/customer/{customer_id}/credit_card".sub('{format}', 'json').sub('{' + 'customer_id' + '}', customer_id.to_s)
|
105
|
+
|
106
|
+
# query parameters
|
107
|
+
query_params = {}
|
108
|
+
|
109
|
+
# header parameters
|
110
|
+
header_params = {}
|
111
|
+
|
112
|
+
# HTTP header 'Accept' (if needed)
|
113
|
+
_header_accept = []
|
114
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
115
|
+
|
116
|
+
# HTTP header 'Content-Type'
|
117
|
+
_header_content_type = []
|
118
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
119
|
+
|
120
|
+
# form parameters
|
121
|
+
form_params = {}
|
122
|
+
|
123
|
+
# http body (model)
|
124
|
+
post_body = Swagger::Request.object_to_http_body(body)
|
125
|
+
|
126
|
+
|
127
|
+
auth_names = ['api_key']
|
128
|
+
response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
129
|
+
obj = CreditCard.new() and obj.build_from_hash(response)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Retrieve a CreditCard by ID
|
133
|
+
# Get the details of an existing `CreditCard`. This method only requires an unique `CreditCard` identifier `id` that was returned upon `CreditCard` creation.
|
134
|
+
# @param customer_id Identification of `Customer` associated with the `CreditCard`
|
135
|
+
# @param card_id Identification of `CreditCard` that needs to be retrieved
|
136
|
+
# @param [Hash] opts the optional parameters
|
137
|
+
# @return [CreditCard]
|
138
|
+
def self.get_credit_card_by_id(customer_id, card_id, opts = {})
|
139
|
+
|
140
|
+
# verify the required parameter 'customer_id' is set
|
141
|
+
raise "Missing the required parameter 'customer_id' when calling get_credit_card_by_id" if customer_id.nil?
|
142
|
+
|
143
|
+
# verify the required parameter 'card_id' is set
|
144
|
+
raise "Missing the required parameter 'card_id' when calling get_credit_card_by_id" if card_id.nil?
|
145
|
+
|
146
|
+
|
147
|
+
# resource path
|
148
|
+
path = "/customer/{customer_id}/credit_card/{card_id}".sub('{format}', 'json').sub('{' + 'customer_id' + '}', customer_id.to_s).sub('{' + 'card_id' + '}', card_id.to_s)
|
149
|
+
|
150
|
+
# query parameters
|
151
|
+
query_params = {}
|
152
|
+
|
153
|
+
# header parameters
|
154
|
+
header_params = {}
|
155
|
+
|
156
|
+
# HTTP header 'Accept' (if needed)
|
157
|
+
_header_accept = []
|
158
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
159
|
+
|
160
|
+
# HTTP header 'Content-Type'
|
161
|
+
_header_content_type = []
|
162
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
163
|
+
|
164
|
+
# form parameters
|
165
|
+
form_params = {}
|
166
|
+
|
167
|
+
# http body (model)
|
168
|
+
post_body = nil
|
169
|
+
|
170
|
+
|
171
|
+
auth_names = ['api_key']
|
172
|
+
response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
173
|
+
obj = CreditCard.new() and obj.build_from_hash(response)
|
174
|
+
end
|
175
|
+
|
176
|
+
# Deletes a CreditCard by ID
|
177
|
+
# Deletes a `CreditCard` when its `id` matches the parameters. Only available when `CreditCard` does not have associated Charges.
|
178
|
+
# @param customer_id Identificaiton of `Customer` associated with the `CreditCard`
|
179
|
+
# @param card_id Identification of `CreditCard` to be deleted
|
180
|
+
# @param [Hash] opts the optional parameters
|
181
|
+
# @return [nil]
|
182
|
+
def self.delete_credit_card_by_id(customer_id, card_id, opts = {})
|
183
|
+
|
184
|
+
# verify the required parameter 'customer_id' is set
|
185
|
+
raise "Missing the required parameter 'customer_id' when calling delete_credit_card_by_id" if customer_id.nil?
|
186
|
+
|
187
|
+
# verify the required parameter 'card_id' is set
|
188
|
+
raise "Missing the required parameter 'card_id' when calling delete_credit_card_by_id" if card_id.nil?
|
189
|
+
|
190
|
+
|
191
|
+
# resource path
|
192
|
+
path = "/customer/{customer_id}/credit_card/{card_id}".sub('{format}', 'json').sub('{' + 'customer_id' + '}', customer_id.to_s).sub('{' + 'card_id' + '}', card_id.to_s)
|
193
|
+
|
194
|
+
# query parameters
|
195
|
+
query_params = {}
|
196
|
+
|
197
|
+
# header parameters
|
198
|
+
header_params = {}
|
199
|
+
|
200
|
+
# HTTP header 'Accept' (if needed)
|
201
|
+
_header_accept = []
|
202
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
203
|
+
|
204
|
+
# HTTP header 'Content-Type'
|
205
|
+
_header_content_type = []
|
206
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
207
|
+
|
208
|
+
# form parameters
|
209
|
+
form_params = {}
|
210
|
+
|
211
|
+
# http body (model)
|
212
|
+
post_body = nil
|
213
|
+
|
214
|
+
|
215
|
+
auth_names = ['api_key']
|
216
|
+
Swagger::Request.new(:DELETE, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
|
217
|
+
nil
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|