apimatic-ci-cd-test 1.0.0

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.
Files changed (32) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +1168 -0
  4. data/lib/payments_api.rb +49 -0
  5. data/lib/payments_api/api_helper.rb +277 -0
  6. data/lib/payments_api/client.rb +42 -0
  7. data/lib/payments_api/configuration.rb +116 -0
  8. data/lib/payments_api/controllers/base_controller.rb +49 -0
  9. data/lib/payments_api/controllers/payments_controller.rb +272 -0
  10. data/lib/payments_api/controllers/quotes_controller.rb +213 -0
  11. data/lib/payments_api/exceptions/api_exception.rb +20 -0
  12. data/lib/payments_api/exceptions/request_error_exception.rb +29 -0
  13. data/lib/payments_api/http/auth/custom_header_auth.rb +16 -0
  14. data/lib/payments_api/http/faraday_client.rb +70 -0
  15. data/lib/payments_api/http/http_call_back.rb +24 -0
  16. data/lib/payments_api/http/http_client.rb +104 -0
  17. data/lib/payments_api/http/http_method_enum.rb +13 -0
  18. data/lib/payments_api/http/http_request.rb +50 -0
  19. data/lib/payments_api/http/http_response.rb +29 -0
  20. data/lib/payments_api/models/address.rb +80 -0
  21. data/lib/payments_api/models/bank.rb +63 -0
  22. data/lib/payments_api/models/bank_account.rb +48 -0
  23. data/lib/payments_api/models/base_model.rb +47 -0
  24. data/lib/payments_api/models/beneficiary.rb +62 -0
  25. data/lib/payments_api/models/originator.rb +44 -0
  26. data/lib/payments_api/models/payment.rb +127 -0
  27. data/lib/payments_api/models/payment_details.rb +53 -0
  28. data/lib/payments_api/models/payment_status.rb +44 -0
  29. data/lib/payments_api/models/quote.rb +104 -0
  30. data/lib/payments_api/utilities/date_time_helper.rb +156 -0
  31. data/lib/payments_api/utilities/file_wrapper.rb +17 -0
  32. metadata +155 -0
