transferzero-sdk 1.16.0 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +92 -0
  3. data/README.md +15 -4
  4. data/docs/Document.md +2 -0
  5. data/docs/PayinMethod.md +12 -4
  6. data/docs/PayinMethodDetails.md +5 -5
  7. data/docs/PayinMethodDetailsMobile.md +3 -3
  8. data/docs/PayinMethodDetailsNGNBank.md +2 -2
  9. data/docs/PayinMethodResponse.md +17 -0
  10. data/docs/PayinMethodState.md +16 -0
  11. data/docs/PayinMethodUxFlow.md +16 -0
  12. data/docs/PayinMethodsApi.md +256 -0
  13. data/docs/PayoutMethod.md +1 -1
  14. data/docs/PayoutMethodDetails.md +4 -2
  15. data/docs/PayoutMethodDetailsGNFMobile.md +23 -0
  16. data/docs/PayoutMethodDetailsKESBank.md +3 -1
  17. data/docs/PayoutMethodDetailsKESMobile.md +3 -1
  18. data/docs/PayoutMethodDetailsXAFMobile.md +25 -0
  19. data/docs/PayoutMethodDetailsXOFBank.md +3 -1
  20. data/docs/PayoutMethodDetailsXOFCash.md +1 -1
  21. data/docs/PayoutMethodDetailsXOFMobile.md +3 -1
  22. data/docs/PayoutMethodDetailsZARBank.md +2 -0
  23. data/docs/PayoutMethodTransferReasonEnum.md +16 -0
  24. data/docs/Recipient.md +2 -0
  25. data/docs/RecipientStateReasonDetails.md +3 -3
  26. data/docs/Sender.md +4 -0
  27. data/docs/StateReasonDetails.md +23 -0
  28. data/lib/transferzero-sdk/api/payin_methods_api.rb +244 -0
  29. data/lib/transferzero-sdk/api_client.rb +1 -1
  30. data/lib/transferzero-sdk/models/document.rb +11 -1
  31. data/lib/transferzero-sdk/models/payin_method.rb +47 -9
  32. data/lib/transferzero-sdk/models/payin_method_details.rb +9 -15
  33. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +8 -14
  34. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +2 -2
  35. data/lib/transferzero-sdk/models/payin_method_response.rb +202 -0
  36. data/lib/transferzero-sdk/models/payin_method_state.rb +39 -0
  37. data/lib/transferzero-sdk/models/payin_method_ux_flow.rb +31 -0
  38. data/lib/transferzero-sdk/models/payout_method.rb +1 -1
  39. data/lib/transferzero-sdk/models/payout_method_details.rb +17 -6
  40. data/lib/transferzero-sdk/models/payout_method_details_gnf_mobile.rb +250 -0
  41. data/lib/transferzero-sdk/models/payout_method_details_kes_bank.rb +11 -7
  42. data/lib/transferzero-sdk/models/payout_method_details_kes_mobile.rb +11 -7
  43. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +1 -1
  44. data/lib/transferzero-sdk/models/payout_method_details_xaf_mobile.rb +259 -0
  45. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +14 -5
  46. data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +6 -1
  47. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +14 -5
  48. data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +11 -2
  49. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +1 -0
  50. data/lib/transferzero-sdk/models/payout_method_transfer_reason_enum.rb +137 -0
  51. data/lib/transferzero-sdk/models/recipient.rb +45 -1
  52. data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +21 -2
  53. data/lib/transferzero-sdk/models/sender.rb +21 -1
  54. data/lib/transferzero-sdk/models/state_reason_details.rb +235 -0
  55. data/lib/transferzero-sdk/version.rb +1 -1
  56. data/lib/transferzero-sdk.rb +8 -0
  57. data/spec/api/payin_methods_api_spec.rb +84 -0
  58. data/spec/models/payin_method_response_spec.rb +41 -0
  59. data/spec/models/payin_method_state_spec.rb +35 -0
  60. data/spec/models/payin_method_ux_flow_spec.rb +35 -0
  61. data/spec/models/payout_method_details_gnf_mobile_spec.rb +59 -0
  62. data/spec/models/payout_method_details_xaf_mobile_spec.rb +65 -0
  63. data/spec/models/payout_method_transfer_reason_enum_spec.rb +35 -0
  64. data/spec/models/state_reason_details_spec.rb +59 -0
  65. metadata +35 -2
@@ -15,28 +15,40 @@ require 'date'
15
15
  module TransferZero
16
16
  # This describes the specific details on how the funds should be collected from the sender.
