genesis_ruby 0.2.4 → 0.2.5

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/Gemfile.lock +14 -14
  4. data/README.md +38 -0
  5. data/VERSION +1 -1
  6. data/lib/genesis_ruby/api/constants/currencies/iso4217.rb +6 -0
  7. data/lib/genesis_ruby/api/constants/non_financial/kyc/document_types.rb +49 -0
  8. data/lib/genesis_ruby/api/constants/non_financial/kyc/genders.rb +22 -0
  9. data/lib/genesis_ruby/api/constants/transactions/parameters/african_mobile_operators.rb +37 -0
  10. data/lib/genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_owner.rb +24 -0
  11. data/lib/genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_subtype.rb +24 -0
  12. data/lib/genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_type.rb +63 -0
  13. data/lib/genesis_ruby/api/constants/transactions/parameters/digital_asset_types.rb +31 -0
  14. data/lib/genesis_ruby/api/constants/transactions/parameters/purpose_of_payment.rb +136 -0
  15. data/lib/genesis_ruby/api/constants/transactions/parameters/source_of_funds.rb +34 -0
  16. data/lib/genesis_ruby/api/mixins/requests/digital_asset_type_attributes.rb +26 -0
  17. data/lib/genesis_ruby/api/mixins/requests/financial/african_mobile_attributes.rb +30 -0
  18. data/lib/genesis_ruby/api/mixins/requests/financial/cards/tokenization_params_attributes.rb +36 -0
  19. data/lib/genesis_ruby/api/mixins/requests/financial/customer_identification_attributes.rb +82 -0
  20. data/lib/genesis_ruby/api/mixins/requests/financial/gift_cards_attributes.rb +26 -0
  21. data/lib/genesis_ruby/api/mixins/requests/financial/preauthorization_attributes.rb +25 -0
  22. data/lib/genesis_ruby/api/mixins/requests/financial/purpose_of_payment_attributes.rb +29 -0
  23. data/lib/genesis_ruby/api/mixins/requests/financial/source_of_funds_attributes.rb +38 -0
  24. data/lib/genesis_ruby/api/mixins/requests/financial/travel_data/airline_itinerary_attributes.rb +1 -1
  25. data/lib/genesis_ruby/api/mixins/requests/non_financial/fx/id_attributes.rb +28 -0
  26. data/lib/genesis_ruby/api/mixins/requests/non_financial/fx/tier_id_attributes.rb +28 -0
  27. data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/customer_information_attributes.rb +62 -0
  28. data/lib/genesis_ruby/api/request.rb +7 -0
  29. data/lib/genesis_ruby/api/requests/base/financials/credit_card.rb +4 -2
  30. data/lib/genesis_ruby/api/requests/base/non_financial/kyc/base.rb +33 -0
  31. data/lib/genesis_ruby/api/requests/base/reference.rb +1 -2
  32. data/lib/genesis_ruby/api/requests/financial/Preauthorizations/incremental_authorize.rb +24 -0
  33. data/lib/genesis_ruby/api/requests/financial/cards/authorize.rb +5 -1
  34. data/lib/genesis_ruby/api/requests/financial/cards/authorize3d.rb +5 -1
  35. data/lib/genesis_ruby/api/requests/financial/cards/credit.rb +39 -0
  36. data/lib/genesis_ruby/api/requests/financial/cards/payout.rb +72 -0
  37. data/lib/genesis_ruby/api/requests/financial/cards/sale.rb +3 -1
  38. data/lib/genesis_ruby/api/requests/financial/cards/sale3d.rb +3 -1
  39. data/lib/genesis_ruby/api/requests/financial/crypto/bit_pay/payout.rb +52 -0
  40. data/lib/genesis_ruby/api/requests/financial/crypto/bit_pay/refund.rb +36 -0
  41. data/lib/genesis_ruby/api/requests/financial/crypto/bit_pay/sale.rb +55 -0
  42. data/lib/genesis_ruby/api/requests/financial/gift_cards/fashioncheque.rb +47 -0
  43. data/lib/genesis_ruby/api/requests/financial/gift_cards/intersolve.rb +46 -0
  44. data/lib/genesis_ruby/api/requests/financial/gift_cards/tcs.rb +47 -0
  45. data/lib/genesis_ruby/api/requests/financial/mobile/african_mobile_sale.rb +81 -0
  46. data/lib/genesis_ruby/api/requests/financial/mobile/russian_mobile_sale.rb +55 -0
  47. data/lib/genesis_ruby/api/requests/financial/vouchers/neosurf.rb +61 -0
  48. data/lib/genesis_ruby/api/requests/non_financial/fraud/chargeback/date_range.rb +82 -0
  49. data/lib/genesis_ruby/api/requests/non_financial/fraud/chargeback/transaction.rb +52 -0
  50. data/lib/genesis_ruby/api/requests/non_financial/fraud/reports/date_range.rb +108 -0
  51. data/lib/genesis_ruby/api/requests/non_financial/fraud/reports/transaction.rb +52 -0
  52. data/lib/genesis_ruby/api/requests/non_financial/fx/get_rate.rb +55 -0
  53. data/lib/genesis_ruby/api/requests/non_financial/fx/get_rates.rb +53 -0
  54. data/lib/genesis_ruby/api/requests/non_financial/fx/get_tier.rb +53 -0
  55. data/lib/genesis_ruby/api/requests/non_financial/fx/get_tiers.rb +35 -0
  56. data/lib/genesis_ruby/api/requests/non_financial/fx/search_rate.rb +61 -0
  57. data/lib/genesis_ruby/api/requests/non_financial/kyc/consumer_registration/create.rb +99 -0
  58. data/lib/genesis_ruby/api/requests/non_financial/tokenization/cryptogram.rb +5 -2
  59. data/lib/genesis_ruby/api/requests/wpf/create.rb +3 -1
  60. data/lib/genesis_ruby/configuration.rb +4 -0
  61. data/lib/genesis_ruby/dependencies.rb +1 -0
  62. data/lib/genesis_ruby/utils/country.rb +272 -0
  63. data/lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb +1 -4
  64. data/lib/genesis_ruby/version.rb +1 -1
  65. metadata +46 -2
