spree_zaez_cielo 3.0.8 → 3.0.9

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: 4c956cee52731767f017f1d52a98826568ab6515
4
- data.tar.gz: 899b706f8c760e7bb31c4aa068ee15b649473fb5
3
+ metadata.gz: 74317f9fef3be962b0cdf836a217cf798046d18c
4
+ data.tar.gz: 356da3dd659544563dfa2d4d3b9a6230bb713120
5
5
  SHA512:
6
- metadata.gz: 884c097c616f8c09cbda89f73b01cd8eb13cf44b887c9c8751f40348f286e2360716e25ea8d1158557abfa67349cd9fd6683090080c41e1ed98bfb23dc197855
7
- data.tar.gz: 571032b330e6072ca0d0763b924a751313676ea25399290d4672fdcbe24681ff53f24bb5e76576e519d03f0991be60307296051f3e4f61119339a7a29190ce22
6
+ metadata.gz: 28c37b24361658bf3661cb31e62775669e90cd988c1e2eb5206bbe5e21f8794e6138557c6dd82081effde2f17e5b1ac78e3b21f90b1faba979dd361de60aed4d
7
+ data.tar.gz: b8523d37c7b8a8a86df31a00b63ec7bf8eec4fa1d8fff4a30f5d82c628c80593d860df240b6182a0de68b83aeb9efec286ae73727326e7d541b18b4fd1e5301d
@@ -26,9 +26,11 @@ module Spree
26
26
  if source.gateway_customer_profile_id?
27
27
  params = { token: CGI.escape(source.gateway_customer_profile_id) }
28
28
  else
29
+ year = source.year.to_s.rjust(4, '0')
30
+ month = source.month.to_s.rjust(2, '0')
29
31
  params = {
30
32
  cartao_numero: source.number,
31
- cartao_validade: "#{source.year}#{source.month}",
33
+ cartao_validade: "#{year}#{month}",
32
34
  cartao_seguranca: source.verification_value,
33
35
  cartao_portador: source.name
34
36
  }
@@ -77,9 +79,11 @@ module Spree
77
79
  if source.gateway_customer_profile_id?
78
80
  params = { token: CGI.escape(source.gateway_customer_profile_id) }
79
81
  else
82
+ year = source.year.to_s.rjust(4, '0')
83
+ month = source.month.to_s.rjust(2, '0')
80
84
  params = {
81
85
  cartao_numero: source.number,
82
- cartao_validade: "#{source.year}#{source.month}",
86
+ cartao_validade: "#{year}#{month}",
83
87
  cartao_seguranca: source.verification_value,
84
88
  cartao_portador: source.name
85
89
  }
@@ -24,6 +24,9 @@ module Spree
24
24
  return_url = Spree::Store.current.url
25
25
  return_url << Spree::Core::Engine.routes.url_helpers.cielo_debt_confirm_path(source.id, self.id)
26
26
 
27
+ year = source.year.to_s.rjust(4, '0')
28
+ month = source.month.to_s.rjust(2, '0')
29
+
27
30
  params = { numero: source.id,
28
31
  valor: amount,
29
32
  moeda: '986',
@@ -31,7 +34,7 @@ module Spree
31
34
  parcelas: '1',
32
35
  cartao_numero: source.number,
33
36
  :'url-retorno' => return_url,
34
- cartao_validade: "#{source.year}#{source.month}",
37
+ cartao_validade: "#{year}#{month}",
35
38
  cartao_seguranca: source.verification_value,
36
39
  cartao_portador: source.name,
37
40
  autorizar: '2',
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_zaez_cielo'
5
- s.version = '3.0.8'
5
+ s.version = '3.0.9'
6
6
  s.summary = 'Adds Cielo as a Payment Method to Spree Commerce'
7
7
  s.description = s.summary
8
8
  s.required_ruby_version = '>= 2.0.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_zaez_cielo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.8
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zaez Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-23 00:00:00.000000000 Z
11
+ date: 2016-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core