solidus_nexio 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b68500a4d03fe4d7d7c015b9ff2979a9ee9126ec22638f00eff1f4208824586
4
- data.tar.gz: 5b81b70480c60230c012f321a7570e02b827e20f0d7eb2fa8b6b8e673ad2ff82
3
+ metadata.gz: ddb0f7278645f88cf97deee0c4abb566fcdef92e9670e85599e32f876ed73ddd
4
+ data.tar.gz: 83f11d368531fae0ee997dabe59ed21a305bc514aac4afda1ca22a5940c845a0
5
5
  SHA512:
6
- metadata.gz: afe981b701a100113aecd4057c82070f20a469cafd5414854458b311990fc1c169466d8c5004022b7594848408f94d5aa5daf3c8be9c1c15806ae045cb7e17bd
7
- data.tar.gz: '08ea234375d5b8cf0ab3830d7f3aeb05cfc503d6e29c7fd131976d74209426ab2a0260ca4a5af52c37e87a3b71945342e6f26db1a1150296a41069476c2e86fb'
6
+ metadata.gz: c46acbe66367853463ad99d5ca379b7633e7cb9b572c61088111adba1ecee13d1ff19312f88208b5d6158fee818e648d9593de1ee321eb34935aa936fa028c47
7
+ data.tar.gz: ce4a0f69ee54f876c3cc1a7ce17c94e8d814e418cc8fc7e86f65b97749225463b080c55a44fbed65ac9d64db4cb7bbfed42f8062eed598dcce09ae54b56d1ba6
data/README.md CHANGED
@@ -22,7 +22,45 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ This is a example of Spree config for Paragon in `config/initializers/spree.rb`
26
+ ```
27
+ Spree.config do |config|
28
+ ...
29
+
30
+ Rails.configuration.after_initialize do
31
+ config.static_model_preferences.add(
32
+ SolidusNexio::PaymentMethod,
33
+ 'nexio',
34
+ server: ENV['NEXIO_ENV'] || 'sandbox', # production || sandbox
35
+ merchant_id: ENV['NEXIO_MERCHANT_ID'],
36
+ auth_token: ENV['NEXIO_AUTH_TOKEN'],
37
+ public_key: ENV['NEXIO_PUBLIC_KEY'],
38
+ three_d_secure: ENV['NEXIO_THREE_D_SECURE'].present?
39
+ )
40
+
41
+ config.static_model_preferences.add(
42
+ SolidusNexio::AlternativePaymentMethod,
43
+ 'braintree_paypal_apm',
44
+ server: ENV['NEXIO_ENV'] || 'sandbox', # production || sandbox
45
+ merchant_id: ENV['NEXIO_MERCHANT_ID'],
46
+ auth_token: ENV['NEXIO_AUTH_TOKEN'],
47
+ payment_method: 'braintreePayPal',
48
+ save_token: true
49
+ )
50
+ Spree::PaymentMethod
51
+ config.static_model_preferences.add(
52
+ SolidusNexio::AlternativePaymentMethod,
53
+ 'paypal_redirect',
54
+ server: ENV['NEXIO_ENV'] || 'sandbox', # production || sandbox
55
+ merchant_id: ENV['NEXIO_MERCHANT_ID'],
56
+ auth_token: ENV['NEXIO_AUTH_TOKEN'],
57
+ payment_method: 'payPal',
58
+ save_token: true,
59
+ customer_redirect: true
60
+ )
61
+ end
62
+ end
63
+ ```
26
64
 
27
65
  ## Frontend Development
28
66
 
@@ -1,12 +1,17 @@
1
+ <%
2
+ # Set defaults for local_assigns
3
+ user ||= current_spree_user
4
+ order ||= current_order
5
+ %>
1
6
  <% if payment_method.preferred_customer_redirect %>
2
7
  <%= link_to '#', class: :hidden, data: { 'nexio-customer-redirect': payment_method.id, 'nexio-payment-method': payment_method.preferred_payment_method } do %>
3
8
  <%= yield.presence || payment_method.name %>
4
9
  <% end %>
5
- <%= setup_custom_redirect(payment_method, current_order, user: current_spree_user) %>
10
+ <%= setup_custom_redirect(payment_method, order, user: user) %>
6
11
  <% else %>
7
12
  <fieldset data-nexio-apm="<%= payment_method.id %>" data-hook="nexio_apm" data-nexio-payment-method="<%= payment_method.preferred_payment_method %>">
8
13
  <input name="order[payments_attributes][][nexio_apm_transaction_id]" type="hidden" data-hook="nexio_apm_transaction_id" />
9
14
  <input name="payment_source[<%= payment_method.id %>][gateway_payment_profile_id]" type="hidden" data-hook="gateway_payment_profile_id" />
10
15
  </fieldset>
11
- <%= setup_nexio_apm(payment_method, current_order, user: current_spree_user) %>
16
+ <%= setup_nexio_apm(payment_method, order, user: user) %>
12
17
  <% end %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusNexio
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_nexio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Whitespectre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-01 00:00:00.000000000 Z
11
+ date: 2023-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nexio_activemerchant