apimatic-ci-cd-test 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +1168 -0
- data/lib/payments_api.rb +49 -0
- data/lib/payments_api/api_helper.rb +277 -0
- data/lib/payments_api/client.rb +42 -0
- data/lib/payments_api/configuration.rb +116 -0
- data/lib/payments_api/controllers/base_controller.rb +49 -0
- data/lib/payments_api/controllers/payments_controller.rb +272 -0
- data/lib/payments_api/controllers/quotes_controller.rb +213 -0
- data/lib/payments_api/exceptions/api_exception.rb +20 -0
- data/lib/payments_api/exceptions/request_error_exception.rb +29 -0
- data/lib/payments_api/http/auth/custom_header_auth.rb +16 -0
- data/lib/payments_api/http/faraday_client.rb +70 -0
- data/lib/payments_api/http/http_call_back.rb +24 -0
- data/lib/payments_api/http/http_client.rb +104 -0
- data/lib/payments_api/http/http_method_enum.rb +13 -0
- data/lib/payments_api/http/http_request.rb +50 -0
- data/lib/payments_api/http/http_response.rb +29 -0
- data/lib/payments_api/models/address.rb +80 -0
- data/lib/payments_api/models/bank.rb +63 -0
- data/lib/payments_api/models/bank_account.rb +48 -0
- data/lib/payments_api/models/base_model.rb +47 -0
- data/lib/payments_api/models/beneficiary.rb +62 -0
- data/lib/payments_api/models/originator.rb +44 -0
- data/lib/payments_api/models/payment.rb +127 -0
- data/lib/payments_api/models/payment_details.rb +53 -0
- data/lib/payments_api/models/payment_status.rb +44 -0
- data/lib/payments_api/models/quote.rb +104 -0
- data/lib/payments_api/utilities/date_time_helper.rb +156 -0
- data/lib/payments_api/utilities/file_wrapper.rb +17 -0
- metadata +155 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
# payments_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaymentsApi
|
7
|
+
# Payment Information Data
|
8
|
+
class PaymentStatus < BaseModel
|
9
|
+
# Set to true once the payment has been approved
|
10
|
+
# @return [Boolean]
|
11
|
+
attr_accessor :approved
|
12
|
+
|
13
|
+
# Set to true once the payment has been sent
|
14
|
+
# @return [Boolean]
|
15
|
+
attr_accessor :sent
|
16
|
+
|
17
|
+
# A mapping from model property names to API property names.
|
18
|
+
def self.names
|
19
|
+
@_hash = {} if @_hash.nil?
|
20
|
+
@_hash['approved'] = 'approved'
|
21
|
+
@_hash['sent'] = 'sent'
|
22
|
+
@_hash
|
23
|
+
end
|
24
|
+
|
25
|
+
def initialize(approved = nil,
|
26
|
+
sent = nil)
|
27
|
+
@approved = approved
|
28
|
+
@sent = sent
|
29
|
+
end
|
30
|
+
|
31
|
+
# Creates an instance of the object from a hash.
|
32
|
+
def self.from_hash(hash)
|
33
|
+
return nil unless hash
|
34
|
+
|
35
|
+
# Extract variables from the hash.
|
36
|
+
approved = hash['approved']
|
37
|
+
sent = hash['sent']
|
38
|
+
|
39
|
+
# Create object from extracted values.
|
40
|
+
PaymentStatus.new(approved,
|
41
|
+
sent)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# payments_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaymentsApi
|
7
|
+
# Quote Information Object
|
8
|
+
class Quote < BaseModel
|
9
|
+
# Quote ID
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :id
|
12
|
+
|
13
|
+
# Amount to send in beneficiary currency. Not required if originatorAmount
|
14
|
+
# is provided.
|
15
|
+
# @return [Float]
|
16
|
+
attr_accessor :beneficiary_amount
|
17
|
+
|
18
|
+
# Beneficiary currency code in ISO 4217 format
|
19
|
+
# @return [String]
|
20
|
+
attr_accessor :beneficiary_currency
|
21
|
+
|
22
|
+
# Amount to send in originator currency. Not required if beneficiaryAmount
|
23
|
+
# is provided
|
24
|
+
# @return [Float]
|
25
|
+
attr_accessor :originator_amount
|
26
|
+
|
27
|
+
# If true, then the originator amount is fixed to the provided value. If
|
28
|
+
# false, then the beneficiary amount is fixed to the provided value. This
|
29
|
+
# field is automatically set based on whether the originator or beneficary
|
30
|
+
# amount was provided.
|
31
|
+
# @return [Boolean]
|
32
|
+
attr_accessor :originator_amount_is_fixed
|
33
|
+
|
34
|
+
# The exchange rate for the quote
|
35
|
+
# @return [Float]
|
36
|
+
attr_accessor :exchange_rate
|
37
|
+
|
38
|
+
# Set to true if the quote rate is locked
|
39
|
+
# @return [Boolean]
|
40
|
+
attr_accessor :locked
|
41
|
+
|
42
|
+
# Quote revision number. This is automatically incremented each time the
|
43
|
+
# quote is refreshed or updated, and starts from 1
|
44
|
+
# @return [Integer]
|
45
|
+
attr_accessor :revision
|
46
|
+
|
47
|
+
# A mapping from model property names to API property names.
|
48
|
+
def self.names
|
49
|
+
@_hash = {} if @_hash.nil?
|
50
|
+
@_hash['id'] = 'id'
|
51
|
+
@_hash['beneficiary_amount'] = 'beneficiaryAmount'
|
52
|
+
@_hash['beneficiary_currency'] = 'beneficiaryCurrency'
|
53
|
+
@_hash['originator_amount'] = 'originatorAmount'
|
54
|
+
@_hash['originator_amount_is_fixed'] = 'originatorAmountIsFixed'
|
55
|
+
@_hash['exchange_rate'] = 'exchangeRate'
|
56
|
+
@_hash['locked'] = 'locked'
|
57
|
+
@_hash['revision'] = 'revision'
|
58
|
+
@_hash
|
59
|
+
end
|
60
|
+
|
61
|
+
def initialize(beneficiary_currency = nil,
|
62
|
+
id = nil,
|
63
|
+
beneficiary_amount = nil,
|
64
|
+
originator_amount = nil,
|
65
|
+
originator_amount_is_fixed = nil,
|
66
|
+
exchange_rate = nil,
|
67
|
+
locked = nil,
|
68
|
+
revision = nil)
|
69
|
+
@id = id
|
70
|
+
@beneficiary_amount = beneficiary_amount
|
71
|
+
@beneficiary_currency = beneficiary_currency
|
72
|
+
@originator_amount = originator_amount
|
73
|
+
@originator_amount_is_fixed = originator_amount_is_fixed
|
74
|
+
@exchange_rate = exchange_rate
|
75
|
+
@locked = locked
|
76
|
+
@revision = revision
|
77
|
+
end
|
78
|
+
|
79
|
+
# Creates an instance of the object from a hash.
|
80
|
+
def self.from_hash(hash)
|
81
|
+
return nil unless hash
|
82
|
+
|
83
|
+
# Extract variables from the hash.
|
84
|
+
beneficiary_currency = hash['beneficiaryCurrency']
|
85
|
+
id = hash['id']
|
86
|
+
beneficiary_amount = hash['beneficiaryAmount']
|
87
|
+
originator_amount = hash['originatorAmount']
|
88
|
+
originator_amount_is_fixed = hash['originatorAmountIsFixed']
|
89
|
+
exchange_rate = hash['exchangeRate']
|
90
|
+
locked = hash['locked']
|
91
|
+
revision = hash['revision']
|
92
|
+
|
93
|
+
# Create object from extracted values.
|
94
|
+
Quote.new(beneficiary_currency,
|
95
|
+
id,
|
96
|
+
beneficiary_amount,
|
97
|
+
originator_amount,
|
98
|
+
originator_amount_is_fixed,
|
99
|
+
exchange_rate,
|
100
|
+
locked,
|
101
|
+
revision)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,156 @@
|
|
1
|
+
# payments_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module PaymentsApi
|
8
|
+
# A utility that supports dateTime conversion to different formats
|
9
|
+
class DateTimeHelper
|
10
|
+
# Safely converts a DateTime object into a rfc1123 format string
|
11
|
+
# @param [DateTime] The DateTime object
|
12
|
+
# @return [String] The rfc1123 formatted datetime string
|
13
|
+
def self.to_rfc1123(date_time)
|
14
|
+
date_time.httpdate unless date_time.nil?
|
15
|
+
end
|
16
|
+
|
17
|
+
# Safely converts a map of DateTime objects into a map of rfc1123 format string
|
18
|
+
# @param [hash] a map of DateTime objects
|
19
|
+
# @return [hash] a map of rfc1123 formatted datetime string
|
20
|
+
def self.to_rfc1123_map(date_time, hash, key)
|
21
|
+
return if date_time.nil?
|
22
|
+
|
23
|
+
hash[key] = {}
|
24
|
+
date_time.each do |k, v|
|
25
|
+
hash[key][k] =
|
26
|
+
if v.is_a?(BaseModel)
|
27
|
+
v.to_hash
|
28
|
+
else
|
29
|
+
v.is_a?(DateTime) ? DateTimeHelper.to_rfc1123(v) : v
|
30
|
+
end
|
31
|
+
end
|
32
|
+
hash[key]
|
33
|
+
end
|
34
|
+
|
35
|
+
# Safely converts an array of DateTime objects into an array of rfc1123 format string
|
36
|
+
# @param [Array] an array of DateTime objects
|
37
|
+
# @return [Array] an array of rfc1123 formatted datetime string
|
38
|
+
def self.to_rfc1123_array(date_time, hash, key)
|
39
|
+
return if date_time.nil?
|
40
|
+
|
41
|
+
hash[key] = date_time.map do |v|
|
42
|
+
if v.is_a?(BaseModel)
|
43
|
+
v.to_hash
|
44
|
+
else
|
45
|
+
v.is_a?(DateTime) ? DateTimeHelper.to_rfc1123(v) : v
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Safely converts a DateTime object into a unix format string
|
51
|
+
# @param [DateTime] The DateTime object
|
52
|
+
# @return [String] The unix formatted datetime string
|
53
|
+
def self.to_unix(date_time)
|
54
|
+
date_time.to_time.utc.to_i unless date_time.nil?
|
55
|
+
end
|
56
|
+
|
57
|
+
# Safely converts a map of DateTime objects into a map of unix format string
|
58
|
+
# @param [hash] a map of DateTime objects
|
59
|
+
# @return [hash] a map of unix formatted datetime string
|
60
|
+
def self.to_unix_map(date_time, hash, key)
|
61
|
+
return if date_time.nil?
|
62
|
+
|
63
|
+
hash[key] = {}
|
64
|
+
date_time.each do |k, v|
|
65
|
+
hash[key][k] =
|
66
|
+
if v.is_a?(BaseModel)
|
67
|
+
v.to_hash
|
68
|
+
else
|
69
|
+
v.is_a?(DateTime) ? DateTimeHelper.to_unix(v) : v
|
70
|
+
end
|
71
|
+
end
|
72
|
+
hash[key]
|
73
|
+
end
|
74
|
+
|
75
|
+
# Safely converts an array of DateTime objects into a map of unix format string
|
76
|
+
# @param [hash] an array of DateTime objects
|
77
|
+
# @return [hash] an array of unix formatted datetime string
|
78
|
+
def self.to_unix_array(date_time, hash, key)
|
79
|
+
return if date_time.nil?
|
80
|
+
|
81
|
+
hash[key] = date_time.map do |v|
|
82
|
+
if v.is_a?(BaseModel)
|
83
|
+
v.to_hash
|
84
|
+
else
|
85
|
+
v.is_a?(DateTime) ? DateTimeHelper.to_unix(v) : v
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# Safely converts a DateTime object into a rfc3339 format string
|
91
|
+
# @param [DateTime] The DateTime object
|
92
|
+
# @return [String] The rfc3339 formatted datetime string
|
93
|
+
def self.to_rfc3339(date_time)
|
94
|
+
date_time.rfc3339 unless date_time.nil?
|
95
|
+
end
|
96
|
+
|
97
|
+
# Safely converts a map of DateTime objects into a map of rfc1123 format string
|
98
|
+
# @param [hash] a map of DateTime objects
|
99
|
+
# @return [hash] a map of rfc1123 formatted datetime string
|
100
|
+
def self.to_rfc3339_map(date_time, hash, key)
|
101
|
+
return if date_time.nil?
|
102
|
+
|
103
|
+
hash[key] = {}
|
104
|
+
date_time.each do |k, v|
|
105
|
+
hash[key][k] =
|
106
|
+
if v.is_a?(BaseModel)
|
107
|
+
v.to_hash
|
108
|
+
else
|
109
|
+
v.is_a?(DateTime) ? DateTimeHelper.to_rfc3339(v) : v
|
110
|
+
end
|
111
|
+
end
|
112
|
+
hash[key]
|
113
|
+
end
|
114
|
+
|
115
|
+
# Safely converts an array of DateTime objects into an array of rfc1123 format string
|
116
|
+
# @param [Array] an array of DateTime objects
|
117
|
+
# @return [Array] an array of rfc1123 formatted datetime string
|
118
|
+
def self.to_rfc3339_array(date_time, hash, key)
|
119
|
+
return if date_time.nil?
|
120
|
+
|
121
|
+
hash[key] = date_time.map do |v|
|
122
|
+
if v.is_a?(BaseModel)
|
123
|
+
v.to_hash
|
124
|
+
else
|
125
|
+
v.is_a?(DateTime) ? DateTimeHelper.to_rfc3339(v) : v
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# Safely converts a rfc1123 format string into a DateTime object
|
131
|
+
# @param [String] The rfc1123 formatted datetime string
|
132
|
+
# @return [DateTime] A DateTime object
|
133
|
+
def self.from_rfc1123(date_time)
|
134
|
+
DateTime.httpdate(date_time)
|
135
|
+
end
|
136
|
+
|
137
|
+
# Safely converts a unix format string into a DateTime object
|
138
|
+
# @param [String] The unix formatted datetime string
|
139
|
+
# @return [DateTime] A DateTime object
|
140
|
+
def self.from_unix(date_time)
|
141
|
+
Time.at(date_time.to_i).utc.to_datetime
|
142
|
+
end
|
143
|
+
|
144
|
+
# Safely converts a rfc3339 format string into a DateTime object
|
145
|
+
# @param [String] The rfc3339 formatted datetime string
|
146
|
+
# @return [DateTime] A DateTime object
|
147
|
+
def self.from_rfc3339(date_time)
|
148
|
+
# missing timezone information
|
149
|
+
if date_time.end_with?('Z') || date_time.index('+')
|
150
|
+
DateTime.rfc3339(date_time)
|
151
|
+
else
|
152
|
+
DateTime.rfc3339("#{date_time}Z")
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# payments_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaymentsApi
|
7
|
+
# A utility to allow users to set the content-type for files
|
8
|
+
class FileWrapper
|
9
|
+
attr_reader :content_type
|
10
|
+
attr_reader :file
|
11
|
+
|
12
|
+
def initialize(file, content_type: 'application/octet-stream')
|
13
|
+
@file = file
|
14
|
+
@content_type = content_type
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: apimatic-ci-cd-test
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- APIMatic SDK Generator
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-08-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: logging
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
- - "<="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 1.3.0
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.0'
|
44
|
+
- - "<="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.3.0
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: faraday_middleware
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '1.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: certifi
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '2018.1'
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 2018.01.18
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '2018.1'
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 2018.01.18
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: faraday-http-cache
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '2.2'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '2.2'
|
95
|
+
description: API for sending and managing payments
|
96
|
+
email: support@apimatic.io
|
97
|
+
executables: []
|
98
|
+
extensions: []
|
99
|
+
extra_rdoc_files: []
|
100
|
+
files:
|
101
|
+
- LICENSE
|
102
|
+
- README.md
|
103
|
+
- lib/payments_api.rb
|
104
|
+
- lib/payments_api/api_helper.rb
|
105
|
+
- lib/payments_api/client.rb
|
106
|
+
- lib/payments_api/configuration.rb
|
107
|
+
- lib/payments_api/controllers/base_controller.rb
|
108
|
+
- lib/payments_api/controllers/payments_controller.rb
|
109
|
+
- lib/payments_api/controllers/quotes_controller.rb
|
110
|
+
- lib/payments_api/exceptions/api_exception.rb
|
111
|
+
- lib/payments_api/exceptions/request_error_exception.rb
|
112
|
+
- lib/payments_api/http/auth/custom_header_auth.rb
|
113
|
+
- lib/payments_api/http/faraday_client.rb
|
114
|
+
- lib/payments_api/http/http_call_back.rb
|
115
|
+
- lib/payments_api/http/http_client.rb
|
116
|
+
- lib/payments_api/http/http_method_enum.rb
|
117
|
+
- lib/payments_api/http/http_request.rb
|
118
|
+
- lib/payments_api/http/http_response.rb
|
119
|
+
- lib/payments_api/models/address.rb
|
120
|
+
- lib/payments_api/models/bank.rb
|
121
|
+
- lib/payments_api/models/bank_account.rb
|
122
|
+
- lib/payments_api/models/base_model.rb
|
123
|
+
- lib/payments_api/models/beneficiary.rb
|
124
|
+
- lib/payments_api/models/originator.rb
|
125
|
+
- lib/payments_api/models/payment.rb
|
126
|
+
- lib/payments_api/models/payment_details.rb
|
127
|
+
- lib/payments_api/models/payment_status.rb
|
128
|
+
- lib/payments_api/models/quote.rb
|
129
|
+
- lib/payments_api/utilities/date_time_helper.rb
|
130
|
+
- lib/payments_api/utilities/file_wrapper.rb
|
131
|
+
homepage: https://apimatic.io
|
132
|
+
licenses:
|
133
|
+
- MIT
|
134
|
+
metadata: {}
|
135
|
+
post_install_message:
|
136
|
+
rdoc_options: []
|
137
|
+
require_paths:
|
138
|
+
- lib
|
139
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '2.0'
|
144
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
requirements: []
|
150
|
+
rubyforge_project:
|
151
|
+
rubygems_version: 2.7.6
|
152
|
+
signing_key:
|
153
|
+
specification_version: 4
|
154
|
+
summary: payments_api
|
155
|
+
test_files: []
|