unlock_paypal 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/unlock_paypal/contributions_controller.rb +6 -7
- data/app/views/unlock_paypal/contributions/_form.html.slim +1 -1
- data/config/locales/es-MX.yml +10 -0
- data/config/locales/pt-BR.yml +10 -0
- data/lib/unlock_paypal/models/gateway.rb +5 -5
- data/lib/unlock_paypal/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b211879a3154ccd5daa395e488de23182f0efc48
|
4
|
+
data.tar.gz: de6670e2f310a69e79b2fad5123b94eaecad2ae0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dfbdd4dc2ffabaddada3827e12384a9615da2a61afbb67658e3b395620900064c5722020a9767ec7f27496ce5138b60bc931e79652613a0fedff3600008c686
|
7
|
+
data.tar.gz: 5c40800bd5b401a34f3e6a361a5b5101b8b972b68fc42d792faa01b255f9ca44a5121486f71d41610176e8a5b5f2ddafb35fce53b81187b1392fb2a8dcf01b79
|
@@ -21,11 +21,8 @@ class UnlockPaypal::ContributionsController < ::ApplicationController
|
|
21
21
|
if checkout.valid?
|
22
22
|
redirect_to checkout.checkout_url
|
23
23
|
else
|
24
|
-
|
25
|
-
|
26
|
-
else
|
27
|
-
@contribution.errors.add(:base, "Parece que este Unlock não está autorizado a utilizar o ambiente de produção do PayPal.#{ ' Você já solicitou acesso à API? Verifique também se configurou o nome de usuário, a senha e a assinatura de API no PayPal.' if @initiative.user == current_user }")
|
28
|
-
end
|
24
|
+
error = t('flash.actions.create.alert', resource_name: @contribution.class.model_name.human)
|
25
|
+
@contribution.errors.add(:base, "#{error} (PayPal - checkout_url)")
|
29
26
|
return render '/initiatives/contributions/new'
|
30
27
|
end
|
31
28
|
|
@@ -93,7 +90,8 @@ class UnlockPaypal::ContributionsController < ::ApplicationController
|
|
93
90
|
end
|
94
91
|
end
|
95
92
|
else
|
96
|
-
|
93
|
+
error = t('flash.actions.create.alert', resource_name: @contribution.class.model_name.human)
|
94
|
+
@contribution.errors.add(:base, "#{error} (PayPal - create_recurring_profile)")
|
97
95
|
end
|
98
96
|
return render '/initiatives/contributions/new'
|
99
97
|
end
|
@@ -105,7 +103,8 @@ class UnlockPaypal::ContributionsController < ::ApplicationController
|
|
105
103
|
end
|
106
104
|
end
|
107
105
|
else
|
108
|
-
|
106
|
+
error = t('flash.actions.create.alert', resource_name: @contribution.class.model_name.human)
|
107
|
+
@contribution.errors.add(:base, "#{error} (PayPal - request_payment)")
|
109
108
|
end
|
110
109
|
return render '/initiatives/contributions/new'
|
111
110
|
end
|
@@ -1,4 +1,4 @@
|
|
1
1
|
= form_for @contribution, url: paypal_contributions_path, method: :post do |form|
|
2
2
|
= render partial: 'initiatives/contributions/sandbox_warning', locals: { gateway: gateway }
|
3
3
|
= render partial: 'initiatives/contributions/base_form', locals: { form: form, gateway: gateway }
|
4
|
-
.submit= form.submit
|
4
|
+
.submit= form.submit t('initiatives.contributions.new.submit', gateway: gateway.name)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
es-MX:
|
2
|
+
unlock_paypal:
|
3
|
+
models:
|
4
|
+
gateway:
|
5
|
+
description: "Ahorra tiempo y dinero con el servicio de Suscripciones y pagos recurrentes de PayPal"
|
6
|
+
available_settings:
|
7
|
+
instructions: "Con tu cuenta Premier ou Business habilitada en Paypal, accede a <a href='https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-api-access&upgrade.x=1' target='_blank'>Mi cuenta › Perfil › Más opciones › Opciones de venta › Acceso a API › Actualizar</a> y elige la <strong>Opción 2</strong>. Después, haz clic en <a href='https://www.paypal.com/br/cgi-bin/webscr?cmd=_profile-api-signature' target='_blank'>Ver firma de API</a>."
|
8
|
+
username: "Nombre de usuario de API"
|
9
|
+
password: "Contraseña de API"
|
10
|
+
signature: "Firma de API"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
pt-BR:
|
2
|
+
unlock_paypal:
|
3
|
+
models:
|
4
|
+
gateway:
|
5
|
+
description: "Economize tempo e dinheiro com as Assinaturas e Cobranças recorrentes do PayPal"
|
6
|
+
available_settings:
|
7
|
+
instructions: "Com sua conta de Especial ou Comercial habilitada no Paypal, vá em <a href='https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-api-access&upgrade.x=1' target='_blank'>Minha conta › Perfil › Mais opções › Minhas ferramentas de venda › Acesso à API › Atualizar</a> e escolha a <strong>Opção 2</strong>. Depois, clique em <a href='https://www.paypal.com/br/cgi-bin/webscr?cmd=_profile-api-signature' target='_blank'>Exibir assinatura de API</a>."
|
8
|
+
username: "Nome do usuário de API"
|
9
|
+
password: "Senha de API"
|
10
|
+
signature: "Assinatura de API"
|
@@ -9,7 +9,7 @@ module UnlockPaypal
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def description
|
12
|
-
|
12
|
+
I18n.t('unlock_paypal.models.gateway.description')
|
13
13
|
end
|
14
14
|
|
15
15
|
def image
|
@@ -26,10 +26,10 @@ module UnlockPaypal
|
|
26
26
|
|
27
27
|
def available_settings
|
28
28
|
settings = []
|
29
|
-
instructions =
|
30
|
-
settings << UnlockGateway::Setting.new(:username,
|
31
|
-
settings << UnlockGateway::Setting.new(:password,
|
32
|
-
settings << UnlockGateway::Setting.new(:signature,
|
29
|
+
instructions = I18n.t('unlock_paypal.models.gateway.available_settings.instructions')
|
30
|
+
settings << UnlockGateway::Setting.new(:username, I18n.t('unlock_paypal.models.gateway.available_settings.username'), instructions)
|
31
|
+
settings << UnlockGateway::Setting.new(:password, I18n.t('unlock_paypal.models.gateway.available_settings.password'), instructions)
|
32
|
+
settings << UnlockGateway::Setting.new(:signature, I18n.t('unlock_paypal.models.gateway.available_settings.signature'), instructions)
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unlock_paypal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Weinmann
|
@@ -83,6 +83,8 @@ files:
|
|
83
83
|
- app/views/unlock_paypal/contributions/_form.html.slim
|
84
84
|
- config/initializers/paypal-recurring.rb
|
85
85
|
- config/initializers/register.rb
|
86
|
+
- config/locales/es-MX.yml
|
87
|
+
- config/locales/pt-BR.yml
|
86
88
|
- config/routes.rb
|
87
89
|
- lib/tasks/unlock_moip_tasks.rake
|
88
90
|
- lib/unlock_paypal.rb
|