17
17
  class PayinMethod
18
- # Describes how the payment should be requested from the user. Possible values: - `NGN::Bank`: NGN bank and card collection requests - `NGN::Mobile`: NGN mobile collections - `GHS::Mobile`: GHS mobile collections - `TZS::Mobile`: TZS mobile collections - `UGX::Mobile`: UGX mobile collections - `EUR::Bank`: EUR IBAN collections - `GBP::Bank`: GBP IBAN collections
18
+ # Describes how the payment should be requested from the sender. Possible values: - `GHS::Mobile`: GHS mobile collections - `UGX::Mobile`: UGX mobile collections - `EUR::Bank`: EUR IBAN collections - `GBP::Bank`: GBP IBAN collections
19
19
  attr_accessor :type
20
20
 
21
+ attr_accessor :ux_flow
22
+
21
23
  attr_accessor :in_details
22
24
 
25
+ attr_accessor :id
26
+
27
+ attr_accessor :state
28
+
29
+ attr_accessor :state_reason_details
30
+
23
31
  # This will contain the description on where to pay the funds. Please see the [Collections Details](https://docs.transferzero.com/docs/collection-details) in the API documentation on what to expect here.
24
32
  attr_accessor :out_details
25
33
 
26
34
  # This will contain the instructions on how to pay the funds. Please see the [Collections Details](https://docs.transferzero.com/docs/collection-details) in the API documentation on what to expect here.
27
35
  attr_accessor :instructions
28
36
 
29
- # Describes which provider to use for collection. Please see the [Collections Details](https://docs.transferzero.com/docs/collection-details) in the API documentation on the valid values
30
- attr_accessor :provider
37
+ # The fields that have some problems and don't pass validation
38
+ attr_accessor :errors
31
39
 
32
40
  # Attribute mapping from ruby-style variable name to JSON key.
33
41
  def self.attribute_map
34
42
  {
35
43
  :'type' => :'type',
44
+ :'ux_flow' => :'ux_flow',
36
45
  :'in_details' => :'in_details',
46
+ :'id' => :'id',
47
+ :'state' => :'state',
48
+ :'state_reason_details' => :'state_reason_details',
37
49
  :'out_details' => :'out_details',
38
50
  :'instructions' => :'instructions',
39
- :'provider' => :'provider'
51
+ :'errors' => :'errors'
40
52
  }
41
53
  end
42
54
 
@@ -44,10 +56,14 @@ class PayinMethod
44
56
  def self.openapi_types
45
57
  {
46
58
  :'type' => :'String',
59
+ :'ux_flow' => :'PayinMethodUxFlow',
47
60
  :'in_details' => :'PayinMethodDetails',
61
+ :'id' => :'String',
62
+ :'state' => :'PayinMethodState',
63
+ :'state_reason_details' => :'StateReasonDetails',
48
64
  :'out_details' => :'Object',
49
65
  :'instructions' => :'Object',
50
- :'provider' => :'String'
66
+ :'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
51
67
  }
52
68
  end
53
69
 
@@ -70,10 +86,26 @@ class PayinMethod
70
86
  self.type = attributes[:'type']
71
87
  end
72
88
 
89
+ if attributes.key?(:'ux_flow')
90
+ self.ux_flow = attributes[:'ux_flow']
91
+ end
92
+
73
93
  if attributes.key?(:'in_details')
74
94
  self.in_details = attributes[:'in_details']
75
95
  end
76
96
 
97
+ if attributes.key?(:'id')
98
+ self.id = attributes[:'id']
99
+ end
100
+
101
+ if attributes.key?(:'state')
102
+ self.state = attributes[:'state']
103
+ end
104
+
105
+ if attributes.key?(:'state_reason_details')
106
+ self.state_reason_details = attributes[:'state_reason_details']
107
+ end
108
+
77
109
  if attributes.key?(:'out_details')
78
110
  self.out_details = attributes[:'out_details']
79
111
  end
@@ -82,8 +114,10 @@ class PayinMethod
82
114
  self.instructions = attributes[:'instructions']
83
115
  end
84
116
 
85
- if attributes.key?(:'provider')
86
- self.provider = attributes[:'provider']
117
+ if attributes.key?(:'errors')
118
+ if (value = attributes[:'errors']).is_a?(Hash)
119
+ self.errors = value
120
+ end
87
121
  end
88
122
  end
89
123
 
@@ -106,10 +140,14 @@ class PayinMethod
106
140
  return true if self.equal?(o)
107
141
  self.class == o.class &&