@@ -0,0 +1,63 @@
1
+ # payments_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaymentsApi
7
+ # Bank Information Object
8
+ class Bank < BaseModel
9
+ # Bank Name
10
+ # @return [String]
11
+ attr_accessor :name
12
+
13
+ # Address Information
14
+ # @return [Address]
15
+ attr_accessor :address
16
+
17
+ # Routing Code. Currently only supported for USD wires. When using, please
18
+ # only provide SWIFT code OR routing code (not both)
19
+ # @return [String]
20
+ attr_accessor :routing_code
21
+
22
+ # SWIFT BIC
23
+ # @return [String]
24
+ attr_accessor :swift_code
25
+
26
+ # A mapping from model property names to API property names.
27
+ def self.names
28
+ @_hash = {} if @_hash.nil?
29
+ @_hash['name'] = 'name'
30
+ @_hash['address'] = 'address'
31
+ @_hash['routing_code'] = 'routingCode'
32
+ @_hash['swift_code'] = 'swiftCode'
33
+ @_hash
34
+ end
35
+
36
+ def initialize(name = nil,
37
+ address = nil,
38
+ routing_code = nil,
39
+ swift_code = nil)
40
+ @name = name
41
+ @address = address
42
+ @routing_code = routing_code
43
+ @swift_code = swift_code
44
+ end
45
+
46
+ # Creates an instance of the object from a hash.
47
+ def self.from_hash(hash)
48
+ return nil unless hash
49
+
50
+ # Extract variables from the hash.
51
+ name = hash['name']
52
+ address = Address.from_hash(hash['address']) if hash['address']
53
+ routing_code = hash['routingCode']
54
+ swift_code = hash['swiftCode']
55
+
56
+ # Create object from extracted values.
57
+ Bank.new(name,
58
+ address,
59
+ routing_code,
60
+ swift_code)
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,48 @@
1
+ # payments_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaymentsApi
7
+ # Bank Account Information Object.**NOTE** - originatorBankAccount bank data
8
+ # should not be provided when creating a new Payment. This information is
9
+ # retrieved from the database based on the provided bank ID.**NOTE** - bank
10
+ # object is required for all BankAccount objects except originatorBankAccount
11
+ class BankAccount < BaseModel
12
+ # Bank Account Number / IBAN. Required for Beneficiary Bank. Optional for
13
+ # Intermediary Bank.
14
+ # @return [String]
15
+ attr_accessor :account_number
16
+
17
+ # Bank Information Object
18
+ # @return [Bank]
19
+ attr_accessor :bank
20
+
21
+ # A mapping from model property names to API property names.
22
+ def self.names
23
+ @_hash = {} if @_hash.nil?
24
+ @_hash['account_number'] = 'accountNumber'
25
+ @_hash['bank'] = 'bank'
26
+ @_hash
27
+ end
28
+
29
+ def initialize(account_number = nil,
30
+ bank = nil)
31
+ @account_number = account_number
32
+ @bank = bank
33
+ end
34
+
35
+ # Creates an instance of the object from a hash.
36
+ def self.from_hash(hash)
37
+ return nil unless hash
38
+
39
+ # Extract variables from the hash.
40
+ account_number = hash['accountNumber']
41
+ bank = Bank.from_hash(hash['bank']) if hash['bank']
42
+
43
+ # Create object from extracted values.
44
+ BankAccount.new(account_number,
45
+ bank)
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,47 @@
1
+ # payments_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaymentsApi
7
+ # Base model.
8
+ class BaseModel
9
+ # Returns a Hash representation of the current object.
10
+ def to_hash
11
+ hash = {}
12
+ instance_variables.each do |name|
13
+ value = instance_variable_get(name)
14
+ name = name[1..-1]
15
+ key = self.class.names.key?(name) ? self.class.names[name] : name
16
+
17
+ hash[key] = nil
18
+ unless value.nil?
19
+ if respond_to?("to_#{name}")
20
+ if (value.instance_of? Array) || (value.instance_of? Hash)
21
+ params = [hash, key]
22
+ hash[key] = send("to_#{name}", *params)
23
+ else
24
+ hash[key] = send("to_#{name}")
25
+ end
26
+ elsif value.instance_of? Array
27
+ hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
28
+ elsif value.instance_of? Hash
29
+ hash[key] = {}
30
+ value.each do |k, v|
31
+ hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
32
+ end
33
+ else
34
+ hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
35
+ end
36
+ end
37
+ end
38
+ hash
39
+ end
40
+
41
+ # Returns a JSON representation of the curent object.
42
+ def to_json(options = {})
43
+ hash = to_hash
44
+ hash.to_json(options)
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,62 @@
1
+ # payments_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module PaymentsApi
7
+ # Beneficiary Information Object
8
+ class Beneficiary < BaseModel
9
+ # Beneficiary Name
10
+ # @return [String]
11
+ attr_accessor :name
12
+
13
+ # Address Information
14
+ # @return [Address]
15
+ attr_accessor :address
16
+
17
+ # Beneficiary Email Address
18
+ # @return [String]
19
+ attr_accessor :email
20
+
21
+ # Beneficiary Phone Number
22
+ # @return [String]
23
+ attr_accessor :phone_number
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['name'] = 'name'
29
+ @_hash['address'] = 'address'
30
+ @_hash['email'] = 'email'
31
+ @_hash['phone_number'] = 'phoneNumber'
32
+ @_hash
33
+ end
34
+
35
+ def initialize(name = nil,
36
+ address = nil,
37
+ email = nil,
38
+ phone_number = nil)
39
+ @name = name
40
+ @address = address
41
+ @email = email
42
+ @phone_number = phone_number
43
+ end
44
+
45
+ # Creates an instance of the object from a hash.
46
+ def self.from_hash(hash)
47
+ return nil unless hash
48
+
49
+ # Extract variables from the hash.
50
+ name = hash['name']
51
+ address = Address.from_hash(hash['address']) if hash['address']
52
+ email = hash['email']
53
+ phone_number = hash['phoneNumber']
54
+
55
+ # Create object from extracted values.
56
+ Beneficiary.new(name,
57
+ address,
58
+ email,
59
+ phone_number)
60
+ end
61
+ end
62
+ end
@@ -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
+ # Originator Information Object
8
+ class Originator < BaseModel
9
+ # Originator Name
10
+ # @return [String]
11
+ attr_accessor :name
12
+
13
+ # Address Information
14
+ # @return [Address]
15
+ attr_accessor :address
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['name'] = 'name'
21
+ @_hash['address'] = 'address'
22
+ @_hash
23
+ end
24
+
25
+ def initialize(name = nil,
26
+ address = nil)
27
+ @name = name
28
+ @address = address
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
+ name = hash['name']
37
+ address = Address.from_hash(hash['address']) if hash['address']
38
+
39
+ # Create object from extracted values.
40
+ Originator.new(name,
41
+ address)
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,127 @@
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 Object
8
+ class Payment < BaseModel
9
+ # Payment ID
10
+ # @return [Integer]
11
+ attr_accessor :id
12
+
13
+ # Quote ID
14
+ # @return [Integer]
15
+ attr_accessor :quote_id
16
+
17
+ # Originator Information Object
18
+ # @return [Originator]
19
+ attr_accessor :originator
20
+
21
+ # Bank Account Information Object.**NOTE** - originatorBankAccount bank data
22
+ # should not be provided when creating a new Payment. This information is
23
+ # retrieved from the database based on the provided bank ID.**NOTE** - bank
24
+ # object is required for all BankAccount objects except
25
+ # originatorBankAccount
26
+ # @return [BankAccount]
27
+ attr_accessor :originator_bank_account
28
+
29
+ # Beneficiary Information Object
30
+ # @return [Beneficiary]
31
+ attr_accessor :beneficiary
32
+
33
+ # Bank Account Information Object.**NOTE** - originatorBankAccount bank data
34
+ # should not be provided when creating a new Payment. This information is
35
+ # retrieved from the database based on the provided bank ID.**NOTE** - bank
36
+ # object is required for all BankAccount objects except
37
+ # originatorBankAccount
38
+ # @return [BankAccount]
39
+ attr_accessor :beneficiary_bank_account
40
+
41
+ # Bank Account Information Object.**NOTE** - originatorBankAccount bank data
42
+ # should not be provided when creating a new Payment. This information is
43
+ # retrieved from the database based on the provided bank ID.**NOTE** - bank
44
+ # object is required for all BankAccount objects except
45
+ # originatorBankAccount
46
+ # @return [BankAccount]
47
+ attr_accessor :intermediary_bank_account
48
+
49
+ # Payment Information Data
50
+ # @return [PaymentDetails]
51
+ attr_accessor :details
52
+
53
+ # Payment Information Data
54
+ # @return [PaymentStatus]
55
+ attr_accessor :status
56
+
57
+ # A mapping from model property names to API property names.
58
+ def self.names
59
+ @_hash = {} if @_hash.nil?
60
+ @_hash['id'] = 'id'
61
+ @_hash['quote_id'] = 'quoteId'
62
+ @_hash['originator'] = 'originator'
63
+ @_hash['originator_bank_account'] = 'originatorBankAccount'
64
+ @_hash['beneficiary'] = 'beneficiary'
65
+ @_hash['beneficiary_bank_account'] = 'beneficiaryBankAccount'
66
+ @_hash['intermediary_bank_account'] = 'intermediaryBankAccount'
67
+ @_hash['details'] = 'details'
68
+ @_hash['status'] = 'status'
69
+ @_hash
70
+ end
71
+
72
+ def initialize(quote_id = nil,
73
+ originator = nil,
74
+ beneficiary = nil,
75
+ beneficiary_bank_account = nil,
76
+ details = nil,
77
+ id = nil,
78
+ originator_bank_account = nil,
79
+ intermediary_bank_account = nil,
80
+ status = nil)
81
+ @id = id
82
+ @quote_id = quote_id
83
+ @originator = originator
84
+ @originator_bank_account = originator_bank_account
85
+ @beneficiary = beneficiary
86
+ @beneficiary_bank_account = beneficiary_bank_account
87
+ @intermediary_bank_account = intermediary_bank_account
88
+ @details = details
89
+ @status = status
90
+ end
91
+
92
+ # Creates an instance of the object from a hash.
93
+ def self.from_hash(hash)
94
+ return nil unless hash
95
+
96
+ # Extract variables from the hash.
97
+ quote_id = hash['quoteId']
98
+ originator = Originator.from_hash(hash['originator']) if
99
+ hash['originator']
100
+ beneficiary = Beneficiary.from_hash(hash['beneficiary']) if
101
+ hash['beneficiary']
102
+ if hash['beneficiaryBankAccount']
103
+ beneficiary_bank_account = BankAccount.from_hash(hash['beneficiaryBankAccount'])
104
+ end
105
+ details = PaymentDetails.from_hash(hash['details']) if hash['details']
106
+ id = hash['id']
107
+ if hash['originatorBankAccount']
108
+ originator_bank_account = BankAccount.from_hash(hash['originatorBankAccount'])
109
+ end
110
+ if hash['intermediaryBankAccount']
111
+ intermediary_bank_account = BankAccount.from_hash(hash['intermediaryBankAccount'])
112
+ end
113
+ status = PaymentStatus.from_hash(hash['status']) if hash['status']
114
+
115
+ # Create object from extracted values.
116
+ Payment.new(quote_id,
117
+ originator,
118
+ beneficiary,
119
+ beneficiary_bank_account,
120
+ details,
121
+ id,
122
+ originator_bank_account,
123
+ intermediary_bank_account,
124
+ status)
125
+ end
126
+ end
127
+ end
@@ -0,0 +1,53 @@
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 PaymentDetails < BaseModel
9
+ # Purpose of payment
10
+ # @return [String]
11
+ attr_accessor :purpose_of_payment
12
+
13
+ # Memo from Originator to Beneficiary
14
+ # @return [String]
15
+ attr_accessor :memo
16
+
17
+ # Payment Reference Information. Typically includes FI to FI notes
18
+ # @return [String]
19
+ attr_accessor :payment_reference
20
+
21
+ # A mapping from model property names to API property names.
22
+ def self.names
23
+ @_hash = {} if @_hash.nil?
24
+ @_hash['purpose_of_payment'] = 'purposeOfPayment'
25
+ @_hash['memo'] = 'memo'
26
+ @_hash['payment_reference'] = 'paymentReference'
27
+ @_hash
28
+ end
29
+
30
+ def initialize(purpose_of_payment = nil,
31
+ memo = nil,
32
+ payment_reference = nil)
33
+ @purpose_of_payment = purpose_of_payment
34
+ @memo = memo
35
+ @payment_reference = payment_reference
36
+ end
37
+
38
+ # Creates an instance of the object from a hash.
39
+ def self.from_hash(hash)
40
+ return nil unless hash
41
+
42
+ # Extract variables from the hash.
43
+ purpose_of_payment = hash['purposeOfPayment']
44
+ memo = hash['memo']
45
+ payment_reference = hash['paymentReference']
46
+
47
+ # Create object from extracted values.
48
+ PaymentDetails.new(purpose_of_payment,
49
+ memo,
50
+ payment_reference)
51
+ end
52
+ end
53
+ end