unlock_paypal 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: 942f31b8d6f7f37a5fb9d72f83127ff5e3875f79
4
- data.tar.gz: 59220b5d737980dd78ae88d53fdfb04d3b65675f
3
+ metadata.gz: b211879a3154ccd5daa395e488de23182f0efc48
4
+ data.tar.gz: de6670e2f310a69e79b2fad5123b94eaecad2ae0
5
5
  SHA512:
6
- metadata.gz: 712e0a5c8d1bde5f24f058a2aa923677ddda74e20379988f245a78d44826a1d7f3ca83116178cdfdeaeb340cefc6d071d6e33374dc0462753af68112402e4f60
7
- data.tar.gz: a957aa23d77006c31e81337f92a73d7dfada2c45bd936fd459ac44b27e79074ad9180046aa5ffd37f33ddc2dc0a278f254aa45b448291ced195551d6195c5a40
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
- if @contribution.gateway.sandbox?
25
- @contribution.errors.add(:base, "Parece que este Unlock não está autorizado a utilizar o ambiente de Sandbox 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 }")
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
- @contribution.errors.add(:base, "Ooops. Ocorreu um erro ao ativar seu perfil recorrente no PayPal.")
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
- @contribution.errors.add(:base, "Ooops. Ocorreu um erro ao processar seu pagamento no PayPal.")
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 "Realizar pagamento pelo Paypal"
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
- "Economize tempo e dinheiro com as Assinaturas e Cobranças recorrentes do PayPal"
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 = "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>."
30
- settings << UnlockGateway::Setting.new(:username, "Nome do usuário de API", instructions)
31
- settings << UnlockGateway::Setting.new(:password, "Senha de API", instructions)
32
- settings << UnlockGateway::Setting.new(:signature, "Assinatura de API", instructions)
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
@@ -1,3 +1,3 @@
1
1
  module UnlockPaypal
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  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.2.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