108
142
  type == o.type &&
143
+ ux_flow == o.ux_flow &&
109
144
  in_details == o.in_details &&
145
+ id == o.id &&
146
+ state == o.state &&
147
+ state_reason_details == o.state_reason_details &&
110
148
  out_details == o.out_details &&
111
149
  instructions == o.instructions &&
112
- provider == o.provider
150
+ errors == o.errors
113
151
  end
114
152
 
115
153
  # @see the `==` method
@@ -121,7 +159,7 @@ class PayinMethod
121
159
  # Calculates hash code according to all attributes.
122
160
  # @return [Integer] Hash code
123
161
  def hash
124
- [type, in_details, out_details, instructions, provider].hash
162
+ [type, ux_flow, in_details, id, state, state_reason_details, out_details, instructions, errors].hash
125
163
  end
126
164
 
127
165
  require 'active_support/core_ext/hash'
@@ -15,17 +15,16 @@ require 'date'
15
15
  module TransferZero
16
16
  # Fields needed by the payment processor. Depends on the chose payin type. See the appropriate model details for more info: - `NGN::Bank`: see [`PayinMethodDetailsNGNBank`](#model-PayinMethodDetailsNGNBank) - `GHS::Mobile`: see [`PayinMethodDetailsMobile`](#model-PayinMethodDetailsMobile) - `UGX::Mobile`: see [`PayinMethodDetailsMobile`](#model-PayinMethodDetailsMobile) - `TZS::Mobile`: see [`PayinMethodDetailsMobile`](#model-PayinMethodDetailsMobile) Note that some payin processors don't require additional input, these include `paga` through `NGN::Mobile`, `lhv` through `EUR::Bank` and `GBP::Bank`. Some providers like `providus` also have all of their fields set as optional, so you might not want to set any values. To use these providers please set this value to `{}` (an empty hash)
17
17
  class PayinMethodDetails
18
- # The payment method which the user will use to make the payments. Options are `bank`, `card` or you can leave empty to support both.
18
+ # The payment method which the sender will use to make the payments. Options are `bank`, `card` or you can leave empty to support both.
19
19
  attr_accessor :payment_method
20
20
 
21
- # This is where the user should be redirected back when the payment has been finished
21
+ # This is where the sender should be redirected back when the payment has been finished
22
22
  attr_accessor :redirect_url
23
23
 
24
24
  # The phone number where the funds should be collected from
25
25
  attr_accessor :phone_number
26
26
 
27
- # States whether to send out the instructions to the phone number on how to pay the funds or not. This shuold always be set to true, otherwise the sender might not receive a prompt for payment.
28
- attr_accessor :send_instructions
27
+ attr_accessor :mobile_provider
29
28
 
30
29
  # Please make sure the refund_address is a valid BTC address belonging to the sender, as that is going to be used in case the transaction has to be refunded.
31
30
  attr_accessor :refund_address
@@ -36,7 +35,7 @@ class PayinMethodDetails
36
35
  :'payment_method' => :'payment_method',
37
36
  :'redirect_url' => :'redirect_url',
38
37
  :'phone_number' => :'phone_number',
39
- :'send_instructions' => :'send_instructions',
38
+ :'mobile_provider' => :'mobile_provider',
40
39
  :'refund_address' => :'refund_address'
41
40
  }
42
41
  end
@@ -47,7 +46,7 @@ class PayinMethodDetails
47
46
  :'payment_method' => :'String',
48
47
  :'redirect_url' => :'String',
49
48
  :'phone_number' => :'String',
50
- :'send_instructions' => :'Boolean',
49
+ :'mobile_provider' => :'PayoutMethodMobileProviderEnum',
51
50
  :'refund_address' => :'String'
52
51
  }
53
52
  end
@@ -88,8 +87,8 @@ class PayinMethodDetails
88
87
  self.phone_number = attributes[:'phone_number']
89
88
  end
90
89
 
91
- if attributes.key?(:'send_instructions')
92
- self.send_instructions = attributes[:'send_instructions']
90
+ if attributes.key?(:'mobile_provider')
91
+ self.mobile_provider = attributes[:'mobile_provider']
93
92
  end
94
93
 
95
94
  if attributes.key?(:'refund_address')
@@ -101,17 +100,12 @@ class PayinMethodDetails
101
100
  # @return Array for valid properties with the reasons
102
101
  def list_invalid_properties
103
102
  invalid_properties = Array.new
104
- if @phone_number.nil?
105
- invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
106
- end
107
-
108
103
  invalid_properties