@@ -0,0 +1,30 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # African Mobile Attributes mixin
7
+ module AfricanMobileAttributes
8
+
9
+ attr_reader :target, :operator
10
+
11
+ # Number of the Paybill for which the transaction is intended
12
+ def target=(value)
13
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 20
14
+ end
15
+
16
+ # Name of the Mobile network operator which should process the transaction
17
+ def operator=(value)
18
+ allowed_options attribute: __method__,
19
+ allowed:
20
+ GenesisRuby::Api::Constants::Transactions::Parameters::AfricanMobileOperators.all,
21
+ value: value.to_s.upcase,
22
+ allow_empty: false
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,36 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Cards
7
+ # Tokenization Params Attributes mixin
8
+ module TokenizationParamsAttributes
9
+
10
+ attr_accessor :tokenization_tavv
11
+ attr_reader :tokenization_eci
12
+
13
+ # Electronic Commerce Indicator (ECI) is a value that is returned from the Directory Server
14
+ # (Visa, MasterCard, etc.) to indicate the authentication results of your customer’s
15
+ # credit card payment on 3D Secure
16
+ def tokenization_eci=(value)
17
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 2
18
+ end
19
+
20
+ protected
21
+
22
+ # Tokenization Params Attributes Structure
23
+ def tokenization_params_attributes_structure
24
+ {
25
+ eci: tokenization_eci,
26
+ tavv: tokenization_tavv
27
+ }
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,82 @@
1
+ require 'genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_owner'
2
+ require 'genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_type'
3
+ require 'genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_subtype'
4
+ require 'genesis_ruby/utils/country'
5
+
6
+ module GenesisRuby
7
+ module Api
8
+ module Mixins
9
+ module Requests
10
+ module Financial
11
+ # Customer Identification Attributes
12
+ module CustomerIdentificationAttributes
13
+
14
+ attr_accessor :customer_identification_document_id
15
+
16
+ attr_reader :customer_identification_owner, :customer_identification_type,
17
+ :customer_identification_subtype, :customer_identification_issuing_country
18
+
19
+ # Customer Identification Owner
20
+ def customer_identification_owner=(value)
21
+ allowed_options(
22
+ attribute: __method__,
23
+ allowed:
24
+ GenesisRuby::Api::Constants::Transactions::Parameters::CustomerIdentification::CustomerIdentificationOwner.all, # rubocop:disable Layout/LineLength
25
+ value: value,
26
+ error_message: 'Invalid data for Customer Identification Document Owner',
27
+ allow_empty: true
28
+ )
29
+ end
30
+
31
+ # Customer Identification Type
32
+ def customer_identification_type=(value)
33
+ allowed_options(
34
+ attribute: __method__,
35
+ allowed:
36
+ GenesisRuby::Api::Constants::Transactions::Parameters::CustomerIdentification::CustomerIdentificationType.all, # rubocop:disable Layout/LineLength
37
+ value: value,
38
+ error_message: 'Invalid data for Customer Identification Document Type',
39
+ allow_empty: true
40
+ )
41
+ end
42
+
43
+ # Customer Identification Issuing Country
44
+ def customer_identification_issuing_country=(value)
45
+ allowed_options(
46
+ attribute: __method__,
47
+ allowed: GenesisRuby::Utils::Country::COUNTRIES.keys,
48
+ value: value,
49
+ error_message: 'Invalid country code for Document issuer country',
50
+ allow_empty: true
51
+ )
52
+ end
53
+
54
+ # Customer Identification Document Subtype
55
+ def customer_identification_subtype=(value)
56
+ allowed_options(
57
+ attribute: __method__,
58
+ allowed: GenesisRuby::Api::Constants::Transactions::Parameters::CustomerIdentification::CustomerIdentificationSubtype.all, # rubocop:disable Layout/LineLength
59
+ value: value,
60
+ error_message: 'Invalid value for Customer Identification Document Subtype',
61
+ allow_empty: true
62
+ )
63
+ end
64
+
65
+ protected
66
+
67
+ def customer_identification_attributes_structure
68
+ {
69
+ owner: customer_identification_owner,
70
+ type: customer_identification_type,
71
+ subtype: customer_identification_subtype,
72
+ document_id: customer_identification_document_id,
73
+ issuing_country: customer_identification_issuing_country
74
+ }
75
+ end
76
+
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,26 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # Gift Cards Attributes mixin
7
+ module GiftCardsAttributes
8
+
9
+ attr_reader :card_number, :cvv
10
+
11
+ # Gift card number
12
+ def card_number=(value)
13
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, min: 19, max: 21
14
+ end
15
+
16
+ # Verification code of the gift card
17
+ def cvv=(value)
18
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, min: 5, max: 8
19
+ end
20
+
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,25 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # Mixin Preauthorization Attributes
7
+ module PreauthorizationAttributes
8
+
9
+ attr_reader :preauthorization
10
+
11
+ # Preauthorization setter
12
+ def preauthorization=(value)
13
+ allowed_options attribute: __method__,
14
+ allowed: [true, false],
15
+ value: value,
16
+ allow_empty: true,
17
+ error_message: 'Accepts only boolean values'
18
+ end
19
+
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,29 @@
1
+ require 'genesis_ruby/api/constants/transactions/parameters/purpose_of_payment'
2
+
3
+ module GenesisRuby
4
+ module Api
5
+ module Mixins
6
+ module Requests
7
+ module Financial
8
+ # Purpose of Payment Attributes
9
+ module PurposeOfPaymentAttributes
10
+
11
+ attr_reader :purpose_of_payment
12
+
13
+ # Purpose of Payment setter
14
+ def purpose_of_payment=(value)
15
+ allowed_options(
16
+ attribute: __method__,
17
+ allowed: GenesisRuby::Api::Constants::Transactions::Parameters::PurposeOfPayment.all,
18
+ value: value,
19
+ error_message: 'Invalid data for Purpose of Payment',
20
+ allow_empty: true
21
+ )
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,38 @@
1
+ require 'genesis_ruby/api/constants/transactions/parameters/source_of_funds'
2
+
3
+ module GenesisRuby
4
+ module Api
5
+ module Mixins
6
+ module Requests
7
+ module Financial
8
+ # Source of Funds Attributes
9
+ module SourceOfFundsAttributes
10
+
11
+ attr_reader :source_of_funds
12
+
13
+ # Source of Funds setter
14
+ def source_of_funds=(value)
15
+ allowed_options(
16
+ attribute: __method__,
17
+ allowed: GenesisRuby::Api::Constants::Transactions::Parameters::SourceOfFunds.all,
18
+ value: value,
19
+ error_message: 'Invalid data for Source of Funds',
20
+ allow_empty: true
21
+ )
22
+ end
23
+
24
+ protected
25
+
26
+ # Source of Funds attributes structure
27
+ def source_of_funds_attributes_structure
28
+ {
29
+ source_of_funds: source_of_funds
30
+ }
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -135,7 +135,7 @@ module GenesisRuby
135
135
  end
