spree_paypal_api_checkout 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/controllers/spree/admin/payments_controller_decorator.rb +2 -2
- data/app/views/spree/admin/payments/{_paypal_complete.html.erb → _paypal_checkout_complete.html.erb} +1 -1
- data/app/views/spree/admin/payments/{paypal_refund.html.erb → paypal_checkout_refund.html.erb} +1 -1
- data/app/views/spree/admin/payments/source_forms/{_paypal.html.erb → _paypal_checkout.html.erb} +0 -0
- data/app/views/spree/admin/payments/source_views/{_paypal.html.erb → _paypal_checkout.html.erb} +1 -1
- data/app/views/spree/checkout/payment/_paypal_checkout.html.erb +4 -1
- data/config/routes.rb +11 -0
- data/lib/spree_paypal_api_checkout/version.rb +1 -1
- data/spree_paypal_api_checkout.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06d58fd2ed0b683b5f83542c81c695d25ba58e05807ea20db5a3391b5dc58b36
|
4
|
+
data.tar.gz: 5f315cada65b5b7fc6bd0b5d20dfeefbeddea0fc02883119faddbc5eb960cf52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59b562c5c96d4ac8deacf23aa16671364ea01bbef64f467a626a04c047260f7e31d2832e340040bf6e588d8c6f9278d68e61e5c4113c05a133cde94aeb742d27
|
7
|
+
data.tar.gz: b4ee8db0480d09a7bf2dc2be5ede7af6166128a54eed82367a7d95e94327c7b30affe17b67120b95f3c22c701f7ecbbc5166f877b5c0fd73dc3a33e35551fbde
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Spree::Admin::PaymentsControllerDecorator
|
2
|
-
def
|
2
|
+
def paypal_checkout_refund
|
3
3
|
if request.get?
|
4
4
|
if @payment.source.state == 'refunded'
|
5
5
|
flash[:error] = Spree.t(:already_refunded, :scope => 'paypal')
|
@@ -7,7 +7,7 @@ module Spree::Admin::PaymentsControllerDecorator
|
|
7
7
|
end
|
8
8
|
elsif request.post?
|
9
9
|
response = @payment.payment_method.refund(@payment, params[:refund_amount])
|
10
|
-
if response
|
10
|
+
if response['status']=='COMPLETED'
|
11
11
|
flash[:success] = Spree.t(:refund_successful, :scope => 'paypal')
|
12
12
|
redirect_to admin_order_payments_path(@order)
|
13
13
|
else
|
data/app/views/spree/admin/payments/{paypal_refund.html.erb → paypal_checkout_refund.html.erb}
RENAMED
@@ -6,7 +6,7 @@
|
|
6
6
|
/ <%= Spree.t('refund', :scope => :paypal) %>
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
<%= form_tag
|
9
|
+
<%= form_tag paypal_checkout_refund_admin_order_payment_path(@order, @payment) do %>
|
10
10
|
<div class="label-block left five columns alpha">
|
11
11
|
<div>
|
12
12
|
<fieldset data-hook="admin_variant_new_form">
|
data/app/views/spree/admin/payments/source_forms/{_paypal.html.erb → _paypal_checkout.html.erb}
RENAMED
File without changes
|
data/app/views/spree/admin/payments/source_views/{_paypal.html.erb → _paypal_checkout.html.erb}
RENAMED
@@ -16,7 +16,7 @@
|
|
16
16
|
</div>
|
17
17
|
|
18
18
|
<% if payment.source.state != 'refunded' %>
|
19
|
-
<%= button_link_to Spree.t('actions.refund', scope: :paypal), spree.
|
19
|
+
<%= button_link_to Spree.t('actions.refund', scope: :paypal), spree.paypal_checkout_refund_admin_order_payment_path(@order, payment), icon: 'money' %>
|
20
20
|
<% else %>
|
21
21
|
<div class="alpha six columns">
|
22
22
|
<dl>
|
@@ -27,7 +27,10 @@
|
|
27
27
|
var transaction = orderData.purchase_units[0].payments.captures[0];
|
28
28
|
fetch(`/paypal_checkout/proceed?number=${data.orderID}&status=${transaction.status}&transaction_id=${transaction.id}`, {
|
29
29
|
method: "get",
|
30
|
-
})
|
30
|
+
}).then((response) => response.json())
|
31
|
+
.then((orderData2) => {
|
32
|
+
window.location.href = `${window.location.origin}${orderData2.redirect_to}`
|
33
|
+
});
|
31
34
|
});
|
32
35
|
}
|
33
36
|
}).render('#paypal-button-container');
|
data/config/routes.rb
CHANGED
@@ -4,4 +4,15 @@ Spree::Core::Engine.add_routes do
|
|
4
4
|
get '/paypal_checkout/cancel', :to => "paypal_checkout#cancel", :as => :cancel_paypal_checkout
|
5
5
|
get '/paypal_checkout/notify', :to => "paypal_checkout#notify", :as => :notify_paypal_checkout
|
6
6
|
get '/paypal_checkout/proceed', :to => "paypal_checkout#proceed", :as => :proceed_paypal_checkout
|
7
|
+
namespace :admin do
|
8
|
+
# Using :only here so it doesn't redraw those routes
|
9
|
+
resources :orders, :only => [] do
|
10
|
+
resources :payments, :only => [] do
|
11
|
+
member do
|
12
|
+
get 'paypal_checkout_refund'
|
13
|
+
post 'paypal_checkout_refund'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
7
18
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "spree_paypal_api_checkout".freeze
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.7"
|
4
4
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
6
6
|
s.require_paths = ["lib".freeze]
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.date = "2022-02-22"
|
9
9
|
s.description = "Adds PayPal API Checkout as a Payment Method to Spree Commerce".freeze
|
10
10
|
s.email = "gems@spreecommerce.com".freeze
|
11
|
-
s.files = [".gitignore".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "app/assets/javascripts/spree/backend/spree_paypal_checkout.js".freeze, "app/assets/javascripts/spree/frontend/spree_paypal_checkout.js".freeze, "app/assets/stylesheets/spree/backend/spree_paypal_checkout.css".freeze, "app/assets/stylesheets/spree/frontend/spree_paypal_checkout.css".freeze, "app/controllers/spree/admin/payments_controller_decorator.rb".freeze, "app/controllers/spree/admin/paypal_checkout_payments_controller.rb".freeze, "app/controllers/spree/paypal_checkout_controller.rb".freeze, "app/models/spree/gateway/pay_pal_checkout.rb".freeze, "app/models/spree/paypal_api_checkout.rb".freeze, "app/views/spree/admin/payments/
|
11
|
+
s.files = [".gitignore".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "app/assets/javascripts/spree/backend/spree_paypal_checkout.js".freeze, "app/assets/javascripts/spree/frontend/spree_paypal_checkout.js".freeze, "app/assets/stylesheets/spree/backend/spree_paypal_checkout.css".freeze, "app/assets/stylesheets/spree/frontend/spree_paypal_checkout.css".freeze, "app/controllers/spree/admin/payments_controller_decorator.rb".freeze, "app/controllers/spree/admin/paypal_checkout_payments_controller.rb".freeze, "app/controllers/spree/paypal_checkout_controller.rb".freeze, "app/models/spree/gateway/pay_pal_checkout.rb".freeze, "app/models/spree/paypal_api_checkout.rb".freeze, "app/views/spree/admin/payments/_paypal_checkout_complete.html.erb".freeze, "app/views/spree/admin/payments/paypal_checkout_refund.html.erb".freeze, "app/views/spree/admin/payments/source_forms/_paypal_checkout.html.erb".freeze, "app/views/spree/admin/payments/source_views/_paypal_checkout.html.erb".freeze, "app/views/spree/checkout/payment/_paypal_checkout.html.erb".freeze, "config/locales/de.yml".freeze, "config/locales/en.yml".freeze, "config/locales/es.yml".freeze, "config/locales/it.yml".freeze, "config/locales/pl.yml".freeze, "config/locales/pt.yml".freeze, "config/routes.rb".freeze, "db/migrate/20220620042734_create_spree_paypal_api_checkouts.rb".freeze, "lib/generators/spree_paypal_api_checkout/install/install_generator.rb".freeze, "lib/spree_paypal_api_checkout.rb".freeze, "lib/spree_paypal_api_checkout/engine.rb".freeze, "lib/spree_paypal_api_checkout/version.rb".freeze, "script/rails".freeze, "spree_paypal_api_checkout.gemspec".freeze]
|
12
12
|
s.homepage = "http://www.spreecommerce.com".freeze
|
13
13
|
s.required_ruby_version = Gem::Requirement.new(">= 2.2.2".freeze)
|
14
14
|
s.requirements = ["none".freeze]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_paypal_api_checkout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spree Commerce
|
@@ -363,10 +363,10 @@ files:
|
|
363
363
|
- app/controllers/spree/paypal_checkout_controller.rb
|
364
364
|
- app/models/spree/gateway/pay_pal_checkout.rb
|
365
365
|
- app/models/spree/paypal_api_checkout.rb
|
366
|
-
- app/views/spree/admin/payments/
|
367
|
-
- app/views/spree/admin/payments/
|
368
|
-
- app/views/spree/admin/payments/source_forms/
|
369
|
-
- app/views/spree/admin/payments/source_views/
|
366
|
+
- app/views/spree/admin/payments/_paypal_checkout_complete.html.erb
|
367
|
+
- app/views/spree/admin/payments/paypal_checkout_refund.html.erb
|
368
|
+
- app/views/spree/admin/payments/source_forms/_paypal_checkout.html.erb
|
369
|
+
- app/views/spree/admin/payments/source_views/_paypal_checkout.html.erb
|
370
370
|
- app/views/spree/checkout/payment/_paypal_checkout.html.erb
|
371
371
|
- config/locales/de.yml
|
372
372
|
- config/locales/en.yml
|