109
104
  end
110
105
 
111
106
  # Check to see if the all the properties in the model are valid
112
107
  # @return true if the model is valid
113
108
  def valid?
114
- return false if @phone_number.nil?
115
109
  _one_of_found = false
116
110
  openapi_one_of.each do |_class|
117
111
  _one_of = TransferZero.const_get(_class).build_from_hash(self.to_hash)
@@ -139,7 +133,7 @@ class PayinMethodDetails
139
133
  payment_method == o.payment_method &&
140
134
  redirect_url == o.redirect_url &&
141
135
  phone_number == o.phone_number &&
142
- send_instructions == o.send_instructions &&
136
+ mobile_provider == o.mobile_provider &&
143
137
  refund_address == o.refund_address
144
138
  end
145
139
 
@@ -152,7 +146,7 @@ class PayinMethodDetails
152
146
  # Calculates hash code according to all attributes.
153
147
  # @return [Integer] Hash code
154
148
  def hash
155
- [payment_method, redirect_url, phone_number, send_instructions, refund_address].hash
149
+ [payment_method, redirect_url, phone_number, mobile_provider, refund_address].hash
156
150
  end
157
151
 
158
152
  require 'active_support/core_ext/hash'
@@ -13,19 +13,18 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- # ```JSON \"details\": { \"phone_number\": \"+2569999999\", \"send_instructions\": true } ```
16
+ # ```JSON \"details\": { \"phone_number\": \"+2569999999\", } ```
17
17
  class PayinMethodDetailsMobile
18
18
  # The phone number where the funds should be collected from
19
19
  attr_accessor :phone_number
20
20
 
21
- # States whether to send out the instructions to the phone number on how to pay the funds or not. This shuold always be set to true, otherwise the sender might not receive a prompt for payment.
22
- attr_accessor :send_instructions
21
+ attr_accessor :mobile_provider
23
22
 
24
23
  # Attribute mapping from ruby-style variable name to JSON key.
25
24
  def self.attribute_map
26
25
  {
27
26
  :'phone_number' => :'phone_number',
28
- :'send_instructions' => :'send_instructions'
27
+ :'mobile_provider' => :'mobile_provider'
29
28
  }
30
29
  end
31
30
 
@@ -33,7 +32,7 @@ class PayinMethodDetailsMobile
33
32
  def self.openapi_types
34
33
  {
35
34
  :'phone_number' => :'String',
36
- :'send_instructions' => :'Boolean'
35
+ :'mobile_provider' => :'PayoutMethodMobileProviderEnum'
37
36
  }
38
37
  end
39
38
 
@@ -56,8 +55,8 @@ class PayinMethodDetailsMobile
56
55
  self.phone_number = attributes[:'phone_number']
57
56
  end
58
57
 
59
- if attributes.key?(:'send_instructions')
60
- self.send_instructions = attributes[:'send_instructions']
58
+ if attributes.key?(:'mobile_provider')
59
+ self.mobile_provider = attributes[:'mobile_provider']
61
60
  end
62
61
  end
63
62
 
@@ -65,17 +64,12 @@ class PayinMethodDetailsMobile
65
64
  # @return Array for valid properties with the reasons
66
65
  def list_invalid_properties
67
66
  invalid_properties = Array.new
68
- if @phone_number.nil?
69
- invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
70
- end
71
-
72
67
  invalid_properties
73
68
  end
74
69
 
75
70
  # Check to see if the all the properties in the model are valid
76
71
  # @return true if the model is valid
77
72
  def valid?
78
- return false if @phone_number.nil?
79
73
  true
80
74
  end
81
75
 
@@ -85,7 +79,7 @@ class PayinMethodDetailsMobile
85
79
  return true if self.equal?(o)
86
80
  self.class == o.class &&
87
81
  phone_number == o.phone_number &&
88
- send_instructions == o.send_instructions
82
+ mobile_provider == o.mobile_provider
89
83
  end
90
84
 
91
85
  # @see the `==` method
@@ -97,7 +91,7 @@ class PayinMethodDetailsMobile
97
91
  # Calculates hash code according to all attributes.
98
92
  # @return [Integer] Hash code
99
93
  def hash
100
- [phone_number, send_instructions].hash
94
+ [phone_number, mobile_provider].hash
101
95
  end
102
96
 
103
97
  require 'active_support/core_ext/hash'
@@ -15,10 +15,10 @@ require 'date'
15
15
  module TransferZero
16
16
  # ```JSON \"details\": { \"redirect_url\": \"http://redirect.back.to\" } ```
