genesis_ruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +11 -0
  3. data/Gemfile +6 -0
  4. data/Gemfile.lock +158 -0
  5. data/LICENSE +21 -0
  6. data/README.md +343 -0
  7. data/Rakefile +12 -0
  8. data/VERSION +1 -0
  9. data/genesis_ruby.gemspec +43 -0
  10. data/lib/genesis_ruby/api/constants/currencies/iso4217.rb +1106 -0
  11. data/lib/genesis_ruby/api/constants/date_time_formats.rb +45 -0
  12. data/lib/genesis_ruby/api/constants/endpoints.rb +18 -0
  13. data/lib/genesis_ruby/api/constants/environments.rb +17 -0
  14. data/lib/genesis_ruby/api/constants/states/state.rb +43 -0
  15. data/lib/genesis_ruby/api/constants/states.rb +86 -0
  16. data/lib/genesis_ruby/api/constants/transactions/parameters/business/payment_types.rb +24 -0
  17. data/lib/genesis_ruby/api/constants/transactions/parameters/recurring/categories.rb +24 -0
  18. data/lib/genesis_ruby/api/constants/transactions/parameters/recurring/types.rb +28 -0
  19. data/lib/genesis_ruby/api/constants/transactions/parameters/sca_exemptions.rb +34 -0
  20. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/browser/color_depths.rb +46 -0
  21. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/card_holder_account/password_change_indicators.rb +37 -0
  22. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/card_holder_account/registration_indicators.rb +37 -0
  23. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/card_holder_account/shipping_address_usage_indicators.rb +34 -0
  24. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/card_holder_account/suspicious_activity_indicators.rb +28 -0
  25. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/card_holder_account/update_indicators.rb +34 -0
  26. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/control/challenge_indicators.rb +34 -0
  27. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/control/challenge_window_sizes.rb +37 -0
  28. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/control/device_types.rb +28 -0
  29. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/merchant_risk/delivery_timeframes.rb +34 -0
  30. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/merchant_risk/pre_order_purchase_indicators.rb +28 -0
  31. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/merchant_risk/reorder_item_indicators.rb +28 -0
  32. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/merchant_risk/shipping_indicators.rb +46 -0
  33. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/purchase/categories.rb +43 -0
  34. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/sdk/interfaces.rb +31 -0
  35. data/lib/genesis_ruby/api/constants/transactions/parameters/threeds/version2/sdk/ui_types.rb +37 -0
  36. data/lib/genesis_ruby/api/constants/transactions.rb +371 -0
  37. data/lib/genesis_ruby/api/mixins/constants/common.rb +27 -0
  38. data/lib/genesis_ruby/api/mixins/requests/address_info_attributes.rb +20 -0
  39. data/lib/genesis_ruby/api/mixins/requests/customer_address/billing_info_attributes.rb +33 -0
  40. data/lib/genesis_ruby/api/mixins/requests/customer_address/customer_info_attributes.rb +26 -0
  41. data/lib/genesis_ruby/api/mixins/requests/customer_address/shipping_info_attributes.rb +33 -0
  42. data/lib/genesis_ruby/api/mixins/requests/document_attributes.rb +14 -0
  43. data/lib/genesis_ruby/api/mixins/requests/financial/async_attributes.rb +34 -0
  44. data/lib/genesis_ruby/api/mixins/requests/financial/base_attributes.rb +16 -0
  45. data/lib/genesis_ruby/api/mixins/requests/financial/business/airlines_air_carriers_attributes.rb +60 -0
  46. data/lib/genesis_ruby/api/mixins/requests/financial/business/business_attributes.rb +56 -0
  47. data/lib/genesis_ruby/api/mixins/requests/financial/business/car_plane_and_boat_rentals_attributes.rb +53 -0
  48. data/lib/genesis_ruby/api/mixins/requests/financial/business/cruise_lines_attributes.rb +50 -0
  49. data/lib/genesis_ruby/api/mixins/requests/financial/business/event_management_attributes.rb +54 -0
  50. data/lib/genesis_ruby/api/mixins/requests/financial/business/furniture_attributes.rb +53 -0
  51. data/lib/genesis_ruby/api/mixins/requests/financial/business/hotels_and_real_estate_rentals_attributes.rb +53 -0
  52. data/lib/genesis_ruby/api/mixins/requests/financial/business/travel_agencies_attributes.rb +88 -0
  53. data/lib/genesis_ruby/api/mixins/requests/financial/cards/credit_card_attributes.rb +31 -0
  54. data/lib/genesis_ruby/api/mixins/requests/financial/cards/fx_rate_attributes.rb +18 -0
  55. data/lib/genesis_ruby/api/mixins/requests/financial/cards/recurring/recurring_category_attributes.rb +31 -0
  56. data/lib/genesis_ruby/api/mixins/requests/financial/cards/recurring/recurring_type_attributes.rb +31 -0
  57. data/lib/genesis_ruby/api/mixins/requests/financial/cards/tokenization_attributes.rb +39 -0
  58. data/lib/genesis_ruby/api/mixins/requests/financial/crypto_attributes.rb +25 -0
  59. data/lib/genesis_ruby/api/mixins/requests/financial/dynamic_descriptor_attributes.rb +114 -0
  60. data/lib/genesis_ruby/api/mixins/requests/financial/gaming_attributes.rb +25 -0
  61. data/lib/genesis_ruby/api/mixins/requests/financial/moto_attributes.rb +25 -0
  62. data/lib/genesis_ruby/api/mixins/requests/financial/notification_attributes.rb +25 -0
  63. data/lib/genesis_ruby/api/mixins/requests/financial/payment_attributes.rb +32 -0
  64. data/lib/genesis_ruby/api/mixins/requests/financial/pending_payment_attributes.rb +25 -0
  65. data/lib/genesis_ruby/api/mixins/requests/financial/reference_attributes.rb +16 -0
  66. data/lib/genesis_ruby/api/mixins/requests/financial/risk_attributes.rb +47 -0
  67. data/lib/genesis_ruby/api/mixins/requests/financial/sca_attributes.rb +37 -0
  68. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/browser.rb +92 -0
  69. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/card_holder_account.rb +183 -0
  70. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/common_attributes.rb +52 -0
  71. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/control.rb +61 -0
  72. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/merchant_risk.rb +114 -0
  73. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/method.rb +44 -0
  74. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/purchase.rb +42 -0
  75. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/recurring.rb +49 -0
  76. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/sdk.rb +107 -0
  77. data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/wpf_attributes.rb +61 -0
  78. data/lib/genesis_ruby/api/mixins/requests/restricted_setter.rb +75 -0
  79. data/lib/genesis_ruby/api/request.rb +171 -0
  80. data/lib/genesis_ruby/api/requests/base/financial.rb +44 -0
  81. data/lib/genesis_ruby/api/requests/base/financials/credit_card.rb +27 -0
  82. data/lib/genesis_ruby/api/requests/financial/cards/authorize.rb +60 -0
  83. data/lib/genesis_ruby/api/requests/financial/cards/authorize3d.rb +76 -0
  84. data/lib/genesis_ruby/api/requests/financial/cards/sale.rb +59 -0
  85. data/lib/genesis_ruby/api/requests/financial/cards/sale3d.rb +75 -0
  86. data/lib/genesis_ruby/api/requests/wpf/create.rb +142 -0
  87. data/lib/genesis_ruby/api/response.rb +91 -0
  88. data/lib/genesis_ruby/builder.rb +42 -0
  89. data/lib/genesis_ruby/builders/base.rb +18 -0
  90. data/lib/genesis_ruby/builders/xml.rb +95 -0
  91. data/lib/genesis_ruby/configuration.rb +177 -0
  92. data/lib/genesis_ruby/connection.rb +20 -0
  93. data/lib/genesis_ruby/dependencies.rb +19 -0
  94. data/lib/genesis_ruby/errors/builder_error.rb +14 -0
  95. data/lib/genesis_ruby/errors/endpoint_not_set_error.rb +14 -0
  96. data/lib/genesis_ruby/errors/error.rb +18 -0
  97. data/lib/genesis_ruby/errors/invalid_argument_error.rb +14 -0
  98. data/lib/genesis_ruby/errors/network_error.rb +14 -0
  99. data/lib/genesis_ruby/errors/object_formatter_error.rb +14 -0
  100. data/lib/genesis_ruby/errors/parameter_error.rb +12 -0
  101. data/lib/genesis_ruby/errors/parser_error.rb +14 -0
  102. data/lib/genesis_ruby/errors/response_error.rb +14 -0
  103. data/lib/genesis_ruby/network/adapter/base_adapter.rb +31 -0
  104. data/lib/genesis_ruby/network/adapter/net_http_adapter.rb +92 -0
  105. data/lib/genesis_ruby/network/base_network.rb +83 -0
  106. data/lib/genesis_ruby/network/net_http.rb +28 -0
  107. data/lib/genesis_ruby/parser.rb +44 -0
  108. data/lib/genesis_ruby/parsers/base.rb +25 -0
  109. data/lib/genesis_ruby/parsers/xml.rb +120 -0
  110. data/lib/genesis_ruby/utils/common.rb +108 -0
  111. data/lib/genesis_ruby/utils/formatters/base.rb +40 -0
  112. data/lib/genesis_ruby/utils/formatters/response/definitions.rb +21 -0
  113. data/lib/genesis_ruby/utils/formatters/response/formats/amount.rb +34 -0
  114. data/lib/genesis_ruby/utils/formatters/response/formats/timestamp.rb +29 -0
  115. data/lib/genesis_ruby/utils/formatters/response/loader.rb +42 -0
  116. data/lib/genesis_ruby/utils/money/base/strategy.rb +38 -0
  117. data/lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb +22 -0
  118. data/lib/genesis_ruby/utils/money/conversions/exponent_to_amount.rb +22 -0
  119. data/lib/genesis_ruby/utils/money/format.rb +34 -0
  120. data/lib/genesis_ruby/utils/money_format.rb +39 -0
  121. data/lib/genesis_ruby/utils/object_formatter.rb +67 -0
  122. data/lib/genesis_ruby/utils/options/api_config.rb +36 -0
  123. data/lib/genesis_ruby/utils/options/base.rb +35 -0
  124. data/lib/genesis_ruby/utils/options/network_adapter_config.rb +41 -0
  125. data/lib/genesis_ruby/utils/transactions/financial_types.rb +50 -0
  126. data/lib/genesis_ruby/utils/transactions/references/capturable_types.rb +52 -0
  127. data/lib/genesis_ruby/utils/transactions/references/refundable_types.rb +70 -0
  128. data/lib/genesis_ruby/utils/transactions/references/voidable_types.rb +49 -0
  129. data/lib/genesis_ruby/utils/transactions/wpf_types.rb +43 -0
  130. data/lib/genesis_ruby/version.rb +5 -0
  131. data/lib/genesis_ruby.rb +57 -0
  132. metadata +372 -0