136
136
 
137
137
  # Attributes Structure
138
- def airline_attributes_structure # rubocop:disable RSpec/MethodLength
138
+ def airline_attributes_structure # rubocop:disable Metrics/MethodLength
139
139
  {
140
140
  ticket_number: travel_aid_ticket_number,
141
141
  passenger_name: travel_aid_passenger_name,
@@ -0,0 +1,28 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module NonFinancial
6
+ module Fx
7
+ # ID Attributes mixin
8
+ module IdAttributes
9
+
10
+ attr_writer :id
11
+
12
+ # Tier ID
13
+ def id
14
+ @id.to_s
15
+ end
16
+
17
+ # Required fields
18
+ def id_required_fields
19
+ [:id]
20
+ end
21
+
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 Mixins
4
+ module Requests
5
+ module NonFinancial
6
+ module Fx
7
+ # Tier ID Attributes mixin
8
+ module TierIdAttributes
9
+
10
+ attr_writer :tier_id
11
+
12
+ # Identification of the tier
13
+ def tier_id
14
+ @tier_id.to_s
15
+ end
16
+
17
+ # Required fields
18
+ def tier_id_required_fields
19
+ [:tier_id]
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,62 @@
1
+ require 'genesis_ruby/api/constants/non_financial/kyc/document_types'
2
+ require 'genesis_ruby/api/constants/non_financial/kyc/genders'
3
+
4
+ module GenesisRuby
5
+ module Api
6
+ module Mixins
7
+ module Requests
8
+ module NonFinancial
9
+ module Kyc
10
+ # Customer Information Attributes mixin
11
+ module CustomerInformationAttributes
12
+
13
+ include Api::Mixins::Requests::BirthDateAttributes
14
+
15
+ attr_accessor :first_name, :middle_name, :last_name, :customer_email,
16
+ :address1, :address2, :city, :zip_code, :country,
17
+ :province, :phone1, :phone2, :document_number, :document_type, :gender
18
+
19
+ protected
20
+
21
+ # Sets the request field validations
22
+ def customer_information_required_fields
23
+ %i[first_name last_name customer_email address1 city province zip_code country]
24
+ end
25
+
26
+ # Sets the request field values validations
27
+ def customer_information_required_field_values
28
+ {
29
+ gender: Api::Constants::NonFinancial::Kyc::Genders.all,
30
+ document_type: Api::Constants::NonFinancial::Kyc::DocumentTypes.all
31
+ }
32
+ end
33
+
34
+ # Returns the customer information structure as a hash
35
+ def customer_information_structure # rubocop:disable Metrics/MethodLength
36
+ {
37
+ first_name: first_name,
38
+ middle_name: middle_name,
39
+ last_name: last_name,
40
+ customer_email: customer_email,
41
+ address1: address1,
42
+ address2: address2,
43
+ city: city,
44
+ province: province,
45
+ zip_code: zip_code,
46
+ country: country,
47
+ phone1: phone1,
48
+ phone2: phone2,
49
+ birth_date: birth_date,
50
+ document_type: document_type,
51
+ document_number: document_number,
52
+ gender: gender
53
+ }
54
+ end
55
+
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -116,6 +116,13 @@ module GenesisRuby
116
116
  api_config.url = build_request_url({ subdomain: 'api_service', path: request_path })
117
117
  end
118
118
 
119
+ # Initializes KYC Service Configuration
120
+ def init_kyc_service_configuration(options = { request_path: '' })
121
+ request_path = options.fetch :request_path, ''
122
+
123
+ api_config.url = build_request_url({ subdomain: 'kyc_service', path: request_path })
124
+ end
125
+
119
126
  # Process Everything the variables set previously
120
127
  #
121
128
  # Step 1: Execute per-field actions
@@ -10,6 +10,7 @@ module GenesisRuby
10
10
  include Mixins::Requests::Financial::Cards::CredentialOnFileAttributes
11
11
  include Mixins::Requests::Financial::Cards::CreditCardAttributes
12
12
  include Mixins::Requests::Financial::Cards::TokenizationAttributes
13
+ include Mixins::Requests::Financial::Cards::TokenizationParamsAttributes
13
14
  include Mixins::Requests::Financial::Cards::UcofAttributes
14
15
 
15
16
  attr_reader :scheme_tokenized
@@ -35,7 +36,7 @@ module GenesisRuby
35
36
  end
36
37
 
37
38
  # Credit Card attributes
38
- def payment_transaction_structure
39
+ def payment_transaction_structure # rubocop:disable Metrics/MethodLength
39
40
  credit_card_attributes_structure.merge(
40
41
  tokenization_attributes_structure,
41
42
  {
@@ -43,7 +44,8 @@ module GenesisRuby
43
44
  credential_on_file: credential_on_file,
44
45
  credential_on_file_transaction_identifier: credential_on_file_transaction_identifier,
45
46
  credential_on_file_settlement_date: credential_on_file_settlement_date,
46
- scheme_tokenized: scheme_tokenized
47
+ scheme_tokenized: scheme_tokenized,
48
+ tokenization_params: tokenization_params_attributes_structure
47
49
  }
48
50
  )
49
51
  end
@@ -0,0 +1,33 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Requests
4
+ module Base
5
+ module NonFinancial
6
+ module Kyc
7
+ # Base Request class for KYC Non-Financial API services
8
+ class Base < Api::Requests::Base::Versioned
9
+
10
+ # Constructor for the KYC Base Request
11
+ def initialize(configuration, builder_interface = Builder::JSON)
12
+ super(configuration, builder_interface)
13
+ end
14
+
15
+ # Initializes the request path and version
16
+ def init_configuration
17
+ super
18
+
19
+ init_kyc_service_configuration request_path: "api/#{version}/#{request_path}"
20
+ end
21
+
22
+ # Empty request structure
23
+ def request_structure
24
+ {}
25
+ end
26
+
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -5,7 +5,6 @@ module GenesisRuby
5
5
  # Base class used in the Reference transaction requests
6
6
  class Reference < Financial
7
7
 
8
- include Mixins::Requests::Financial::PaymentAttributes
9
8
  include Mixins::Requests::Financial::ReferenceAttributes
10
9
 
11
10
  protected
@@ -25,7 +24,7 @@ module GenesisRuby
25
24
  def payment_transaction_structure
26
25
  {
27
26
  reference_id: reference_id
28
- }.merge payment_attributes_structure, reference_transaction_structure
27
+ }.merge reference_transaction_structure
29
28
  end
