catarse_moip 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b3bb83d8d72ee1b60f35f8fb2b6c659b57d236d
4
- data.tar.gz: 82b3db962f62cf1e77f9c89685cb82eb42128145
3
+ metadata.gz: 939e9fad48215b2efdaacf53db8696ad8d6ab572
4
+ data.tar.gz: 53255c7c2e8e5301bd0a0823251db91d7caa8c04
5
5
  SHA512:
6
- metadata.gz: 664061334bc3d73f5af2351aa502da87f8bdcb5311e298e59a0d89e16b3b1a0daa15f413dd4b9e3caad6c61727cd37d21d08b2ba3db9228a7e8d9587260c8cc6
7
- data.tar.gz: 4576bcde70cba877d300c1eae365dc8c4c5514f60620188dac258c13a199a1d3789e9b9ca520e4d4b2e370327585c2d968d456d5ad827f7547ca5b19b709945d
6
+ metadata.gz: c523a1ff0f803108715949eb5b56168c8d8359d1cd5be9de98c2e13b564b6d62c7feeb60a40d2ec41003c340f8288ec91d5139bd93686ce90e151b8581e70e9f
7
+ data.tar.gz: b592ddcc0892f1947778775d0784a794568ddac326f37ece0d9da5ebe0882debb6e8513a1080c99e7f4c5d794272ab6aa9722b5ad4b63a1d591690f0140bfa83
@@ -10,7 +10,7 @@ GIT
10
10
  PATH
11
11
  remote: .
12
12
  specs:
13
- catarse_moip (3.0.3)
13
+ catarse_moip (3.0.4)
14
14
  enumerate_it
15
15
  libxml-ruby (~> 2.6.0)
16
16
  rails (~> 4.0)
@@ -10,6 +10,7 @@ App.views.MoipForm.addChild('PaymentCard', _.extend({
10
10
  activate: function(options){
11
11
  // Set credit card fields masks
12
12
  this.moipForm = this.parent;
13
+ this.$('#payment_card_number').payment('formatCardNumber');
13
14
  window.app.maskAllElements();
14
15
  },
15
16
 
@@ -51,19 +52,6 @@ App.views.MoipForm.addChild('PaymentCard', _.extend({
51
52
  },
52
53
 
53
54
  getCardFlag: function(number) {
54
- var cc = (number + '').replace(/\s/g, ''); //remove space
55
-
56
- if ((/^(34|37)/).test(cc) && cc.length == 15) {
57
- return 'AMEX'; //AMEX begins with 34 or 37, and length is 15.
58
- } else if ((/^(51|52|53|54|55)/).test(cc) && cc.length == 16) {
59
- return 'MASTER'; //MasterCard beigins with 51-55, and length is 16.
60
- } else if ((/^(4)/).test(cc) && (cc.length == 13 || cc.length == 16)) {
61
- return 'VISA'; //VISA begins with 4, and length is 13 or 16.
62
- } else if ((/^(300|301|302|303|304|305|36|38)/).test(cc) && cc.length == 14) {
63
- return 'DINERS'; //Diners Club begins with 300-305 or 36 or 38, and length is 14.
64
- } else if ((/^(38)/).test(cc) && cc.length == 19) {
65
- return 'HIPER';
66
- }
67
- return '';
55
+ return $.payment.cardType(number).toUpperCase();
68
56
  }
69
57
  }, App.views.MoipForm.UserDocument));
@@ -14,6 +14,11 @@ App.views.MoipForm.addChild('PaymentSlip', _.extend({
14
14
  onBuildBoletoClick: function(e){
15
15
  var that = this;
16
16
  e.preventDefault();
17
+
18
+ if(!that.moipForm.validate()){
19
+ return false;
20
+ }
21
+
17
22
  $(e.currentTarget).hide();
18
23
  this.$('#payment-slip-instructions').slideUp('slow');
19
24
  that.moipForm.loader.show();
@@ -23,18 +23,18 @@
23
23
  | Por favor digite o nome escrito no cartão
24
24
  .w-col.w-col-6.cpf
25
25
  = label_tag :payment_card_cpf, "CPF", class: 'field-label fontweight-semibold'
26
- = text_field_tag :payment_card_cpf, nil, class: 'w-input text-field', data: {mask: '999.999.999-99'}, required: true
26
+ = text_field_tag :payment_card_cpf, nil, class: 'w-input text-field', data: {fixed_mask: '999.999.999-99'}, required: true
27
27
  .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="payment_card_cpf"]
28
28
  | Verifique o CPF do titular do cartão
29
29
  .w-row
30
30
  .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle.phone
31
31
  = label_tag :payment_card_phone, "Telefone", class: 'field-label fontweight-semibold'
32
- = text_field_tag :payment_card_phone, nil, class: 'w-input text-field', data: {mask: '(99) 9999-9999?9'}, required: true
32
+ = text_field_tag :payment_card_phone, nil, class: 'w-input text-field', data: {fixed_mask: '(99) 9999-99999'}, required: true
33
33
  .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="payment_card_phone"]
34
34
  | Por favor digite o telefone de contato do titular
35
35
  .w-col.w-col-6.w-col-small-6.w-col-tiny-6.birth
36
36
  = label_tag :payment_card_birth, "Data de Nascimento", class: 'field-label fontweight-semibold'
37
- = text_field_tag :payment_card_birth, nil, class: 'w-input text-field', data: {mask: '99/99/9999'}, required: true
37
+ = text_field_tag :payment_card_birth, nil, class: 'w-input text-field', data: {fixed_mask: '99/99/9999'}, required: true
38
38
  .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="payment_card_birth"]
39
39
  | Por favor digite a data de nascimento do titular
40
40
  .w-row
@@ -57,7 +57,7 @@
57
57
  | Veja o código de segurança do cartão abaixo da tarja magnética
58
58
  .w-col.w-col-6.w-col-small-6.w-col-tiny-6.date
59
59
  = label_tag :payment_card_date, 'Expiração', class: 'field-label fontweight-semibold'
60
- = text_field_tag :payment_card_date, nil, class: 'w-input text-field', data: {mask: '99/99'}, required: true
60
+ = text_field_tag :payment_card_date, nil, class: 'w-input text-field', data: {fixed_mask: '99/99'}, required: true
61
61
  .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="payment_card_date"]
62
62
  | Qual a data de expiração no cartão?
63
63
 
@@ -1,3 +1,3 @@
1
1
  module CatarseMoip
2
- VERSION = "3.0.3"
2
+ VERSION = "3.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catarse_moip
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antônio Roberto Silva
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-22 00:00:00.000000000 Z
13
+ date: 2014-11-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails