digital-payments-sdk 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.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +85 -0
- data/lib/shell_ev/api_helper.rb +10 -0
- data/lib/shell_ev/client.rb +86 -0
- data/lib/shell_ev/configuration.rb +104 -0
- data/lib/shell_ev/controllers/base_controller.rb +66 -0
- data/lib/shell_ev/controllers/digital_payment_enablement_controller.rb +56 -0
- data/lib/shell_ev/controllers/fueling_controller.rb +126 -0
- data/lib/shell_ev/controllers/partner_notification_controller.rb +95 -0
- data/lib/shell_ev/controllers/shell_api_platform_security_authentication_controller.rb +44 -0
- data/lib/shell_ev/controllers/station_locator_controller.rb +76 -0
- data/lib/shell_ev/exceptions/access_token_error_exception.rb +37 -0
- data/lib/shell_ev/exceptions/api_exception.rb +10 -0
- data/lib/shell_ev/exceptions/cancel_fueling_error_response_error_exception.rb +64 -0
- data/lib/shell_ev/exceptions/mpp_acces_token_error_response_exception.rb +44 -0
- data/lib/shell_ev/exceptions/payment_enablement_error_response_exception.rb +37 -0
- data/lib/shell_ev/exceptions/station_locator_bad_request_exception.rb +38 -0
- data/lib/shell_ev/exceptions/station_locator_forbidden_exception.rb +38 -0
- data/lib/shell_ev/exceptions/station_locator_internal_server_error_exception.rb +38 -0
- data/lib/shell_ev/exceptions/station_locator_not_found_exception.rb +38 -0
- data/lib/shell_ev/exceptions/station_locator_unauthorized_exception.rb +38 -0
- data/lib/shell_ev/http/auth/mpp_token.rb +42 -0
- data/lib/shell_ev/http/auth/o_auth_token_post.rb +44 -0
- data/lib/shell_ev/http/http_call_back.rb +10 -0
- data/lib/shell_ev/http/http_method_enum.rb +10 -0
- data/lib/shell_ev/http/http_request.rb +10 -0
- data/lib/shell_ev/http/http_response.rb +10 -0
- data/lib/shell_ev/models/access_token_response.rb +71 -0
- data/lib/shell_ev/models/around_location_array.rb +109 -0
- data/lib/shell_ev/models/around_location_array_data_items.rb +242 -0
- data/lib/shell_ev/models/around_location_array_data_items_loc.rb +99 -0
- data/lib/shell_ev/models/around_location_array_data_items_opening_hours_items.rb +148 -0
- data/lib/shell_ev/models/base_model.rb +62 -0
- data/lib/shell_ev/models/cancel_fueling_error_response.rb +92 -0
- data/lib/shell_ev/models/cancel_fueling_request.rb +61 -0
- data/lib/shell_ev/models/collecting_company.rb +50 -0
- data/lib/shell_ev/models/fault_response.rb +50 -0
- data/lib/shell_ev/models/fault_response_fault.rb +60 -0
- data/lib/shell_ev/models/fault_response_fault_detail.rb +50 -0
- data/lib/shell_ev/models/finalise_fueling_request.rb +181 -0
- data/lib/shell_ev/models/finalise_fueling_request_payment.rb +71 -0
- data/lib/shell_ev/models/finalise_fueling_request_products_items.rb +70 -0
- data/lib/shell_ev/models/loyalty_details.rb +59 -0
- data/lib/shell_ev/models/mobile_payment_registration_request.rb +134 -0
- data/lib/shell_ev/models/mpp_acces_token_response.rb +81 -0
- data/lib/shell_ev/models/mpp_error.rb +94 -0
- data/lib/shell_ev/models/mpp_token_request_body.rb +73 -0
- data/lib/shell_ev/models/oauth_token_post_request_body.rb +73 -0
- data/lib/shell_ev/models/partner_token_request_body.rb +73 -0
- data/lib/shell_ev/models/payment_details_items.rb +78 -0
- data/lib/shell_ev/models/payment_enablement_response.rb +48 -0
- data/lib/shell_ev/models/payment_properties.rb +169 -0
- data/lib/shell_ev/models/prepare_fueling_request.rb +183 -0
- data/lib/shell_ev/models/prepare_fueling_request_device_details_items.rb +95 -0
- data/lib/shell_ev/models/prepare_fueling_response.rb +66 -0
- data/lib/shell_ev/utilities/date_time_helper.rb +11 -0
- data/lib/shell_ev/utilities/file_wrapper.rb +16 -0
- data/lib/shell_ev.rb +85 -0
- data/test/controllers/controller_test_base.rb +29 -0
- data/test/controllers/test_fueling_controller.rb +61 -0
- data/test/controllers/test_partner_notification_controller.rb +60 -0
- data/test/controllers/test_shell_api_platform_security_authentication_controller.rb +36 -0
- data/test/controllers/test_station_locator_controller.rb +44 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +185 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Base model.
|
8
|
+
class BaseModel < CoreLibrary::BaseModel
|
9
|
+
# Returns a Hash representation of the current object.
|
10
|
+
def to_hash
|
11
|
+
# validating the model being serialized
|
12
|
+
self.class.validate(self) if self.class.respond_to?(:validate)
|
13
|
+
|
14
|
+
hash = {}
|
15
|
+
instance_variables.each do |name|
|
16
|
+
value = instance_variable_get(name)
|
17
|
+
name = name[1..]
|
18
|
+
key = self.class.names.key?(name) ? self.class.names[name] : name
|
19
|
+
optional_fields = self.class.optionals
|
20
|
+
nullable_fields = self.class.nullables
|
21
|
+
if value.nil?
|
22
|
+
next unless nullable_fields.include?(name)
|
23
|
+
|
24
|
+
if !optional_fields.include?(name) && !nullable_fields.include?(name)
|
25
|
+
raise ArgumentError,
|
26
|
+
"`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
hash[key] = nil
|
31
|
+
unless value.nil?
|
32
|
+
if respond_to?("to_custom_#{name}")
|
33
|
+
if (value.instance_of? Array) || (value.instance_of? Hash)
|
34
|
+
params = [hash, key]
|
35
|
+
hash[key] = send("to_custom_#{name}", *params)
|
36
|
+
else
|
37
|
+
hash[key] = send("to_custom_#{name}")
|
38
|
+
end
|
39
|
+
elsif respond_to?("to_union_type_#{name}")
|
40
|
+
hash[key] = send("to_union_type_#{name}")
|
41
|
+
elsif value.instance_of? Array
|
42
|
+
hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
|
43
|
+
elsif value.instance_of? Hash
|
44
|
+
hash[key] = {}
|
45
|
+
value.each do |k, v|
|
46
|
+
hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
|
47
|
+
end
|
48
|
+
else
|
49
|
+
hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
hash
|
54
|
+
end
|
55
|
+
|
56
|
+
# Returns a JSON representation of the curent object.
|
57
|
+
def to_json(options = {})
|
58
|
+
hash = to_hash
|
59
|
+
hash.to_json(options)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# # Digital Payments – Errors This section details the structure of the
|
8
|
+
# response Body vs. the different types of errors that could be returned when
|
9
|
+
# Digital Payments system responds with a 400 Response Code. | Error Code
|
10
|
+
# | Error Description | Suggested message to end user | |- |- |- | |
|
11
|
+
# 9342 | Transaction not cancelled, Txn number unknown | Oops sorry! We
|
12
|
+
# are unable to cancel the transaction. Please wait for the site to cancel the
|
13
|
+
# transaction before you retry | | 50004 | Transaction not cancelled,
|
14
|
+
# dispensing is already in progress | Transaction cannot be cancelled,
|
15
|
+
# fueling already in progress | | 50059 | Transaction not cancelable (not
|
16
|
+
# in a 'Processing state') | Transaction cannot be cancelled, fuel has
|
17
|
+
# already been dispensed |
|
18
|
+
class CancelFuelingErrorResponse < BaseModel
|
19
|
+
SKIP = Object.new
|
20
|
+
private_constant :SKIP
|
21
|
+
|
22
|
+
# The high level error code (e.g. missing data)
|
23
|
+
# @return [String]
|
24
|
+
attr_accessor :error_code
|
25
|
+
|
26
|
+
# The high level error message (e.g. mandatory fields have not been
|
27
|
+
# specified.
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :error_description
|
30
|
+
|
31
|
+
# Array of error objects. Majority of the time the errorCode and
|
32
|
+
# errorDescription will suffice
|
33
|
+
# @return [Array[MppError]]
|
34
|
+
attr_accessor :errors
|
35
|
+
|
36
|
+
# A mapping from model property names to API property names.
|
37
|
+
def self.names
|
38
|
+
@_hash = {} if @_hash.nil?
|
39
|
+
@_hash['error_code'] = 'errorCode'
|
40
|
+
@_hash['error_description'] = 'errorDescription'
|
41
|
+
@_hash['errors'] = 'errors'
|
42
|
+
@_hash
|
43
|
+
end
|
44
|
+
|
45
|
+
# An array for optional fields
|
46
|
+
def self.optionals
|
47
|
+
%w[
|
48
|
+
error_code
|
49
|
+
error_description
|
50
|
+
errors
|
51
|
+
]
|
52
|
+
end
|
53
|
+
|
54
|
+
# An array for nullable fields
|
55
|
+
def self.nullables
|
56
|
+
[]
|
57
|
+
end
|
58
|
+
|
59
|
+
def initialize(error_code = SKIP,
|
60
|
+
error_description = SKIP,
|
61
|
+
errors = SKIP)
|
62
|
+
@error_code = error_code unless error_code == SKIP
|
63
|
+
@error_description = error_description unless error_description == SKIP
|
64
|
+
@errors = errors unless errors == SKIP
|
65
|
+
end
|
66
|
+
|
67
|
+
# Creates an instance of the object from a hash.
|
68
|
+
def self.from_hash(hash)
|
69
|
+
return nil unless hash
|
70
|
+
|
71
|
+
# Extract variables from the hash.
|
72
|
+
error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP
|
73
|
+
error_description =
|
74
|
+
hash.key?('errorDescription') ? hash['errorDescription'] : SKIP
|
75
|
+
# Parameter is an array, so we need to iterate through it
|
76
|
+
errors = nil
|
77
|
+
unless hash['errors'].nil?
|
78
|
+
errors = []
|
79
|
+
hash['errors'].each do |structure|
|
80
|
+
errors << (MppError.from_hash(structure) if structure)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
errors = SKIP unless hash.key?('errors')
|
85
|
+
|
86
|
+
# Create object from extracted values.
|
87
|
+
CancelFuelingErrorResponse.new(error_code,
|
88
|
+
error_description,
|
89
|
+
errors)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# CancelFuelingRequest Model.
|
8
|
+
class CancelFuelingRequest < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :mpp_transaction_id
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :reason_code
|
19
|
+
|
20
|
+
# A mapping from model property names to API property names.
|
21
|
+
def self.names
|
22
|
+
@_hash = {} if @_hash.nil?
|
23
|
+
@_hash['mpp_transaction_id'] = 'mppTransactionId'
|
24
|
+
@_hash['reason_code'] = 'reasonCode'
|
25
|
+
@_hash
|
26
|
+
end
|
27
|
+
|
28
|
+
# An array for optional fields
|
29
|
+
def self.optionals
|
30
|
+
%w[
|
31
|
+
mpp_transaction_id
|
32
|
+
reason_code
|
33
|
+
]
|
34
|
+
end
|
35
|
+
|
36
|
+
# An array for nullable fields
|
37
|
+
def self.nullables
|
38
|
+
[]
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize(mpp_transaction_id = SKIP,
|
42
|
+
reason_code = SKIP)
|
43
|
+
@mpp_transaction_id = mpp_transaction_id unless mpp_transaction_id == SKIP
|
44
|
+
@reason_code = reason_code unless reason_code == SKIP
|
45
|
+
end
|
46
|
+
|
47
|
+
# Creates an instance of the object from a hash.
|
48
|
+
def self.from_hash(hash)
|
49
|
+
return nil unless hash
|
50
|
+
|
51
|
+
# Extract variables from the hash.
|
52
|
+
mpp_transaction_id =
|
53
|
+
hash.key?('mppTransactionId') ? hash['mppTransactionId'] : SKIP
|
54
|
+
reason_code = hash.key?('reasonCode') ? hash['reasonCode'] : SKIP
|
55
|
+
|
56
|
+
# Create object from extracted values.
|
57
|
+
CancelFuelingRequest.new(mpp_transaction_id,
|
58
|
+
reason_code)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# CollectingCompany Model.
|
8
|
+
class CollectingCompany < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The ID of the Collecting Company (in GFN), also known as Shell Code of the
|
13
|
+
# selected payer. This property is mandatory if the ColCoCode code is not
|
14
|
+
# passed
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :col_co_id
|
17
|
+
|
18
|
+
# A mapping from model property names to API property names.
|
19
|
+
def self.names
|
20
|
+
@_hash = {} if @_hash.nil?
|
21
|
+
@_hash['col_co_id'] = 'ColCoId'
|
22
|
+
@_hash
|
23
|
+
end
|
24
|
+
|
25
|
+
# An array for optional fields
|
26
|
+
def self.optionals
|
27
|
+
[]
|
28
|
+
end
|
29
|
+
|
30
|
+
# An array for nullable fields
|
31
|
+
def self.nullables
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
|
35
|
+
def initialize(col_co_id = nil)
|
36
|
+
@col_co_id = col_co_id
|
37
|
+
end
|
38
|
+
|
39
|
+
# Creates an instance of the object from a hash.
|
40
|
+
def self.from_hash(hash)
|
41
|
+
return nil unless hash
|
42
|
+
|
43
|
+
# Extract variables from the hash.
|
44
|
+
col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : nil
|
45
|
+
|
46
|
+
# Create object from extracted values.
|
47
|
+
CollectingCompany.new(col_co_id)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# An error response.
|
8
|
+
class FaultResponse < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [FaultResponseFault]
|
14
|
+
attr_accessor :fault
|
15
|
+
|
16
|
+
# A mapping from model property names to API property names.
|
17
|
+
def self.names
|
18
|
+
@_hash = {} if @_hash.nil?
|
19
|
+
@_hash['fault'] = 'fault'
|
20
|
+
@_hash
|
21
|
+
end
|
22
|
+
|
23
|
+
# An array for optional fields
|
24
|
+
def self.optionals
|
25
|
+
%w[
|
26
|
+
fault
|
27
|
+
]
|
28
|
+
end
|
29
|
+
|
30
|
+
# An array for nullable fields
|
31
|
+
def self.nullables
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
|
35
|
+
def initialize(fault = SKIP)
|
36
|
+
@fault = fault unless fault == SKIP
|
37
|
+
end
|
38
|
+
|
39
|
+
# Creates an instance of the object from a hash.
|
40
|
+
def self.from_hash(hash)
|
41
|
+
return nil unless hash
|
42
|
+
|
43
|
+
# Extract variables from the hash.
|
44
|
+
fault = FaultResponseFault.from_hash(hash['fault']) if hash['fault']
|
45
|
+
|
46
|
+
# Create object from extracted values.
|
47
|
+
FaultResponse.new(fault)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# FaultResponseFault Model.
|
8
|
+
class FaultResponseFault < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The description of the error.
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :faultstring
|
15
|
+
|
16
|
+
# The description of the error.
|
17
|
+
# @return [FaultResponseFaultDetail]
|
18
|
+
attr_accessor :detail
|
19
|
+
|
20
|
+
# A mapping from model property names to API property names.
|
21
|
+
def self.names
|
22
|
+
@_hash = {} if @_hash.nil?
|
23
|
+
@_hash['faultstring'] = 'faultstring'
|
24
|
+
@_hash['detail'] = 'detail'
|
25
|
+
@_hash
|
26
|
+
end
|
27
|
+
|
28
|
+
# An array for optional fields
|
29
|
+
def self.optionals
|
30
|
+
%w[
|
31
|
+
faultstring
|
32
|
+
detail
|
33
|
+
]
|
34
|
+
end
|
35
|
+
|
36
|
+
# An array for nullable fields
|
37
|
+
def self.nullables
|
38
|
+
[]
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize(faultstring = SKIP,
|
42
|
+
detail = SKIP)
|
43
|
+
@faultstring = faultstring unless faultstring == SKIP
|
44
|
+
@detail = detail unless detail == SKIP
|
45
|
+
end
|
46
|
+
|
47
|
+
# Creates an instance of the object from a hash.
|
48
|
+
def self.from_hash(hash)
|
49
|
+
return nil unless hash
|
50
|
+
|
51
|
+
# Extract variables from the hash.
|
52
|
+
faultstring = hash.key?('faultstring') ? hash['faultstring'] : SKIP
|
53
|
+
detail = FaultResponseFaultDetail.from_hash(hash['detail']) if hash['detail']
|
54
|
+
|
55
|
+
# Create object from extracted values.
|
56
|
+
FaultResponseFault.new(faultstring,
|
57
|
+
detail)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# FaultResponseFaultDetail Model.
|
8
|
+
class FaultResponseFaultDetail < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The error code.
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :errorcode
|
15
|
+
|
16
|
+
# A mapping from model property names to API property names.
|
17
|
+
def self.names
|
18
|
+
@_hash = {} if @_hash.nil?
|
19
|
+
@_hash['errorcode'] = 'errorcode'
|
20
|
+
@_hash
|
21
|
+
end
|
22
|
+
|
23
|
+
# An array for optional fields
|
24
|
+
def self.optionals
|
25
|
+
%w[
|
26
|
+
errorcode
|
27
|
+
]
|
28
|
+
end
|
29
|
+
|
30
|
+
# An array for nullable fields
|
31
|
+
def self.nullables
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
|
35
|
+
def initialize(errorcode = SKIP)
|
36
|
+
@errorcode = errorcode unless errorcode == SKIP
|
37
|
+
end
|
38
|
+
|
39
|
+
# Creates an instance of the object from a hash.
|
40
|
+
def self.from_hash(hash)
|
41
|
+
return nil unless hash
|
42
|
+
|
43
|
+
# Extract variables from the hash.
|
44
|
+
errorcode = hash.key?('errorcode') ? hash['errorcode'] : SKIP
|
45
|
+
|
46
|
+
# Create object from extracted values.
|
47
|
+
FaultResponseFaultDetail.new(errorcode)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,181 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# FinaliseFuelingRequest Model.
|
8
|
+
class FinaliseFuelingRequest < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :site_name
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [Integer]
|
18
|
+
attr_accessor :timestamp
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [Float]
|
22
|
+
attr_accessor :volume_quantity
|
23
|
+
|
24
|
+
# TODO: Write general description for this method
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :volume_unit
|
27
|
+
|
28
|
+
# TODO: Write general description for this method
|
29
|
+
# @return [Float]
|
30
|
+
attr_accessor :final_price
|
31
|
+
|
32
|
+
# TODO: Write general description for this method
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :currency
|
35
|
+
|
36
|
+
# TODO: Write general description for this method
|
37
|
+
# @return [String]
|
38
|
+
attr_accessor :status
|
39
|
+
|
40
|
+
# TODO: Write general description for this method
|
41
|
+
# @return [String]
|
42
|
+
attr_accessor :site_address
|
43
|
+
|
44
|
+
# TODO: Write general description for this method
|
45
|
+
# @return [Float]
|
46
|
+
attr_accessor :original_price
|
47
|
+
|
48
|
+
# TODO: Write general description for this method
|
49
|
+
# @return [Float]
|
50
|
+
attr_accessor :discount
|
51
|
+
|
52
|
+
# TODO: Write general description for this method
|
53
|
+
# @return [FinaliseFuelingRequestPayment]
|
54
|
+
attr_accessor :payment
|
55
|
+
|
56
|
+
# TODO: Write general description for this method
|
57
|
+
# @return [Array[FinaliseFuelingRequestProductsItems]]
|
58
|
+
attr_accessor :products
|
59
|
+
|
60
|
+
# TODO: Write general description for this method
|
61
|
+
# @return [String]
|
62
|
+
attr_accessor :mpp_transaction_id
|
63
|
+
|
64
|
+
# A mapping from model property names to API property names.
|
65
|
+
def self.names
|
66
|
+
@_hash = {} if @_hash.nil?
|
67
|
+
@_hash['site_name'] = 'siteName'
|
68
|
+
@_hash['timestamp'] = 'timestamp'
|
69
|
+
@_hash['volume_quantity'] = 'volumeQuantity'
|
70
|
+
@_hash['volume_unit'] = 'volumeUnit'
|
71
|
+
@_hash['final_price'] = 'finalPrice'
|
72
|
+
@_hash['currency'] = 'currency'
|
73
|
+
@_hash['status'] = 'status'
|
74
|
+
@_hash['site_address'] = 'siteAddress'
|
75
|
+
@_hash['original_price'] = 'originalPrice'
|
76
|
+
@_hash['discount'] = 'discount'
|
77
|
+
@_hash['payment'] = 'payment'
|
78
|
+
@_hash['products'] = 'products'
|
79
|
+
@_hash['mpp_transaction_id'] = 'mppTransactionId'
|
80
|
+
@_hash
|
81
|
+
end
|
82
|
+
|
83
|
+
# An array for optional fields
|
84
|
+
def self.optionals
|
85
|
+
%w[
|
86
|
+
site_name
|
87
|
+
timestamp
|
88
|
+
volume_quantity
|
89
|
+
volume_unit
|
90
|
+
final_price
|
91
|
+
currency
|
92
|
+
status
|
93
|
+
site_address
|
94
|
+
original_price
|
95
|
+
discount
|
96
|
+
payment
|
97
|
+
products
|
98
|
+
mpp_transaction_id
|
99
|
+
]
|
100
|
+
end
|
101
|
+
|
102
|
+
# An array for nullable fields
|
103
|
+
def self.nullables
|
104
|
+
[]
|
105
|
+
end
|
106
|
+
|
107
|
+
def initialize(site_name = SKIP,
|
108
|
+
timestamp = SKIP,
|
109
|
+
volume_quantity = SKIP,
|
110
|
+
volume_unit = SKIP,
|
111
|
+
final_price = SKIP,
|
112
|
+
currency = SKIP,
|
113
|
+
status = SKIP,
|
114
|
+
site_address = SKIP,
|
115
|
+
original_price = SKIP,
|
116
|
+
discount = SKIP,
|
117
|
+
payment = SKIP,
|
118
|
+
products = SKIP,
|
119
|
+
mpp_transaction_id = SKIP)
|
120
|
+
@site_name = site_name unless site_name == SKIP
|
121
|
+
@timestamp = timestamp unless timestamp == SKIP
|
122
|
+
@volume_quantity = volume_quantity unless volume_quantity == SKIP
|
123
|
+
@volume_unit = volume_unit unless volume_unit == SKIP
|
124
|
+
@final_price = final_price unless final_price == SKIP
|
125
|
+
@currency = currency unless currency == SKIP
|
126
|
+
@status = status unless status == SKIP
|
127
|
+
@site_address = site_address unless site_address == SKIP
|
128
|
+
@original_price = original_price unless original_price == SKIP
|
129
|
+
@discount = discount unless discount == SKIP
|
130
|
+
@payment = payment unless payment == SKIP
|
131
|
+
@products = products unless products == SKIP
|
132
|
+
@mpp_transaction_id = mpp_transaction_id unless mpp_transaction_id == SKIP
|
133
|
+
end
|
134
|
+
|
135
|
+
# Creates an instance of the object from a hash.
|
136
|
+
def self.from_hash(hash)
|
137
|
+
return nil unless hash
|
138
|
+
|
139
|
+
# Extract variables from the hash.
|
140
|
+
site_name = hash.key?('siteName') ? hash['siteName'] : SKIP
|
141
|
+
timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
|
142
|
+
volume_quantity =
|
143
|
+
hash.key?('volumeQuantity') ? hash['volumeQuantity'] : SKIP
|
144
|
+
volume_unit = hash.key?('volumeUnit') ? hash['volumeUnit'] : SKIP
|
145
|
+
final_price = hash.key?('finalPrice') ? hash['finalPrice'] : SKIP
|
146
|
+
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
147
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
148
|
+
site_address = hash.key?('siteAddress') ? hash['siteAddress'] : SKIP
|
149
|
+
original_price = hash.key?('originalPrice') ? hash['originalPrice'] : SKIP
|
150
|
+
discount = hash.key?('discount') ? hash['discount'] : SKIP
|
151
|
+
payment = FinaliseFuelingRequestPayment.from_hash(hash['payment']) if hash['payment']
|
152
|
+
# Parameter is an array, so we need to iterate through it
|
153
|
+
products = nil
|
154
|
+
unless hash['products'].nil?
|
155
|
+
products = []
|
156
|
+
hash['products'].each do |structure|
|
157
|
+
products << (FinaliseFuelingRequestProductsItems.from_hash(structure) if structure)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
products = SKIP unless hash.key?('products')
|
162
|
+
mpp_transaction_id =
|
163
|
+
hash.key?('mppTransactionId') ? hash['mppTransactionId'] : SKIP
|
164
|
+
|
165
|
+
# Create object from extracted values.
|
166
|
+
FinaliseFuelingRequest.new(site_name,
|
167
|
+
timestamp,
|
168
|
+
volume_quantity,
|
169
|
+
volume_unit,
|
170
|
+
final_price,
|
171
|
+
currency,
|
172
|
+
status,
|
173
|
+
site_address,
|
174
|
+
original_price,
|
175
|
+
discount,
|
176
|
+
payment,
|
177
|
+
products,
|
178
|
+
mpp_transaction_id)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# FinaliseFuelingRequestPayment Model.
|
8
|
+
class FinaliseFuelingRequestPayment < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :method
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :card_id
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :card_last_digits
|
23
|
+
|
24
|
+
# A mapping from model property names to API property names.
|
25
|
+
def self.names
|
26
|
+
@_hash = {} if @_hash.nil?
|
27
|
+
@_hash['method'] = 'method'
|
28
|
+
@_hash['card_id'] = 'cardId'
|
29
|
+
@_hash['card_last_digits'] = 'cardLastDigits'
|
30
|
+
@_hash
|
31
|
+
end
|
32
|
+
|
33
|
+
# An array for optional fields
|
34
|
+
def self.optionals
|
35
|
+
%w[
|
36
|
+
method
|
37
|
+
card_id
|
38
|
+
card_last_digits
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for nullable fields
|
43
|
+
def self.nullables
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
def initialize(method = SKIP,
|
48
|
+
card_id = SKIP,
|
49
|
+
card_last_digits = SKIP)
|
50
|
+
@method = method unless method == SKIP
|
51
|
+
@card_id = card_id unless card_id == SKIP
|
52
|
+
@card_last_digits = card_last_digits unless card_last_digits == SKIP
|
53
|
+
end
|
54
|
+
|
55
|
+
# Creates an instance of the object from a hash.
|
56
|
+
def self.from_hash(hash)
|
57
|
+
return nil unless hash
|
58
|
+
|
59
|
+
# Extract variables from the hash.
|
60
|
+
method = hash.key?('method') ? hash['method'] : SKIP
|
61
|
+
card_id = hash.key?('cardId') ? hash['cardId'] : SKIP
|
62
|
+
card_last_digits =
|
63
|
+
hash.key?('cardLastDigits') ? hash['cardLastDigits'] : SKIP
|
64
|
+
|
65
|
+
# Create object from extracted values.
|
66
|
+
FinaliseFuelingRequestPayment.new(method,
|
67
|
+
card_id,
|
68
|
+
card_last_digits)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|