17
17
  class PayinMethodDetailsNGNBank
18
- # The payment method which the user will use to make the payments. Options are `bank`, `card` or you can leave empty to support both.
18
+ # The payment method which the sender will use to make the payments. Options are `bank`, `card` or you can leave empty to support both.
19
19
  attr_accessor :payment_method
20
20
 
21
- # This is where the user should be redirected back when the payment has been finished
21
+ # This is where the sender should be redirected back when the payment has been finished
22
22
  attr_accessor :redirect_url
23
23
 
24
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ class PayinMethodResponse
17
+ attr_accessor :object
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'object' => :'object'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'object' => :'PayinMethod'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ if (!attributes.is_a?(Hash))
37
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayinMethodResponse` initialize method"
38
+ end
39
+
40
+ # check to see if the attribute exists and convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h|
42
+ if (!self.class.attribute_map.key?(k.to_sym))
43
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayinMethodResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
44
+ end
45
+ h[k.to_sym] = v
46
+ }
47
+
48
+ if attributes.key?(:'object')
49
+ self.object = attributes[:'object']
50
+ end
51
+ end
52
+
53
+ # Show invalid properties with the reasons. Usually used together with valid?
54
+ # @return Array for valid properties with the reasons
55
+ def list_invalid_properties
56
+ invalid_properties = Array.new
57
+ invalid_properties
58
+ end
59
+
60
+ # Check to see if the all the properties in the model are valid
61
+ # @return true if the model is valid
62
+ def valid?
63
+ true
64
+ end
65
+
66
+ # Checks equality by comparing each attribute.
67
+ # @param [Object] Object to be compared
68
+ def ==(o)
69
+ return true if self.equal?(o)
70
+ self.class == o.class &&
71
+ object == o.object
72
+ end
73
+
74
+ # @see the `==` method
75
+ # @param [Object] Object to be compared
76
+ def eql?(o)
77
+ self == o
78
+ end
79
+
80
+ # Calculates hash code according to all attributes.
81
+ # @return [Integer] Hash code
82
+ def hash
83
+ [object].hash
84
+ end
85
+
86
+ require 'active_support/core_ext/hash'
87
+ require 'active_support/hash_with_indifferent_access.rb'
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
93
+ self.class.openapi_types.each_pair do |key, type|
94
+ if type =~ /\AArray<(.*)>/i
95
+ # check to ensure the input is an array given that the the attribute
96
+ # is documented as an array but the input is not
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
+ end
100
+ elsif !attributes[self.class.attribute_map[key]].nil?
101
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
103
+ end
104
+
105
+ self
106
+ end
107
+
108
+ # Deserializes the data based on type
109
+ # @param string type Data type
110
+ # @param string value Value to be deserialized
111
+ # @return [Object] Deserialized data
112
+ def _deserialize(type, value)
113
+ case type.to_sym
114
+ when :DateTime
115
+ DateTime.parse(value)
116
+ when :Date
117
+ Date.parse(value)
118
+ when :String
119
+ value.to_s
120
+ when :Integer
121
+ value.to_i
122
+ when :Float
123
+ value.to_f
124
+ when :Boolean
125
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
+ true
127
+ else
128
+ false
129
+ end
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ else # model
145
+ temp_model = TransferZero.const_get(type).new
146
+ temp_model.build_from_hash(value)
147
+ end
148
+ end
149
+
150
+ # Returns the string representation of the object
151
+ # @return [String] String presentation of the object
152
+ def to_s
153
+ to_hash.to_s
154
+ end
155
+
156
+ # to_body is an alias to to_hash (backward compatibility)
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_body
159
+ to_hash
160
+ end
161
+
162
+ # Returns the object in the form of hash
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_hash
165
+ hash = {}
166
+ self.class.attribute_map.each_pair do |attr, param|
167
+ value = self.send(attr)
168
+ next if value.nil?
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
172
+ end
173
+
174
+ def [](key)
175
+ to_hash[key]
176
+ end
177
+
178
+ def dig(*args)
179
+ to_hash.dig(*args)
180
+ end
181
+
182
+ # Outputs non-array value in the form of hash
183
+ # For object, use to_hash. Otherwise, just return the value
184
+ # @param [Object] value Any valid value
185
+ # @return [Hash] Returns the value in the form of hash
186
+ def _to_hash(value)
187
+ if value.is_a?(Array)
188
+ value.compact.map { |v| _to_hash(v) }
189
+ elsif value.is_a?(Hash)
190
+ {}.tap do |hash|
191
+ value.each { |k, v| hash[k] = _to_hash(v) }
192
+ end
193
+ elsif value.respond_to? :to_hash
194
+ value.to_hash
195
+ else
196
+ value
197
+ end
198
+ end
199
+
200
+ end
201
+
202
+ end
@@ -0,0 +1,39 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ class PayinMethodState
17
+
18
+ INCOMPLETE = "incomplete".freeze
19
+ INITIAL = "initial".freeze
20
+ PENDING = "pending".freeze
21
+ SUCCESS = "success".freeze
22
+ PROCESSING = "processing".freeze
23
+ ERROR = "error".freeze
24
+ MISPAID = "mispaid".freeze
25
+ CANCELED = "canceled".freeze
26
+ REFUNDED = "refunded".freeze
27
+ EXCEPTION = "exception".freeze
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ constantValues = PayinMethodState.constants.select { |c| PayinMethodState::const_get(c) == value }
34
+ raise "Invalid ENUM value #{value} for class #PayinMethodState" if constantValues.empty? && !value.empty?
35
+ value
36
+ end
37
+ end
38
+
39
+ end
@@ -0,0 +1,31 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ class PayinMethodUxFlow
17
+
18
+ USSD_POPUP = "ussd_popup".freeze
19
+ BANK_TRANSFER = "bank_transfer".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def build_from_hash(value)
25
+ constantValues = PayinMethodUxFlow.constants.select { |c| PayinMethodUxFlow::const_get(c) == value }
26
+ raise "Invalid ENUM value #{value} for class #PayinMethodUxFlow" if constantValues.empty? && !value.empty?
27
+ value
28
+ end
29
+ end
30
+
31
+ end
@@ -15,7 +15,7 @@ require 'date'
15
15
  module TransferZero
16
16
  # This describes the specific details on how the payment has to be routed to the recipient.
17
17
  class PayoutMethod
18
- # Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `NGN::Mobile` - for Nigerian mobile money payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `GHS::Cash` - for Ghanaian cash remittance payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `TZS::Mobile` - for Tanzanian mobile money payments. - `XOF::Mobile` - for mobile money payments to West-Africa. - `XOF::Bank` - for Senegalese bank account payments. - `XOF::Cash` - for Senegalese cash remittance payments. - `MAD::Cash` - for Moroccan cash remittance payments. - `EUR::Bank` - for IBAN bank transfers in EUR. - `GBP::Bank` - for IBAN bank and FP accounts transfers in GBP. - `ZAR::Bank` - for South Africa bank account payments. - `USD::Bank` - for USD account payments. *** Currently Nigeria only and in Beta phase *** - `USD::Cash` - for USD cash remittance payments. *** Currently Nigeria only and in Beta phase *** - `KES::Bank` - for Kenyan bank account payments. - `KES::Mobile` - for Kenyan mobile money payments. You can also send funds to the internal balance using `CCY::Balance`, where `CCY` is the appropriate currency. See [Collection from senders](https://docs.transferzero.com/docs/additional-features/#collections-from-senders) for more info on how to collect money into internal balance
18
+ # Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `NGN::Mobile` - for Nigerian mobile money payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `GHS::Cash` - for Ghanaian cash remittance payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `TZS::Mobile` - for Tanzanian mobile money payments. - `XOF::Mobile` - for mobile money payments to West-Africa. - `XOF::Bank` - for Senegalese bank account payments. - `XOF::Cash` - for Senegalese cash remittance payments. - `MAD::Cash` - for Moroccan cash remittance payments. - `EUR::Bank` - for IBAN bank transfers in EUR. - `GBP::Bank` - for IBAN bank and FP accounts transfers in GBP. - `ZAR::Bank` - for South Africa bank account payments. - `USD::Bank` - for USD account payments. *** Currently Nigeria only and in Beta phase *** - `USD::Cash` - for USD cash remittance payments. *** Currently Nigeria only and in Beta phase *** - `KES::Bank` - for Kenyan bank account payments. - `KES::Mobile` - for Kenyan mobile money payments. - `XAF::Mobile` - for mobile money payments to Cameroon. - `GNF::Mobile` - for mobile money payments to Guinea. You can also send funds to the internal balance using `CCY::Balance`, where `CCY` is the appropriate currency. See [Collection from senders](https://docs.transferzero.com/docs/additional-features/#collections-from-senders) for more info on how to collect money into internal balance
19
19
  attr_accessor :type
20
20
 
21
21
  attr_accessor :details