spree_emerchantpay_genesis 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +109 -10
- data/app/assets/javascripts/spree/frontend/card.min.js +3 -3
- data/app/controllers/spree/api/v2/storefront/checkout_controller_decorator.rb +45 -16
- data/app/controllers/spree/api/v2/storefront/emerchantpay_notification_controller.rb +5 -3
- data/app/helpers/spree/admin/payment_methods_helper.rb +20 -13
- data/app/helpers/spree_emerchantpay_genesis/mappers/genesis.rb +51 -163
- data/app/helpers/spree_emerchantpay_genesis/mappers/threeds_attributes.rb +227 -0
- data/app/helpers/spree_emerchantpay_genesis/payment_method_helper.rb +34 -0
- data/app/helpers/spree_emerchantpay_genesis/threeds_helper.rb +2 -1
- data/app/helpers/spree_emerchantpay_genesis/transaction_helper.rb +9 -5
- data/app/models/spree/emerchantpay_checkout_source.rb +37 -0
- data/app/models/spree/gateway/emerchantpay_checkout.rb +52 -0
- data/app/models/spree/gateway/emerchantpay_direct.rb +4 -19
- data/app/models/spree/payment_decorator.rb +31 -0
- data/app/models/spree_emerchantpay_genesis/base/gateway.rb +18 -1
- data/app/models/spree_emerchantpay_genesis/genesis_provider.rb +74 -18
- data/app/repositories/spree_emerchantpay_genesis/emerchantpay_payments_repository.rb +6 -5
- data/app/repositories/spree_emerchantpay_genesis/spree_payments_repository.rb +4 -8
- data/app/serializers/spree/api/v2/platform/emerchantpay_checkout_source_serializer.rb +17 -0
- data/app/services/spree/payments/create_decorator.rb +13 -1
- data/app/services/spree_emerchantpay_genesis/base/payment_service.rb +28 -2
- data/app/services/spree_emerchantpay_genesis/sources/create_checkout.rb +40 -0
- data/app/views/partials/_gateway_messages.html.erb +21 -0
- data/app/views/partials/_transaction_table.html.erb +34 -0
- data/app/views/spree/admin/payments/source_views/_emerchantpay_checkout.html.erb +23 -0
- data/app/views/spree/admin/payments/source_views/_emerchantpay_direct.html.erb +2 -55
- data/app/views/spree/checkout/payment/_emerchantpay_checkout.html.erb +3 -0
- data/config/initializers/extend_spree_permitted_checkout_attributes.rb +13 -0
- data/config/locales/en.yml +67 -0
- data/db/migrate/20240306152438_add_checkout_source.rb +22 -0
- data/lib/spree_emerchantpay_genesis/engine.rb +3 -1
- data/lib/spree_emerchantpay_genesis/version.rb +1 -1
- metadata +18 -6
@@ -22,7 +22,6 @@ module SpreeEmerchantpayGenesis
|
|
22
22
|
# Store Genesis Payment to the DB
|
23
23
|
def save_from_response_data(genesis_request, genesis_response, order, spree_payment)
|
24
24
|
payment = Db::EmerchantpayPayment.new
|
25
|
-
genesis_response = genesis_response.response_object
|
26
25
|
formatted_genesis_request = format_genesis_request(genesis_request)
|
27
26
|
|
28
27
|
map_payment spree_payment, payment, formatted_genesis_request, genesis_response
|
@@ -34,11 +33,13 @@ module SpreeEmerchantpayGenesis
|
|
34
33
|
end
|
35
34
|
|
36
35
|
# Update Existing payment
|
37
|
-
def update_from_response_data(emerchantpay_payment,
|
38
|
-
|
39
|
-
|
36
|
+
def update_from_response_data(emerchantpay_payment, response_object, spree_payment)
|
37
|
+
request = { configuration: {
|
38
|
+
token: emerchantpay_payment.terminal_token || response_object[:terminal_token]
|
39
|
+
} }.with_indifferent_access
|
40
|
+
response_object[:mode] = emerchantpay_payment.mode unless response_object.key? :mode
|
40
41
|
|
41
|
-
map_payment spree_payment, emerchantpay_payment, request,
|
42
|
+
map_payment spree_payment, emerchantpay_payment, request, response_object
|
42
43
|
|
43
44
|
emerchantpay_payment.save
|
44
45
|
end
|
@@ -10,9 +10,7 @@ module SpreeEmerchantpayGenesis
|
|
10
10
|
end
|
11
11
|
|
12
12
|
# Update Spree payment from response
|
13
|
-
def update_payment(payment,
|
14
|
-
response_object = response.response_object
|
15
|
-
|
13
|
+
def update_payment(payment, response_object)
|
16
14
|
payment.cvv_response_code = response_object[:cvv_result_code] if response_object.key?(:cvv_result_code)
|
17
15
|
payment.avs_response = response_object[:avs_response_code] if response_object.key?(:avs_response_code)
|
18
16
|
|
@@ -25,8 +23,7 @@ module SpreeEmerchantpayGenesis
|
|
25
23
|
end
|
26
24
|
|
27
25
|
# Add metadata to the Payment model
|
28
|
-
def add_payment_metadata(payment, options, genesis_response)
|
29
|
-
response_object = genesis_response.response_object
|
26
|
+
def add_payment_metadata(payment, options, genesis_response, response_object)
|
30
27
|
redirect_url = TransactionHelper.fetch_redirect_url(options, genesis_response)
|
31
28
|
state = response_object.key?(:status) ? { state: response_object[:status] } : {}
|
32
29
|
message = response_object.key?(:message) ? { message: response_object[:message] } : {}
|
@@ -37,9 +34,8 @@ module SpreeEmerchantpayGenesis
|
|
37
34
|
end
|
38
35
|
|
39
36
|
# Update the Spree Payment status from GenesisRuby::Api::Response object
|
40
|
-
def update_payment_status(payment, response)
|
37
|
+
def update_payment_status(payment, response, transaction_type)
|
41
38
|
capturable_types = GenesisRuby::Utils::Transactions::References::CapturableTypes
|
42
|
-
transaction_type = response.response_object[:transaction_type]
|
43
39
|
|
44
40
|
if response.approved?
|
45
41
|
action = :complete
|
@@ -48,7 +44,7 @@ module SpreeEmerchantpayGenesis
|
|
48
44
|
payment.public_send(action)
|
49
45
|
end
|
50
46
|
|
51
|
-
payment.failure if
|
47
|
+
payment.failure if TransactionHelper.failure_result? response
|
52
48
|
payment.void if response.voided?
|
53
49
|
end
|
54
50
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Spree
|
2
|
+
module Api
|
3
|
+
module V2
|
4
|
+
module Platform
|
5
|
+
# Emerchantpay Checkout Source Serializer
|
6
|
+
class EmerchantpayCheckoutSourceSerializer < BaseSerializer
|
7
|
+
|
8
|
+
include ResourceSerializerConcern
|
9
|
+
|
10
|
+
belongs_to :payment_method
|
11
|
+
belongs_to :user
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -31,8 +31,11 @@ module Spree
|
|
31
31
|
|
32
32
|
# Create payment source
|
33
33
|
def create_payment_source(payment_method, params, order)
|
34
|
-
|
34
|
+
case payment_method.type
|
35
|
+
when Spree::Gateway::EmerchantpayDirect.name
|
35
36
|
emerchantpay_direct_payment_source payment_method, params, order
|
37
|
+
when Spree::Gateway::EmerchantpayCheckout.name
|
38
|
+
emerchantpay_checkout_payment_source payment_method, params, order
|
36
39
|
else
|
37
40
|
default_payment_source payment_method, params, order
|
38
41
|
end
|
@@ -56,6 +59,15 @@ module Spree
|
|
56
59
|
)
|
57
60
|
end
|
58
61
|
|
62
|
+
# Emerchantpay Checkout payment source creation
|
63
|
+
def emerchantpay_checkout_payment_source(payment_method, params, order)
|
64
|
+
SpreeEmerchantpayGenesis::Sources::CreateCheckout.call(
|
65
|
+
payment_method: payment_method,
|
66
|
+
params: params.delete(:source_attributes),
|
67
|
+
order: order
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
59
71
|
end
|
60
72
|
end
|
61
73
|
end
|
@@ -18,7 +18,7 @@ module SpreeEmerchantpayGenesis
|
|
18
18
|
|
19
19
|
# Fetch emerchantpay payment
|
20
20
|
def fetch_emerchantapy_payment
|
21
|
-
result =
|
21
|
+
result = wpf_params? ? load_wpf_payment : load_processing_payment
|
22
22
|
|
23
23
|
raise 'Invalid parameters given. Payment not found.' unless result
|
24
24
|
|
@@ -37,7 +37,10 @@ module SpreeEmerchantpayGenesis
|
|
37
37
|
|
38
38
|
# Initialize the payment provider
|
39
39
|
def initialize_genesis_provider
|
40
|
-
provider =
|
40
|
+
provider = GenesisProvider.new(
|
41
|
+
PaymentMethodHelper.fetch_method_type(@emerchantpay_payment.payment_method),
|
42
|
+
genesis_preferences
|
43
|
+
)
|
41
44
|
provider.load_source spree_payment.source
|
42
45
|
provider.load_data SpreeEmerchantpayGenesis::Mappers::Order.for order.attributes.symbolize_keys
|
43
46
|
provider.load_payment spree_payment
|
@@ -78,6 +81,29 @@ module SpreeEmerchantpayGenesis
|
|
78
81
|
@spree_payment.payment_method.preferences.merge token: @emerchantpay_payment[:terminal_token]
|
79
82
|
end
|
80
83
|
|
84
|
+
# Load Processing payment via params[:unique_id]
|
85
|
+
def load_processing_payment
|
86
|
+
EmerchantpayPaymentsRepository.find_by_unique_id params[:unique_id]
|
87
|
+
end
|
88
|
+
|
89
|
+
# Load WPF initial or reference payment
|
90
|
+
def load_wpf_payment
|
91
|
+
# WPF Initial transaction case
|
92
|
+
result = EmerchantpayPaymentsRepository.find_by_unique_id params[:wpf_unique_id]
|
93
|
+
|
94
|
+
return result if result
|
95
|
+
|
96
|
+
return nil unless params.key? :payment_transaction_unique_id
|
97
|
+
|
98
|
+
# WPF Reference transaction notifications
|
99
|
+
EmerchantpayPaymentsRepository.find_by_unique_id params[:payment_transaction_unique_id]
|
100
|
+
end
|
101
|
+
|
102
|
+
# Fetch the parameters type
|
103
|
+
def wpf_params?
|
104
|
+
params.key? :wpf_unique_id
|
105
|
+
end
|
106
|
+
|
81
107
|
end
|
82
108
|
end
|
83
109
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module SpreeEmerchantpayGenesis
|
2
|
+
module Sources
|
3
|
+
# Alternative for Spree::Wallet::CreatePaymentSource
|
4
|
+
# Serve Web Payment Form Checkout payment method
|
5
|
+
class CreateCheckout
|
6
|
+
|
7
|
+
prepend Spree::ServiceModule::Base
|
8
|
+
|
9
|
+
def call(payment_method:, params: {}, order: nil)
|
10
|
+
source = payment_method.payment_source_class.new source_attributes(payment_method, params, order)
|
11
|
+
|
12
|
+
source.save ? success(source) : failure(source)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
# Checkout source attributes
|
18
|
+
def source_attributes(payment_method, params, order) # rubocop:disable Metrics/MethodLength
|
19
|
+
user = order&.user
|
20
|
+
default = PaymentMethodHelper.default_checkout_source_attributes order
|
21
|
+
|
22
|
+
default[:payment_method_id] = payment_method.id
|
23
|
+
default[:user_id] = user&.id
|
24
|
+
|
25
|
+
return default unless params.present?
|
26
|
+
|
27
|
+
default.merge(
|
28
|
+
{
|
29
|
+
name: params[:name] || default[:name],
|
30
|
+
consumer_id: params[:consumer_id],
|
31
|
+
consumer_email: params[:consumer_email] || default[:consumer_email],
|
32
|
+
public_metadata: params[:public_metadata],
|
33
|
+
private_metadata: params[:private_metadata]
|
34
|
+
}
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<fieldset data-hook="emerchantpay_gateway_response">
|
2
|
+
<% if payment.private_metadata[:message] || payment.private_metadata[:technical_message] %>
|
3
|
+
<legend><%= "#{payment.payment_method.name} #{I18n.t('emerchantpay.payments_table.gateway_response')}" %></legend>
|
4
|
+
<div class="table-responsive border rounded bg-white mb-3">
|
5
|
+
<table class="table table-condensed">
|
6
|
+
<% if payment.private_metadata[:message] %>
|
7
|
+
<tr>
|
8
|
+
<th><%= I18n.t('emerchantpay.payments_table.message') %></th>
|
9
|
+
<td><%= payment.private_metadata[:message] %></td>
|
10
|
+
</tr>
|
11
|
+
<% end %>
|
12
|
+
<% if payment.private_metadata[:technical_message] %>
|
13
|
+
<tr>
|
14
|
+
<th><%= I18n.t('emerchantpay.payments_table.technical_message') %></th>
|
15
|
+
<td><%= payment.private_metadata[:technical_message] %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</table>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
</fieldset>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<fieldset data-hook="emerchantpay_gateway_payments">
|
2
|
+
<% if payment.emerchantpay_payments.count > 0 %>
|
3
|
+
<legend><%= "#{payment.payment_method.name} #{I18n.t('emerchantpay.payments_table.title')}" %></legend>
|
4
|
+
<div class="table-responsive border rouded bg-white mb-3">
|
5
|
+
<table class="table table-condensed">
|
6
|
+
<tr>
|
7
|
+
<th><%= I18n.t('emerchantpay.payments_table.unique_id') %></th>
|
8
|
+
<th><%= I18n.t('emerchantpay.payments_table.reference_id') %></th>
|
9
|
+
<th><%= I18n.t('emerchantpay.payments_table.status') %></th>
|
10
|
+
<th><%= I18n.t('emerchantpay.payments_table.transaction_type') %></th>
|
11
|
+
<th><%= I18n.t('emerchantpay.payments_table.mode') %></th>
|
12
|
+
<th><%= I18n.t('emerchantpay.payments_table.amount') %></th>
|
13
|
+
<th><%= I18n.t('emerchantpay.payments_table.currency') %></th>
|
14
|
+
<th><%= I18n.t('emerchantpay.payments_table.created_at') %></th>
|
15
|
+
<th><%= I18n.t('emerchantpay.payments_table.updated_at') %></th>
|
16
|
+
</tr>
|
17
|
+
|
18
|
+
<% payment.emerchantpay_payments.each do |emerchantpay_payment| %>
|
19
|
+
<tr>
|
20
|
+
<td><%= emerchantpay_payment.unique_id %></td>
|
21
|
+
<td><%= emerchantpay_payment.reference_id %></td>
|
22
|
+
<td><%= emerchantpay_payment.status %></td>
|
23
|
+
<td><%= emerchantpay_payment.transaction_type %></td>
|
24
|
+
<td><%= emerchantpay_payment.mode %></td>
|
25
|
+
<td><%= emerchantpay_payment.major_amount %></td>
|
26
|
+
<td><%= emerchantpay_payment.currency %></td>
|
27
|
+
<td><%= emerchantpay_payment.formatted_created_at %></td>
|
28
|
+
<td><%= emerchantpay_payment.formatted_updated_at %></td>
|
29
|
+
</tr>
|
30
|
+
<% end %>
|
31
|
+
</table>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
</fieldset>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<fieldset data-hook="emerchantpay_checkout">
|
2
|
+
<legend><%= I18n.t('emerchantpay.payments_table.checkout_source') %></legend>
|
3
|
+
<div class="table-responsive border rounded bg-white mb-3">
|
4
|
+
<table class="table table-condensed">
|
5
|
+
<tr>
|
6
|
+
<th><%= I18n.t('emerchantpay.payments_table.source_name') %>:</th>
|
7
|
+
<td><%= payment.source.name %></td>
|
8
|
+
</tr>
|
9
|
+
<tr>
|
10
|
+
<th><%= I18n.t('emerchantpay.payments_table.source_consumer_id') %>:</th>
|
11
|
+
<td><%= payment.source.consumer_id %></td>
|
12
|
+
</tr>
|
13
|
+
<tr>
|
14
|
+
<th><%= I18n.t('emerchantpay.payments_table.source_consumer_email') %>:</th>
|
15
|
+
<td><%= payment.source.consumer_email %></td>
|
16
|
+
</tr>
|
17
|
+
</table>
|
18
|
+
</div>
|
19
|
+
</fieldset>
|
20
|
+
|
21
|
+
<%= render :partial => 'partials/gateway_messages', locals: { payment: payment } %>
|
22
|
+
|
23
|
+
<%= render :partial => 'partials/transaction_table', locals: { payment: payment} %>
|
@@ -22,59 +22,6 @@
|
|
22
22
|
</div>
|
23
23
|
</fieldset>
|
24
24
|
|
25
|
-
|
26
|
-
<% if payment.private_metadata[:message] || payment.private_metadata[:technical_message] %>
|
27
|
-
<legend><%= "#{payment.payment_method.name} #{I18n.t('emerchantpay.payments_table.gateway_response')}" %></legend>
|
28
|
-
<div class="table-responsive border rounded bg-white mb-3">
|
29
|
-
<table class="table table-condensed">
|
30
|
-
<% if payment.private_metadata[:message] %>
|
31
|
-
<tr>
|
32
|
-
<th><%= I18n.t('emerchantpay.payments_table.message') %></th>
|
33
|
-
<td><%= payment.private_metadata[:message] %></td>
|
34
|
-
</tr>
|
35
|
-
<% end %>
|
36
|
-
<% if payment.private_metadata[:technical_message] %>
|
37
|
-
<tr>
|
38
|
-
<th><%= I18n.t('emerchantpay.payments_table.technical_message') %></th>
|
39
|
-
<td><%= payment.private_metadata[:technical_message] %></td>
|
40
|
-
</tr>
|
41
|
-
<% end %>
|
42
|
-
</table>
|
43
|
-
</div>
|
44
|
-
<% end %>
|
45
|
-
</fieldset>
|
46
|
-
|
47
|
-
<fieldset data-hook="emerchantpay_gateway_payments">
|
48
|
-
<% if payment.emerchantpay_payments.count > 0 %>
|
49
|
-
<legend><%= "#{payment.payment_method.name} #{I18n.t('emerchantpay.payments_table.title')}" %></legend>
|
50
|
-
<div class="table-responsive border rouded bg-white mb-3">
|
51
|
-
<table class="table table-condensed">
|
52
|
-
<tr>
|
53
|
-
<th><%= I18n.t('emerchantpay.payments_table.unique_id') %></th>
|
54
|
-
<th><%= I18n.t('emerchantpay.payments_table.reference_id') %></th>
|
55
|
-
<th><%= I18n.t('emerchantpay.payments_table.status') %></th>
|
56
|
-
<th><%= I18n.t('emerchantpay.payments_table.transaction_type') %></th>
|
57
|
-
<th><%= I18n.t('emerchantpay.payments_table.mode') %></th>
|
58
|
-
<th><%= I18n.t('emerchantpay.payments_table.amount') %></th>
|
59
|
-
<th><%= I18n.t('emerchantpay.payments_table.currency') %></th>
|
60
|
-
<th><%= I18n.t('emerchantpay.payments_table.created_at') %></th>
|
61
|
-
<th><%= I18n.t('emerchantpay.payments_table.updated_at') %></th>
|
62
|
-
</tr>
|
25
|
+
<%= render :partial => 'partials/gateway_messages', locals: { payment: payment } %>
|
63
26
|
|
64
|
-
|
65
|
-
<tr>
|
66
|
-
<td><%= emerchantpay_payment.unique_id %></td>
|
67
|
-
<td><%= emerchantpay_payment.reference_id %></td>
|
68
|
-
<td><%= emerchantpay_payment.status %></td>
|
69
|
-
<td><%= emerchantpay_payment.transaction_type %></td>
|
70
|
-
<td><%= emerchantpay_payment.mode %></td>
|
71
|
-
<td><%= emerchantpay_payment.major_amount %></td>
|
72
|
-
<td><%= emerchantpay_payment.currency %></td>
|
73
|
-
<td><%= emerchantpay_payment.formatted_created_at %></td>
|
74
|
-
<td><%= emerchantpay_payment.formatted_updated_at %></td>
|
75
|
-
</tr>
|
76
|
-
<% end %>
|
77
|
-
</table>
|
78
|
-
</div>
|
79
|
-
<% end %>
|
80
|
-
</fieldset>
|
27
|
+
<%= render :partial => 'partials/transaction_table', locals: { payment: payment } %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Spree
|
2
|
+
module PermittedAttributes
|
3
|
+
|
4
|
+
# month / year may be provided by some sources, or others may elect to use one field
|
5
|
+
@@source_attributes = [ # rubocop:disable Style/ClassVars
|
6
|
+
:number, :month, :year, :expiry, :verification_value,
|
7
|
+
:first_name, :last_name, :cc_type, :gateway_customer_profile_id,
|
8
|
+
:gateway_payment_profile_id, :last_digits, :name, :encrypted_data,
|
9
|
+
:consumer_id, :consumer_email
|
10
|
+
]
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
data/config/locales/en.yml
CHANGED
@@ -14,6 +14,67 @@ en:
|
|
14
14
|
no_challenge_requested: No Challenge Requested
|
15
15
|
preference: Preference
|
16
16
|
mandate: Mandate
|
17
|
+
account_verification: Account Verification
|
18
|
+
argencard: Argencard
|
19
|
+
apple_pay: Apple Pay
|
20
|
+
aura: Aura
|
21
|
+
baloto: Baloto
|
22
|
+
bancomer: Bancomer
|
23
|
+
bcmc: Bcmc
|
24
|
+
banco_de_occidente: Banco de Occidente
|
25
|
+
banco_do_brasil: Banco do Brasil
|
26
|
+
bitpay_payout: Bitpay Payout
|
27
|
+
bitpay_sale: Bitpay Sale
|
28
|
+
boleto: Boleto
|
29
|
+
bradesco: Bradesco
|
30
|
+
cabal: Cabal
|
31
|
+
cashu: Cashu
|
32
|
+
cencosud: Cencosud
|
33
|
+
davivienda: Davivienda
|
34
|
+
efecty: Efecty
|
35
|
+
elo: Elo
|
36
|
+
eps: Eps
|
37
|
+
ezeewallet: eZeeWallet
|
38
|
+
fashioncheque: Fashioncheque
|
39
|
+
giropay: Giropay
|
40
|
+
google_pay: Google Pay
|
41
|
+
ideal: Ideal
|
42
|
+
idebit_payin: Idebit Payin
|
43
|
+
insta_debit_payin: Insta Debit Payin
|
44
|
+
intersolve: Intersolve
|
45
|
+
itau: Itau
|
46
|
+
multibanco: Multibanco
|
47
|
+
my_bank: My Bank
|
48
|
+
naranja: Naranja
|
49
|
+
nativa: Nativa
|
50
|
+
neosurf: Neosurf
|
51
|
+
neteller: Neteller
|
52
|
+
online_banking: Online Banking
|
53
|
+
oxxo: Oxxo
|
54
|
+
p24: P24
|
55
|
+
pago_facil: Pago Facil
|
56
|
+
pay_pal: Pay Pal
|
57
|
+
paysafecard: Paysafecard
|
58
|
+
payu: PayU
|
59
|
+
pix: Pix
|
60
|
+
poli: Poli
|
61
|
+
post_finance: Post Finance
|
62
|
+
ppro: PPRO
|
63
|
+
pse: PSE
|
64
|
+
rapi_pago: Rapi Pago
|
65
|
+
redpagos: RedPagos
|
66
|
+
russian_mobile_sale: Russian Mobile Sale
|
67
|
+
safetypay: Safetypay
|
68
|
+
santander: Santander
|
69
|
+
sdd_init_recurring_sale: SDD Init Recurring Sale
|
70
|
+
sdd_sale: SDD Sale
|
71
|
+
tarjeta_shopping: Tarjeta Shopping
|
72
|
+
container_store: Container Store
|
73
|
+
trustly_sale: Trustly Sale
|
74
|
+
upi: Upi
|
75
|
+
webmoney: Webmoney
|
76
|
+
webpay: Webpay
|
77
|
+
wechat: Wechat
|
17
78
|
payment:
|
18
79
|
usage: Electronic transaction via Spree eCommerce platform
|
19
80
|
reference: Reference transaction via Spree eCommerce platform
|
@@ -31,6 +92,10 @@ en:
|
|
31
92
|
updated_at: Updated
|
32
93
|
message: Message
|
33
94
|
technical_message: Technical Message
|
95
|
+
checkout_source: Checkout source
|
96
|
+
source_name: Name
|
97
|
+
source_consumer_id: Consumer ID
|
98
|
+
source_consumer_email: Consumer Email
|
34
99
|
spree:
|
35
100
|
token: Token
|
36
101
|
username: Username
|
@@ -38,6 +103,8 @@ en:
|
|
38
103
|
transaction_types: Transaction Types
|
39
104
|
return_success_url: Return Success URL
|
40
105
|
return_failure_url: Return Failure URL
|
106
|
+
return_cancel_url: Return Cancel URL
|
107
|
+
return_pending_url: Return Pending URL
|
41
108
|
challenge_indicator: Challenge Indicator
|
42
109
|
hostname: Hostname
|
43
110
|
threeds_allowed: Threeds V2 parameters handling
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class AddCheckoutSource < ActiveRecord::Migration[6.1]
|
2
|
+
|
3
|
+
def up # rubocop:disable Metrics/MethodLength
|
4
|
+
create_table 'emerchantpay_checkout_sources', if_not_exists: true do |t|
|
5
|
+
t.string 'consumer_id', limit: 256
|
6
|
+
t.string 'consumer_email', limit: 512, index: true
|
7
|
+
t.string 'name', limit: 64
|
8
|
+
t.string 'payment_method_id', limit: 64
|
9
|
+
t.string 'user_id', limit: 64
|
10
|
+
t.datetime 'created_at', precision: 6, null: false
|
11
|
+
t.datetime 'updated_at', precision: 6, null: false
|
12
|
+
t.datetime 'deleted_at', precision: 6
|
13
|
+
t.jsonb 'public_metadata'
|
14
|
+
t.jsonb 'private_metadata'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def down
|
19
|
+
drop_table 'emerchantpay_checkout_sources'
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -4,6 +4,7 @@ module SpreeEmerchantpayGenesis
|
|
4
4
|
|
5
5
|
require 'spree/core'
|
6
6
|
require 'genesis_ruby'
|
7
|
+
require 'genesis_ruby/utils/transactions/wpf_types'
|
7
8
|
require 'genesis_ruby/utils/transactions/references/capturable_types'
|
8
9
|
require 'genesis_ruby/utils/transactions/references/refundable_types'
|
9
10
|
require 'genesis_ruby/utils/transactions/references/voidable_types'
|
@@ -26,7 +27,8 @@ module SpreeEmerchantpayGenesis
|
|
26
27
|
|
27
28
|
config.after_initialize do |app|
|
28
29
|
app.config.spree.payment_methods += [
|
29
|
-
Spree::Gateway::EmerchantpayDirect
|
30
|
+
Spree::Gateway::EmerchantpayDirect,
|
31
|
+
Spree::Gateway::EmerchantpayCheckout
|
30
32
|
]
|
31
33
|
end
|
32
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_emerchantpay_genesis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- emerchantpay ltd.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: genesis_ruby
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -354,9 +354,13 @@ files:
|
|
354
354
|
- app/helpers/spree/admin/payment_methods_helper.rb
|
355
355
|
- app/helpers/spree_emerchantpay_genesis/mappers/genesis.rb
|
356
356
|
- app/helpers/spree_emerchantpay_genesis/mappers/order.rb
|
357
|
+
- app/helpers/spree_emerchantpay_genesis/mappers/threeds_attributes.rb
|
357
358
|
- app/helpers/spree_emerchantpay_genesis/mappers/transaction.rb
|
359
|
+
- app/helpers/spree_emerchantpay_genesis/payment_method_helper.rb
|
358
360
|
- app/helpers/spree_emerchantpay_genesis/threeds_helper.rb
|
359
361
|
- app/helpers/spree_emerchantpay_genesis/transaction_helper.rb
|
362
|
+
- app/models/spree/emerchantpay_checkout_source.rb
|
363
|
+
- app/models/spree/gateway/emerchantpay_checkout.rb
|
360
364
|
- app/models/spree/gateway/emerchantpay_direct.rb
|
361
365
|
- app/models/spree/payment_decorator.rb
|
362
366
|
- app/models/spree/payment_processing_decorator.rb
|
@@ -371,20 +375,28 @@ files:
|
|
371
375
|
- app/repositories/spree_emerchantpay_genesis/emerchantpay_payments_repository.rb
|
372
376
|
- app/repositories/spree_emerchantpay_genesis/spree_order_repository.rb
|
373
377
|
- app/repositories/spree_emerchantpay_genesis/spree_payments_repository.rb
|
378
|
+
- app/serializers/spree/api/v2/platform/emerchantpay_checkout_source_serializer.rb
|
374
379
|
- app/services/spree/payments/create_decorator.rb
|
375
380
|
- app/services/spree_emerchantpay_genesis/base/payment_service.rb
|
376
381
|
- app/services/spree_emerchantpay_genesis/notifications/service_handler.rb
|
382
|
+
- app/services/spree_emerchantpay_genesis/sources/create_checkout.rb
|
377
383
|
- app/services/spree_emerchantpay_genesis/sources/create_credit_card.rb
|
378
384
|
- app/services/spree_emerchantpay_genesis/threeds/callback.rb
|
379
385
|
- app/services/spree_emerchantpay_genesis/threeds/method_continue.rb
|
380
386
|
- app/views/layouts/spree/method_continue.html.erb
|
387
|
+
- app/views/partials/_gateway_messages.html.erb
|
388
|
+
- app/views/partials/_transaction_table.html.erb
|
389
|
+
- app/views/spree/admin/payments/source_views/_emerchantpay_checkout.html.erb
|
381
390
|
- app/views/spree/admin/payments/source_views/_emerchantpay_direct.html.erb
|
391
|
+
- app/views/spree/checkout/payment/_emerchantpay_checkout.html.erb
|
382
392
|
- app/views/spree/checkout/payment/_emerchantpay_direct.html.erb
|
383
393
|
- app/views/spree/emerchantpay_threeds/method_continue.html.erb
|
394
|
+
- config/initializers/extend_spree_permitted_checkout_attributes.rb
|
384
395
|
- config/locales/en.yml
|
385
396
|
- config/routes.rb
|
386
397
|
- db/migrate/20230927072418_add_emerchantpay_payments.rb
|
387
398
|
- db/migrate/20231128153140_add_callback_status_to_emerchantpay_payments.rb
|
399
|
+
- db/migrate/20240306152438_add_checkout_source.rb
|
388
400
|
- lib/generators/spree_emerchantpay_genesis/install/install_generator.rb
|
389
401
|
- lib/spree_emerchantpay_genesis.rb
|
390
402
|
- lib/spree_emerchantpay_genesis/engine.rb
|
@@ -396,8 +408,8 @@ licenses:
|
|
396
408
|
metadata:
|
397
409
|
homepage_uri: https://emerchantpay.com
|
398
410
|
source_code_uri: https://github.com/emerchantpay/spree-emp-plugin
|
399
|
-
changelog_uri: https://github.com/emerchantpay/spree-emp-plugin/blob/
|
400
|
-
documentation_uri: https://github.com/emerchantpay/spree-emp-plugin/blob/
|
411
|
+
changelog_uri: https://github.com/emerchantpay/spree-emp-plugin/blob/master/CHANGELOG.md
|
412
|
+
documentation_uri: https://github.com/emerchantpay/spree-emp-plugin/blob/master/README.md
|
401
413
|
post_install_message:
|
402
414
|
rdoc_options: []
|
403
415
|
require_paths:
|