30
29
 
31
30
  end
@@ -0,0 +1,24 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Requests
4
+ module Financial
5
+ module Preauthorizations
6
+ # Incremental Authorize transaction type
7
+ class IncrementalAuthorize < Base::Reference
8
+
9
+ # Incremental Authorize transaction type
10
+ def transaction_type
11
+ Constants::Transactions::INCREMENTAL_AUTHORIZE
12
+ end
13
+
14
+ # Returns the transaction structure
15
+ def reference_transaction_structure
16
+ {}
17
+ end
18
+
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -10,6 +10,7 @@ module GenesisRuby
10
10
  class Authorize < Requests::Base::Financials::CreditCard
11
11
 
12
12
  include Mixins::Requests::AddressInfoAttributes
13
+ include Mixins::Requests::DigitalAssetTypeAttributes
13
14
  include Mixins::Requests::DocumentAttributes
14
15
  include Mixins::Requests::Financial::Business::BusinessAttributes
15
16
  include Mixins::Requests::Financial::Cards::FxRateAttributes
@@ -22,6 +23,7 @@ module GenesisRuby
22
23
  include Mixins::Requests::Financial::FundingAttributes
23
24
  include Mixins::Requests::Financial::GamingAttributes
24
25
  include Mixins::Requests::Financial::MotoAttributes
