genesis_ruby 0.1.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 (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,28 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Constants
4
+ module Transactions
5
+ module Parameters
6
+ module Threeds
7
+ module Version2
8
+ module MerchantRisk
9
+ # Threeds Version2 Merchant Risk Pre-Order Purchase Indicators
10
+ class PreOrderPurchaseIndicators
11
+
12
+ extend Mixins::Constants::Common
13
+
14
+ # Merchandise Available
15
+ MERCHANDISE_AVAILABLE = 'merchandise_available'.freeze
16
+
17
+ # Future Availability
18
+ FUTURE_AVAILABILITY = 'future_availability'.freeze
19
+
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Constants
4
+ module Transactions
5
+ module Parameters
6
+ module Threeds
7
+ module Version2
8
+ module MerchantRisk
9
+ # Threeds Version2 Merchant Risk Re-Order Item Indicators
10
+ class ReorderItemIndicators
11
+
12
+ extend Mixins::Constants::Common
13
+
14
+ # First Time
15
+ FIRST_TIME = 'first_time'.freeze
16
+
17
+ # Reordered
18
+ REORDERED = 'reordered'.freeze
19
+
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,46 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Constants
4
+ module Transactions
5
+ module Parameters
6
+ module Threeds
7
+ module Version2
8
+ module MerchantRisk
9
+ # Threeds Version2 Merchant Risk Shipping Indicators
10
+ class ShippingIndicators
11
+
12
+ extend Mixins::Constants::Common
13
+
14
+ # Sale as Billing
15
+ SAME_AS_BILLING = 'same_as_billing'.freeze
16
+
17
+ # Stored Address
18
+ STORED_ADDRESS = 'stored_address'.freeze
19
+
20
+ # Verified Address
21
+ VERIFIED_ADDRESS = 'verified_address'.freeze
22
+
23
+ # Pick Up
24
+ PICK_UP = 'pick_up'.freeze
25
+
26
+ # Digital Goods
27
+ DIGITAL_GOODS = 'digital_goods'.freeze
28
+
29
+ # Travel
30
+ TRAVEL = 'travel'.freeze
31
+
32
+ # Event Tickets
33
+ EVENT_TICKETS = 'event_tickets'.freeze
34
+
35
+ # Other
36
+ OTHER = 'other'.freeze
37
+
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,43 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Constants
4
+ module Transactions
5
+ module Parameters
6
+ module Threeds
7
+ module Version2
8
+ module Purchase
9
+ # Threeds Version2 Purchase Categories
10
+ class Categories
11
+
12
+ extend Mixins::Constants::Common
13
+
14
+ # Goods
15
+ GOODS = 'goods'.freeze
16
+
17
+ # Service
18
+ SERVICE = 'service'.freeze
19
+
20
+ # Acceptance check
21
+ CHECK_ACCEPTANCE = 'check_acceptance'.freeze
22
+
23
+ # Funding account
24
+ ACCOUNT_FUNDING = 'account_funding'.freeze
25
+
26
+ # Cash quasi
27
+ QUASI_CASH = 'quasi_cash'.freeze
28
+
29
+ # Prepaid activation
30
+ PREPAID_ACTIVATION = 'prepaid_activation'.freeze
31
+
32
+ # Load
33
+ LOAN = 'loan'.freeze
34
+
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,31 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Constants
4
+ module Transactions
5
+ module Parameters
6
+ module Threeds
7
+ module Version2
8
+ module Sdk
9
+ # Threeds Version2 Sdk Categories
10
+ class Interfaces
11
+
12
+ extend Mixins::Constants::Common
13
+
14
+ # Native interface
15
+ NATIVE = 'native'.freeze
16
+
17
+ # Html inteface
18
+ HTML = 'html'.freeze
19
+
20
+ # Both interfaces
21
+ BOTH = 'both'.freeze
22
+
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,37 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Constants
4
+ module Transactions
5
+ module Parameters
6
+ module Threeds
7
+ module Version2
8
+ module Sdk
9
+ # Threeds Version2 Sdk Categories
10
+ class UiTypes
11
+
12
+ extend Mixins::Constants::Common
13
+
14
+ # Text
15
+ TEXT = 'text'.freeze
16
+
17
+ # Single Select
18
+ SINGLE_SELECT = 'single_select'.freeze
19
+
20
+ # Multi Select
21
+ MULTI_SELECT = 'multi_select'.freeze
22
+
23
+ # Out of bag
24
+ OUT_OF_BAG = 'out_of_bag'.freeze
25
+
26
+ # Othre html
27
+ OTHER_HTML = 'other_html'.freeze
28
+
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,371 @@
1
+ require 'genesis_ruby/api/mixins/constants/common'
2
+
3
+ module GenesisRuby
4
+ module Api
5
+ module Constants
6
+ # Available Transaction Types definitions
7
+ module Transactions
8
+
9
+ extend Mixins::Constants::Common
10
+
11
+ # Account Verification
12
+ ACCOUNT_VERIFICATION = 'account_verification'.freeze
13
+
14
+ # African Mobile Payout, or otherwise known as Disbursement, is an APM used to process Mobile network operator
15
+ # payments. It is an async payment method and will be approved once the payment is processed with the Mobile
16
+ # network operator
17
+ AFRICAN_MOBILE_PAYOUT = 'african_mobile_payout'.freeze
18
+
19
+ # African Mobile Sale, otherwise known as Charge, is an APM used to process Mobile network operator payments.
20
+ # It is an async payment method and will be approved once the payment is processed with the Mobile network
21
+ # operator
22
+ AFRICAN_MOBILE_SALE = 'african_mobile_sale'.freeze
23
+
24
+ # Apple pay is payment method working with apple devices
25
+ APPLE_PAY = 'apple_pay'.freeze
26
+
27
+ # Argencard is a debit or credit card used in Argentina. It allows online shoppers to pay offline
28
+ # for their online purchases at over 150,000 physical outlets.
29
+ ARGENCARD = 'argencard'.freeze
30
+
31
+ # Aura is a local Brazilian credit card.
32
+ AURA = 'aura'.freeze
33
+
34
+ # A standard Authorization
35
+ AUTHORIZE = 'authorize'.freeze
36
+
37
+ # 3D-Secure Authorization
38
+ AUTHORIZE_3D = 'authorize3d'.freeze
39
+
40
+ # Baloto is a cash payment option in Colombia. It allows the customers to receive a voucher at check-out.
41
+ # The voucher can then be paid in any of the Via Boleto offices in cash.
42
+ BALOTO = 'baloto'.freeze
43
+
44
+ # Bancomer offers two options for payments in Mexico, cash payment and bank transfer.
45
+ BANCOMER = 'bancomer'.freeze
46
+
47
+ # Bancontact is a local Belgian debit card scheme.
48
+ # All Belgian debit cards are co-branded Bancontact and Maestro.
49
+ BANCONTACT = 'bcmc'.freeze
50
+
51
+ # Banco de Occidente is a cash payment method for Colombia
52
+ BANCO_DE_OCCIDENTE = 'banco_de_occidente'.freeze
53
+
54
+ # Banco do Brasil offers online bank transfer payment service.
55
+ BANCO_DO_BRASIL = 'banco_do_brasil'.freeze
56
+
57
+ # BitPay Payout is a crypto currency payout method where merchants are requesting
58
+ # payouts in FIAT currency and the funds are transfered in Bitcoin equivalent to a crypto wallet address.
59
+ BITPAY_PAYOUT = 'bitpay_payout'.freeze
60
+
61
+ # BitPay Refund is a custom refund method which will handle the asynchronous BitPay refund workflow.
62
+ # BitPay refunds can only be done on former transactions. Therefore, the reference id for the
63
+ # corresponding BitPay Sale transaction is mandatory.
64
+ BITPAY_REFUND = 'bitpay_refund'.freeze
65
+
66
+ # BitPay is a cryptocurrency payments provider supporting blockchain payments
67
+ # with Bitcoin (BTC) and BitcoinCash (BCH).
68
+ BITPAY_SALE = 'bitpay_sale'.freeze
69
+
70
+ # Boleto is a payment service in Brazil
71
+ BOLETO = 'boleto'.freeze
72
+
73
+ # Bradesco is a payment service in Brazil
74
+ BRADESCO = 'bradesco'.freeze
75
+
76
+ # Cabal is a local debit/credit card brand in Argentina which can be used for online purchases.
77
+ CABAL = 'cabal'.freeze
78
+
79
+ # Capture settles a transaction which has been authorized before.
80
+ CAPTURE = 'capture'.freeze
81
+
82
+ # Voucher-based payment
83
+ CASHU = 'cashu'.freeze
84
+
85
+ # Cencosud is a local credit card in Argentina
86
+ CENCOSUD = 'cencosud'.freeze
87
+
88
+ # Credits (also known as Credit Fund Transfer a.k.a. CFT)
89
+ CREDIT = 'credit'.freeze
90
+
91
+ # Davivienda is offering the Bill pay service which is a fast, easy and secure way to pay and manage
92
+ # your bills online to anyone, anytime in Colombia.
93
+ DAVIVIENDA = 'davivienda'.freeze
94
+
95
+ # Efecty is an offline cash payment voucher option in Colombia.
96
+ EFECTY = 'efecty'.freeze
97
+
98
+ # Elo is a local Brazilian payment card.
99
+ ELO = 'elo'.freeze
100
+
101
+ # e-payment standard
102
+ # Direct PPRO transaction
103
+ EPS = 'eps'.freeze
104
+
105
+ # eZeeCard Payout is a sync based payout method.
106
+ # It's merchant initiated and can only reference specific transaction types
107
+ EZEECARD_PAYOUT = 'ezeecard_payout'.freeze
108
+
109
+ # Wallet-based payment
110
+ EZEEWALLET = 'ezeewallet'.freeze
111
+
112
+ # Fashioncheque transactions are made using gift card provided by Fashioncheque.
113
+ # Using a fashioncheque transaction, the amount is immediately billed to the customer’s gift card.
114
+ # It can be reversed via a void transaction on the same day of the transaction.
115
+ # They can also be refunded.
116
+ FASHIONCHEQUE = 'fashioncheque'.freeze
117
+
118
+ # GiroPay
119
+ # Direct PPRO transaction
120
+ GIROPAY = 'giropay'.freeze
121
+
122
+ # Google Pay allows shoppers to purchase with credit and debit cards linked to their Google account.
123
+ GOOGLE_PAY = 'google_pay'.freeze
124
+
125
+ # iDEAL
126
+ # Direct PPRO transaction
127
+ IDEAL = 'ideal'.freeze
128
+
129
+ # iDebit connects consumers to their online banking directly from checkout, enabling secure,
130
+ # real-time payments without a credit card.
131
+ # Using iDebit allows consumers to transfer funds to merchants without
132
+ # revealing their personal banking information.
133
+ # iDebit Payin is only asynchronous and uses eCheck.
134
+ IDEBIT_PAYIN = 'idebit_payin'.freeze
135
+
136
+ # iDebit connects consumers to their online banking directly from checkout, enabling secure,
137
+ # real-time payments without a credit card.
138
+ # Using iDebit allows consumers to transfer funds to merchants without
139
+ # revealing their personal banking information.
140
+ # iDebit Payout is only synchronous and uses eCheck.
141
+ IDEBIT_PAYOUT = 'idebit_payout'.freeze
142
+
143
+ # Incremental authorizations are used in preauthorization workflow to extend the preauthorization amount,
144
+ # extend the preauthorization time-frame
145
+ INCREMENTAL_AUTHORIZE = 'incremental_authorize'.freeze
146
+
147
+ # A standard initial recurring
148
+ # @deprecated Since 0.1.0 Payment method is deprecated and will be removed
149
+ INIT_RECURRING_SALE = 'init_recurring_sale'.freeze
150
+
151
+ # 3D-based initial recurring
152
+ # @deprecated Since 0.1.0 Payment method is deprecated and will be removed
153
+ INIT_RECURRING_SALE_3D = 'init_recurring_sale3d'.freeze
154
+
155
+ # InstaDebit connects consumers to their online banking directly from checkout, enabling secure,
156
+ # real- time payments without a credit card.
157
+ # Using InstaDebit allows consumers to transfer funds to merchants without
158
+ # revealing their personal banking information.
159
+ # InstaDebit Payin is only asynchronous and uses online bank transfer.
160
+ INSTA_DEBIT_PAYIN = 'insta_debit_payin'.freeze
161
+
162
+ # InstaDebit connects consumers to their online banking directly from checkout, enabling secure,
163
+ # real- time payments without a credit card.
164
+ # Using InstaDebit allows consumers to transfer funds to merchants without
165
+ # revealing their personal banking information.
166
+ # InstaDebit Payout is only synchronous and uses online bank transfer.
167
+ INSTA_DEBIT_PAYOUT = 'insta_debit_payout'.freeze
168
+
169
+ # Intersolve transactions are made using gift card provided by Intersolve
170
+ # Using a intersolve transaction, the amount is immediately billed to the customer’s gift card.
171
+ # It can be reversed via a void transaction.
172
+ INTERSOLVE = 'intersolve'.freeze
173
+
174
+ # Alternative payments refer to payment methods that are used as an alternative to credit card payments.
175
+ # Each alternative payment method has its own unique application, settlement process and currency support.
176
+ INVOICE = 'invoice'.freeze
177
+
178
+ # A Invoice capture can only be used after a Invoice on the same transaction.
179
+ INVOICE_CAPTURE = 'invoice_capture'.freeze
180
+
181
+ # The amount can be fully or partially refunded. Invoice refunds can only be done on former
182
+ # Invoice Capture (settled) transactions.
183
+ INVOICE_REFUND = 'invoice_refund'.freeze
184
+
185
+ # Itau is a real-time online bank transfer method and a virtual card.
186
+ ITAU = 'itau'.freeze
187
+
188
+ # Multibanco allows Portuguese shoppers to do payments through the Internet by using virtual credit cards
189
+ MULTIBANCO = 'multibanco'.freeze
190
+
191
+ # My Bank is an overlay banking system
192
+ MY_BANK = 'my_bank'.freeze
193
+
194
+ # Naranja is a local credit card issued in Argentina which can be used for purchases over the internet.
195
+ NARANJA = 'naranja'.freeze
196
+
197
+ # Nativa is an Argentinian credit card provided by the National Bank of Argentina.
198
+ NATIVA = 'nativa'.freeze
199
+
200
+ # Neosurf is a prepaid card (voucher) that is used for online shopping. The card is available in over 100,000
201
+ # stores worldwide, where customers can buy the prepaid vouchers, denominated up to EUR 250.00 or
202
+ # its equivalent in other currencies.
203
+ NEOSURF = 'neosurf'.freeze
204
+
205
+ # Neteller
206
+ NETELLER = 'neteller'.freeze
207
+
208
+ # Online Banking is an oBeP-style alternative payment method that allows you to pay directly
209
+ # with your ebank account. After initiating a transaction, the online banking will redirect you to their page.
210
+ # There you will find a list with available banks to finish the payment.
211
+ ONLINE_BANKING_PAYIN = 'online_banking'.freeze
212
+
213
+ # Bank Pay-out is a bank pay-out method. It allows merchants to transfer funds directly to customers’
214
+ # bank accounts.
215
+ ONLINE_BANKING_PAYOUT = 'bank_payout'.freeze
216
+
217
+ # OXXO is the preferred payment method in Mexico. It is a cash payment via a barcode document
218
+ # thats accepted in more than 14,000 stores.
219
+ OXXO = 'oxxo'.freeze
220
+
221
+ # P24 is an online banking payment, popular in Poland
222
+ P24 = 'p24'.freeze
223
+
224
+ # Pago Facil is a payment service in Argentina that allows its users to send money,
225
+ # top up their cell phone and payments.
226
+ PAGO_FACIL = 'pago_facil'.freeze
227
+
228
+ # Partial reversal transactions are used in preauthorization workflow to release a part of the
229
+ # total authorized amount before a partial capture to be submitted. A transaction of this type
230
+ # should refer the preauthorization directly.
231
+ PARTIAL_REVERSAL = 'partial_reversal'.freeze
232
+
233
+ # PayByVouchers via oBeP
234
+ # @deprecated Payment method is deprecated and will be removed
235
+ PAYBYVOUCHER_YEEPAY = 'paybyvoucher_yeepay'.freeze
236
+
237
+ # Payouts transactions
238
+ PAYOUT = 'payout'.freeze
239
+
240
+ # Voucher-based payment
241
+ PAYSAFECARD = 'paysafecard'.freeze
242
+
243
+ # PayU is a payment method for Czech Republic and Poland
244
+ PAYU = 'payu'.freeze
245
+
246
+ # PayPal transaction is a fast and easy way for buyers to pay with their PayPal account.
247
+ # It gives buyers all the transaction details at once, including order details, shipping options,
248
+ # insurance choices, and tax totals.
249
+ PAY_PAL = 'pay_pal'.freeze
250
+
251
+ # Pix is a payment service created by the Central Bank of Brazil (BACEN),
252
+ # which represents a new way of receiving/sending money. Pix allows payments
253
+ # to be made instantly. The customer can pay bills, invoices, public utilities,
254
+ # transfer and receive credits in a facilitated manner, using only Pix keys (CPF/CNPJ).
255
+ PIX = 'pix'.freeze
256
+
257
+ # POLi is Australia's most popular online real time debit payment system.
258
+ POLI = 'poli'.freeze
259
+
260
+ # PostFinance is an online banking provider in Switzerland
261
+ POST_FINANCE = 'post_finance'.freeze
262
+
263
+ # Supports payments via EPS, SafetyPay, TrustPay, ELV, Przelewy24, and GiroPay
264
+ PPRO = 'ppro'.freeze
265
+
266
+ # PSE (Pagos Seguros en Linea) is the preferred alternative payment solution in Colombia.
267
+ # The solution consists of an interface that offers the client the option to pay for their online purchases
268
+ # in cash, directing it to their online banking.
269
+ PSE = 'pse'.freeze
270
+
271
+ # RapiPago from Argentina is an offline payment method used for online purchases.
272
+ # Shoppers buy their goods and services online and pay offline at one of the 6,000+ RapiPago
273
+ # payment locations.
274
+ RAPI_PAGO = 'rapi_pago'.freeze
275
+
276
+ # A RecurringSale transaction is a "repeated" transaction which follows and references an initial transaction
277
+ # @deprecated Since 0.1.0 Payment method is deprecated and will be removed
278
+ RECURRING_SALE = 'recurring_sale'.freeze
279
+
280
+ # Redpagos is a cash payment in Uruguay
281
+ REDPAGOS = 'redpagos'.freeze
282
+
283
+ # Refunds allow to return already billed amounts to customers.
284
+ REFUND = 'refund'.freeze
285
+
286
+ # Russian Mobile Payout, or otherwise known as Disbursement, is an APM used to process Mobile network operator
287
+ # payments. It is an async payment method and will be approved once the payment is processed by the
288
+ # Mobile network operator. Notice: Russian Mobile Payout does not support refund and void.
289
+ RUSSIAN_MOBILE_PAYOUT = 'russian_mobile_payout'.freeze
290
+
291
+ # Russian Mobile Sale, otherwise known as Charge, is an APM used to process Mobile network operator payments.
292
+ # It is an async payment method and will be approved once the payment is processed by the Mobile network
293
+ # operator.
294
+ # Notice: Russian Mobile Sale does not support refund and void.
295
+ RUSSIAN_MOBILE_SALE = 'russian_mobile_sale'.freeze
296
+
297
+ # Safetypay is a real-time bank transfer system that operates in more than 10 different countries.
298
+ # Their main market is in Latin America.
299
+ SAFETYPAY = 'safetypay'.freeze
300
+
301
+ # A standard Sale
302
+ SALE = 'sale'.freeze
303
+
304
+ # 3D-Secure Sale
305
+ SALE_3D = 'sale3d'.freeze
306
+
307
+ # Santander is an online bank transfer for ecommerce purchases. Consumers use their trusted home
308
+ # banking environment, merchants benefit from payment guarantee and swift settlement.
309
+ SANTANDER = 'santander'.freeze
310
+
311
+ # Sepa Direct Debit Payout, popular in Germany.
312
+ # Processed as a SEPA CreditTransfer and can be used for all kind of payout services across the EU with 1 day
313
+ # settlement. Suitable for Gaming, Forex-Binaries, Affiliate Programs or Merchant payouts
314
+ SCT_PAYOUT = 'sct_payout'.freeze
315
+
316
+ # Sepa Direct Debit initial recurring
317
+ SDD_INIT_RECURRING_SALE = 'sdd_init_recurring_sale'.freeze
318
+
319
+ # Sepa Direct Debit RecurringSale transaction is a "repeated" transaction,
320
+ # which follows and references an SDD initial transaction
321
+ SDD_RECURRING_SALE = 'sdd_recurring_sale'.freeze
322
+
323
+ # Sepa Direct Debit Refund Transaction.
324
+ # Refunds allow to return already billed amounts to customers.
325
+ SDD_REFUND = 'sdd_refund'.freeze
326
+
327
+ # Sepa Direct Debit Payment, popular in Germany.
328
+ # Single Euro Payments Area (SEPA) allows consumers to make cashless Euro payments to
329
+ # any beneficiary located anywhere in the Euro area using only a single bank account
330
+ SDD_SALE = 'sdd_sale'.freeze
331
+
332
+ # Bank transfer payment, popular in Germany
333
+ SOFORT = 'sofort'.freeze
334
+
335
+ # Tarjeta Shopping is a cash payment in Argentina.
336
+ TARJETA_SHOPPING = 'tarjeta_shopping'.freeze
337
+
338
+ # TCS Thecontainerstore transactions are made using gift cards provided by TCS The amount from a
339
+ # Container Store Transactions is immediately billed to the customer’s gift card.
340
+ # It can be reversed via a void transaction.
341
+ TCS = 'container_store'.freeze
342
+
343
+ # TransferTo Payout is an APM which provides 3 different payment services:
344
+ # BankAccount, MobileWallet and CashPickup. Merchant sends money to a consumer.
345
+ TRANSFER_TO_PAYOUT = 'transfer_to_payout'.freeze
346
+
347
+ # Trustly is a fast and secure oBeP-style alternative payment method. It is free of charge and
348
+ # allows you to deposit money directly from your online bank account.
349
+ TRUSTLY_SALE = 'trustly_sale'.freeze
350
+
351
+ # UPI (Unified Payment Interface) transaction is an alternative payment method
352
+ # which allows users to transfer money between bank accounts.
353
+ UPI = 'upi'.freeze
354
+
355
+ # Void transactions undo previous transactions.
356
+ VOID = 'void'.freeze
357
+
358
+ # WebMoney is a global settlement system and environment for online business activities.
359
+ WEBMONEY = 'webmoney'.freeze
360
+
361
+ # Webpay is a Chilean real-time bank transfer method.
362
+ WEBPAY = 'webpay'.freeze
363
+
364
+ # WeChat Pay solution offers merchants access to the over 300 million WeChat users that have linked payment
365
+ # to their WeChat account. The solution works on desktop and mobile via a QR code generation platform.
366
+ WECHAT = 'wechat'.freeze
367
+
368
+ end
369
+ end
370
+ end
371
+ end
@@ -0,0 +1,27 @@
1
+ require 'genesis_ruby/utils/common'
2
+
3
+ module GenesisRuby
4
+ module Api
5
+ module Mixins
6
+ module Constants
7
+ # Common method between all Constant classes
8
+ # use extend to add methods below to a specific module
9
+ module Common
10
+
11
+ # Get all defined constant values
12
+ def all
13
+ GenesisRuby::Utils::Common.constant_values(self)
14
+ end
15
+
16
+ # Validate given value against all available constant values
17
+ def valid?(value, strict: false)
18
+ value = value.downcase if !strict && value.is_a?(String)
19
+
20
+ all.include?(value)
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,20 @@
1
+ require 'genesis_ruby/api/mixins/requests/customer_address/billing_info_attributes'
2
+ require 'genesis_ruby/api/mixins/requests/customer_address/shipping_info_attributes'
3
+ require 'genesis_ruby/api/mixins/requests/customer_address/customer_info_attributes'
4
+
5
+ module GenesisRuby
6
+ module Api
7
+ module Mixins
8
+ module Requests
9
+ # Mixin Address Info Attributes
10
+ module AddressInfoAttributes
11
+
12
+ include CustomerAddress::BillingInfoAttributes
13
+ include CustomerAddress::ShippingInfoAttributes
14
+ include CustomerAddress::CustomerInfoAttributes
15
+
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,33 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module CustomerAddress
6
+ # Mixin BillingInfoAttributes
7
+ module BillingInfoAttributes
8
+
9
+ attr_accessor :billing_first_name, :billing_last_name, :billing_address1, :billing_address2,
10
+ :billing_zip_code, :billing_city, :billing_state, :billing_country
11
+
12
+ protected
13
+
14
+ # Build Hash with all parameters
15
+ def billing_address_parameters_structure
16
+ {
17
+ first_name: billing_first_name,
18
+ last_name: billing_last_name,
19
+ address1: billing_address1,
20
+ address2: billing_address2,
21
+ zip_code: billing_zip_code,
22
+ city: billing_city,
23
+ state: billing_state,
24
+ country: billing_country
25
+ }
26
+ end
27
+
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end