@@ -0,0 +1,26 @@
1
+ require 'genesis_ruby/errors/parameter_error'
2
+
3
+ module GenesisRuby
4
+ module Api
5
+ module Mixins
6
+ module Requests
7
+ module CustomerAddress
8
+ # Mixin CustomerInfoAttributes
9
+ module CustomerInfoAttributes
10
+
11
+ attr_reader :customer_email
12
+ attr_accessor :customer_phone
13
+
14
+ # Email of the customer
15
+ def customer_email=(value)
16
+ raise GenesisRuby::ParameterError unless value =~ /\A.+@.+\..+\Z/
17
+
18
+ @customer_email = value
19
+ end
20
+
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,33 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module CustomerAddress
6
+ # Mixin shippingInfoAttributes
7
+ module ShippingInfoAttributes
8
+
9
+ attr_accessor :shipping_first_name, :shipping_last_name, :shipping_address1, :shipping_address2,
10
+ :shipping_zip_code, :shipping_city, :shipping_state, :shipping_country
11
+
12
+ protected
13
+
14
+ # Build Hash with all parameters
15
+ def shipping_address_parameters_structure
16
+ {
17
+ first_name: shipping_first_name,
18
+ last_name: shipping_last_name,
19
+ address1: shipping_address1,
20
+ address2: shipping_address2,
21
+ zip_code: shipping_zip_code,
22
+ city: shipping_city,
23
+ state: shipping_state,
24
+ country: shipping_country
25
+ }
26
+ end
27
+
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,14 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ # Document Attributes mixin
6
+ module DocumentAttributes
7
+
8
+ attr_accessor :document_id
9
+
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,34 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # Mixin Async Attributes
7
+ module AsyncAttributes
8
+
9
+ attr_reader :return_success_url, :return_failure_url
10
+
11
+ # Return Success URL setter
12
+ def return_success_url=(value)
13
+ unless GenesisRuby::Utils::Common.valid_url?(value)
14
+ raise ParameterError, "Invalid URL given for #{__method__}"
15
+ end
16
+
17
+ @return_success_url = value
18
+ end
19
+
20
+ # Return Failure URL setter
21
+ def return_failure_url=(value)
22
+ unless GenesisRuby::Utils::Common.valid_url?(value)
23
+ raise ParameterError, "Invalid URL given for #{__method__}"
24
+ end
25
+
26
+ @return_failure_url = value
27
+ end
28
+
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,16 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # Base Financial Transaction Requests attributes
7
+ module BaseAttributes
8
+
9
+ attr_accessor :transaction_id, :usage, :remote_ip
10
+
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,60 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Business
7
+ # Mixin Airlines Air Carriers Attributes
8
+ module AirlinesAirCarriersAttributes
9
+
10
+ attr_accessor :business_airline_code, :business_airline_flight_number, :business_flight_ticket_number,
11
+ :business_flight_origin_city, :business_flight_destination_city,
12
+ :business_airline_tour_operator_name
13
+
14
+ # The date when the flight arrives
15
+ def business_flight_arrival_date
16
+ @business_flight_arrival_date&.strftime(
17
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
18
+ )
19
+ end
20
+
21
+ # The date when the flight arrives
22
+ def business_flight_arrival_date=(value)
23
+ parse_date attribute: __method__, value: value, allow_empty: true
24
+ end
25
+
26
+ # The date when the flight departs
27
+ def business_flight_departure_date
28
+ @business_flight_departure_date&.strftime(
29
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
30
+ )
31
+ end
32
+
33
+ # The date when the flight departs
34
+ def business_flight_departure_date=(value)
35
+ parse_date attribute: __method__, value: value, allow_empty: true
36
+ end
37
+
38
+ protected
39
+
40
+ # Airlines Air Carriers Attributes Structure
41
+ def airlines_air_carriers_attributes_structure
42
+ {
43
+ flight_arrival_date: business_flight_arrival_date,
44
+ flight_departure_date: business_flight_departure_date,
45
+ airline_code: business_airline_code,
46
+ airline_flight_number: business_airline_flight_number,
47
+ flight_ticket_number: business_flight_ticket_number,
48
+ flight_origin_city: business_flight_origin_city,
49
+ flight_destination_city: business_flight_destination_city,
50
+ airline_tour_operator_name: business_airline_tour_operator_name
51
+ }
52
+ end
53
+
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,56 @@
1
+ require 'genesis_ruby/api/mixins/requests/financial/business/airlines_air_carriers_attributes'
2
+ require 'genesis_ruby/api/mixins/requests/financial/business/car_plane_and_boat_rentals_attributes'
3
+ require 'genesis_ruby/api/mixins/requests/financial/business/cruise_lines_attributes'
4
+ require 'genesis_ruby/api/mixins/requests/financial/business/event_management_attributes'
5
+ require 'genesis_ruby/api/mixins/requests/financial/business/furniture_attributes'
6
+ require 'genesis_ruby/api/mixins/requests/financial/business/hotels_and_real_estate_rentals_attributes'
7
+ require 'genesis_ruby/api/mixins/requests/financial/business/travel_agencies_attributes'
8
+ require 'genesis_ruby/api/constants/transactions/parameters/business/payment_types'
9
+
10
+ module GenesisRuby
11
+ module Api
12
+ module Mixins
13
+ module Requests
14
+ module Financial
15
+ module Business
16
+ # Mixin Business Attributes
17
+ module BusinessAttributes
18
+
19
+ include AirlinesAirCarriersAttributes
20
+ include CarPlaneAndBoatRentalsAttributes
21
+ include CruiseLinesAttributes
22
+ include EventManagementAttributes
23
+ include FurnitureAttributes
24
+ include HotelsAndRealEstateRentalsAttributes
25
+ include TravelAgenciesAttributes
26
+
27
+ attr_reader :business_payment_type
28
+
29
+ # The type of payment - can be either deposit or balance
30
+ def business_payment_type=(value)
31
+ allowed_options attribute: __method__,
32
+ allowed: GenesisRuby::Api::Constants::Transactions::Parameters::Business::
33
+ PaymentTypes.all,
34
+ value: value,
35
+ allow_empty: true
36
+ end
37
+
38
+ protected
39
+
40
+ # Business Attributes Structure
41
+ def business_attributes_structure
42
+ {
43
+ payment_type: business_payment_type
44
+ }.merge airlines_air_carriers_attributes_structure, car_plane_and_boat_rentals_attributes_structure,
45
+ cruise_lines_attributes_structure, event_management_attributes_structure,
46
+ furniture_attributes_structure, hotels_and_real_estate_rentals_attributes_structure,
47
+ travel_agencies_attributes_structure
48
+ end
49
+
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,53 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Business
7
+ # Mixin Car Plane and Boat Rentals Attributes
8
+ module CarPlaneAndBoatRentalsAttributes
9
+
10
+ attr_accessor :business_supplier_name
11
+
12
+ # The date when customer takes the vehicle
13
+ def business_vehicle_pick_up_date
14
+ @business_vehicle_pick_up_date&.strftime(
15
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
16
+ )
17
+ end
18
+
19
+ # The date when customer takes the vehicle
20
+ def business_vehicle_pick_up_date=(value)
21
+ parse_date attribute: __method__, value: value, allow_empty: true
22
+ end
23
+
24
+ # The date when the customer returns the vehicle back
25
+ def business_vehicle_return_date
26
+ @business_vehicle_return_date&.strftime(
27
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
28
+ )
29
+ end
30
+
31
+ # The date when the customer returns the vehicle back
32
+ def business_vehicle_return_date=(value)
33
+ parse_date attribute: __method__, value: value, allow_empty: true
34
+ end
35
+
36
+ protected
37
+
38
+ # Car Plane and Boat Rentals Attributes Structure
39
+ def car_plane_and_boat_rentals_attributes_structure
40
+ {
41
+ vehicle_pick_up_date: business_vehicle_pick_up_date,
42
+ vehicle_return_date: business_vehicle_return_date,
43
+ supplier_name: business_supplier_name
44
+ }
45
+ end
46
+
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,50 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Business
7
+ # Mixin Cruise Lines Attributes
8
+ module CruiseLinesAttributes
9
+
10
+ # The date when cruise begins
11
+ def business_cruise_start_date
12
+ @business_cruise_start_date&.strftime(
13
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
14
+ )
15
+ end
16
+
17
+ # The date when cruise begins
18
+ def business_cruise_start_date=(value)
19
+ parse_date attribute: __method__, value: value, allow_empty: true
20
+ end
21
+
22
+ # The date when cruise ends
23
+ def business_cruise_end_date
24
+ @business_cruise_end_date&.strftime(
25
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
26
+ )
27
+ end
28
+
29
+ # The date when cruise ends
30
+ def business_cruise_end_date=(value)
31
+ parse_date attribute: __method__, value: value, allow_empty: true
32
+ end
33
+
34
+ protected
35
+
36
+ # Cruise Lines Attributes Structure
37
+ def cruise_lines_attributes_structure
38
+ {
39
+ cruise_start_date: business_cruise_start_date,
40
+ cruise_end_date: business_cruise_end_date
41
+ }
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,54 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Business
7
+ # Mixin Event Management Attributes
8
+ module EventManagementAttributes
9
+
10
+ attr_accessor :business_event_organizer_id, :business_event_id
11
+
12
+ # The date when event starts
13
+ def business_event_start_date
14
+ @business_event_start_date&.strftime(
15
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
16
+ )
17
+ end
18
+
19
+ # The date when event starts
20
+ def business_event_start_date=(value)
21
+ parse_date attribute: __method__, value: value, allow_empty: true
22
+ end
23
+
24
+ # The date when event ends
25
+ def business_event_end_date
26
+ @business_event_end_date&.strftime(
27
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
28
+ )
29
+ end
30
+
31
+ # The date when event ends
32
+ def business_event_end_date=(value)
33
+ parse_date attribute: __method__, value: value, allow_empty: true
34
+ end
35
+
36
+ protected
37
+
38
+ # Event Management Attributes Structure
39
+ def event_management_attributes_structure
40
+ {
41
+ event_start_date: business_event_start_date,
42
+ event_end_date: business_event_end_date,
43
+ event_organizer_id: business_event_organizer_id,
44
+ event_id: business_event_id
45
+ }
46
+ end
47
+
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,53 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Business
7
+ # Mixin Furniture Attributes
8
+ module FurnitureAttributes
9
+
10
+ attr_accessor :business_name_of_the_supplier
11
+
12
+ # The date when order was placed
13
+ def business_date_of_order
14
+ @business_date_of_order&.strftime(
15
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
16
+ )
17
+ end
18
+
19
+ # The date when order was placed
20
+ def business_date_of_order=(value)
21
+ parse_date attribute: __method__, value: value, allow_empty: true
22
+ end
23
+
24
+ # Date of the expected delivery
25
+ def business_delivery_date
26
+ @business_delivery_date&.strftime(
27
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
28
+ )
29
+ end
30
+
31
+ # Date of the expected delivery
32
+ def business_delivery_date=(value)
33
+ parse_date attribute: __method__, value: value, allow_empty: true
34
+ end
35
+
36
+ protected
37
+
38
+ # Furniture Attributes Structure
39
+ def furniture_attributes_structure
40
+ {
41
+ date_of_order: business_date_of_order,
42
+ delivery_date: business_delivery_date,
43
+ name_of_the_supplier: business_name_of_the_supplier
44
+ }
45
+ end
46
+
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Business
7
+ # Mixin Hotels and Real Estate Rentals Attributes
8
+ module HotelsAndRealEstateRentalsAttributes
9
+
10
+ attr_accessor :business_travel_agency_name
11
+
12
+ # The data when the customer check-in
13
+ def business_check_in_date
14
+ @business_check_in_date&.strftime(
15
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
16
+ )
17
+ end
18
+
19
+ # The data when the customer check-in
20
+ def business_check_in_date=(value)
21
+ parse_date attribute: __method__, value: value, allow_empty: true
22
+ end
23
+
24
+ # The data when the customer check-out
25
+ def business_check_out_date
26
+ @business_check_out_date&.strftime(
27
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
28
+ )
29
+ end
30
+
31
+ # The data when the customer check-out
32
+ def business_check_out_date=(value)
33
+ parse_date attribute: __method__, value: value, allow_empty: true
34
+ end
35
+
36
+ protected
37
+
38
+ # Hotels and Real Estate Rentals Attributes Structure
39
+ def hotels_and_real_estate_rentals_attributes_structure
40
+ {
41
+ check_in_date: business_check_in_date,
42
+ check_out_date: business_check_out_date,
43
+ travel_agency_name: business_travel_agency_name
44
+ }
45
+ end
46
+
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,88 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Business
7
+ # Mixin Travel Agencies Attributes
8
+ module TravelAgenciesAttributes
9
+
10
+ attr_accessor :business_carrier_code, :business_flight_number, :business_ticket_number,
11
+ :business_origin_city, :business_destination_city, :business_travel_agency,
12
+ :business_contractor_name, :business_atol_certificate
13
+
14
+ # The date of arrival
15
+ def business_arrival_date
16
+ @business_arrival_date&.strftime(
17
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
18
+ )
19
+ end
20
+
21
+ # The date of arrival
22
+ def business_arrival_date=(value)
23
+ parse_date attribute: __method__, value: value, allow_empty: true
24
+ end
25
+
26
+ # The date of departure
27
+ def business_departure_date
28
+ @business_departure_date&.strftime(
29
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
30
+ )
31
+ end
32
+
33
+ # The date of departure
34
+ def business_departure_date=(value)
35
+ parse_date attribute: __method__, value: value, allow_empty: true
36
+ end
37
+
38
+ # Pick-up date
39
+ def business_pick_up_date
40
+ @business_pick_up_date&.strftime(
41
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
42
+ )
43
+ end
44
+
45
+ # Pick-up date
46
+ def business_pick_up_date=(value)
47
+ parse_date attribute: __method__, value: value, allow_empty: true
48
+ end
49
+
50
+ # Return date
51
+ def business_return_date
52
+ @business_return_date&.strftime(
53
+ GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
54
+ )
55
+ end
56
+
57
+ # Return date
58
+ def business_return_date=(value)
59
+ parse_date attribute: __method__, value: value, allow_empty: true
60
+ end
61
+
62
+ protected
63
+
64
+ # Travel Agencies Attributes Structure
65
+ def travel_agencies_attributes_structure # rubocop:disable Metrics/MethodLength
66
+ {
67
+ arrival_date: business_arrival_date,
68
+ departure_date: business_departure_date,
69
+ carrier_code: business_carrier_code,
70
+ flight_number: business_flight_number,
71
+ ticket_number: business_ticket_number,
72
+ origin_city: business_origin_city,
73
+ destination_city: business_destination_city,
74
+ travel_agency: business_travel_agency,
75
+ contractor_name: business_contractor_name,
76
+ atol_certificate: business_atol_certificate,
77
+ pick_up_date: business_pick_up_date,
78
+ return_date: business_return_date
79
+ }
80
+ end
81
+
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,31 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Cards
7
+ # Credit Card Attributes
8
+ module CreditCardAttributes
9
+
10
+ attr_accessor :card_holder, :card_number, :cvv, :expiration_month, :expiration_year
11
+
12
+ protected
13
+
14
+ # Credit Card Attributes Structure
15
+ def credit_card_attributes_structure
16
+ {
17
+ card_holder: card_holder,
18
+ card_number: card_number,
19
+ expiration_month: expiration_month,
20
+ expiration_year: expiration_year,
21
+ cvv: cvv
22
+ }
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,18 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Cards
7
+ # Fx Rate Attributes mixin
8
+ module FxRateAttributes
9
+
10
+ attr_accessor :fx_rate_id
11
+
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,31 @@
1
+ require 'genesis_ruby/api/constants/transactions/parameters/recurring/categories'
2
+
3
+ module GenesisRuby
4
+ module Api
5
+ module Mixins
6
+ module Requests
7
+ module Financial
8
+ module Cards
9
+ module Recurring
10
+ # Recurring Category Attributes
11
+ module RecurringCategoryAttributes
12
+
13
+ attr_reader :recurring_category
14
+
15
+ # Specifies whether the recurring transaction is a subscription or standing order
16
+ def recurring_category=(value)
17
+ allowed_options attribute: __method__,
18
+ allowed: GenesisRuby::Api::Constants::Transactions::Parameters::Recurring::
19
+ Categories.all,
20
+ value: value,
21
+ allow_empty: true
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end