26
+ include Mixins::Requests::Financial::PreauthorizationAttributes
25
27
  include Mixins::Requests::Financial::ReferenceAttributes
26
28
  include Mixins::Requests::Financial::RiskAttributes
27
29
  include Mixins::Requests::Financial::ScaAttributes
@@ -53,6 +55,7 @@ module GenesisRuby
53
55
  super.merge(
54
56
  gaming: gaming,
55
57
  moto: moto,
58
+ preauthorization: preauthorization,
56
59
  crypto: crypto,
57
60
  customer_email: customer_email,
58
61
  customer_phone: customer_phone,
@@ -71,7 +74,8 @@ module GenesisRuby
71
74
  travel: travel_data_attributes_structure,
72
75
  funding: funding_attributes_structure,
73
76
  installment_plan_id: installment_plan_id,
74
- installment_plan_reference: installment_plan_reference
77
+ installment_plan_reference: installment_plan_reference,
78
+ digital_asset_type: digital_asset_type
75
79
  )
76
80
  end
77
81
 
@@ -10,6 +10,7 @@ module GenesisRuby
10
10
  class Authorize3d < Requests::Base::Financials::CreditCard
11
11
 
12
12
  include Mixins::Requests::AddressInfoAttributes
13
+ include Mixins::Requests::DigitalAssetTypeAttributes
13
14
  include Mixins::Requests::DocumentAttributes
14
15
  include Mixins::Requests::Financial::AsyncAttributes
15
16
  include Mixins::Requests::Financial::Business::BusinessAttributes
@@ -25,6 +26,7 @@ module GenesisRuby
25
26
  include Mixins::Requests::Financial::GamingAttributes
26
27
  include Mixins::Requests::Financial::MotoAttributes
27
28
  include Mixins::Requests::Financial::NotificationAttributes
29
+ include Mixins::Requests::Financial::PreauthorizationAttributes
28
30
  include Mixins::Requests::Financial::RiskAttributes
29
31
  include Mixins::Requests::Financial::ScaAttributes
30
32
  include Mixins::Requests::Financial::Threeds::Version2::CommonAttributes
@@ -67,6 +69,7 @@ module GenesisRuby
67
69
  return_failure_url: return_failure_url,
68
70
  gaming: gaming,
69
71
  moto: moto,
72
+ preauthorization: preauthorization,
70
73
  crypto: crypto,
71
74
  customer_email: customer_email,
72
75
  customer_phone: customer_phone,
@@ -86,7 +89,8 @@ module GenesisRuby
86
89
  travel: travel_data_attributes_structure,
87
90
  funding: funding_attributes_structure,
88
91
  installment_plan_id: installment_plan_id,
89
- installment_plan_reference: installment_plan_reference
92
+ installment_plan_reference: installment_plan_reference,
93
+ digital_asset_type: digital_asset_type
90
94
  )
91
95
  end
92
96
 
@@ -0,0 +1,39 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Requests
4
+ module Financial
5
+ module Cards
6
+ # Credits (also known as Credit Fund Transfer a.k.a. CFT) can be done with an initial reference transaction.
7
+ class Credit < Requests::Base::Reference
8
+
9
+ include Mixins::Requests::Financial::Cards::AccountOwnerAttributes
10
+ include Mixins::Requests::Financial::CustomerIdentificationAttributes
11
+ include Mixins::Requests::Financial::PurposeOfPaymentAttributes
12
+ include Mixins::Requests::Financial::SourceOfFundsAttributes
13
+ include Mixins::Requests::Financial::CryptoAttributes
14
+ include Mixins::Requests::DigitalAssetTypeAttributes
15
+
16
+ protected
17
+
18
+ # Credit transaction type
19
+ def transaction_type
20
+ Api::Constants::Transactions::CREDIT
21
+ end
22
+
23
+ # Reference transaction structure
24
+ def reference_transaction_structure
25
+ {
26
+ 'crypto' => crypto,
27
+ 'digital_asset_type' => digital_asset_type,
28
+ 'customer_identification' => customer_identification_attributes_structure,
29
+ 'account_owner' => account_owner_attributes_structure,
30
+ 'purpose_of_payment' => purpose_of_payment
31
+ }.merge source_of_funds_attributes_structure
32
+ end
33
+
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end