Skip to content

Commit 96d7982

Browse files
authored
Fix EMV field repeatable (#3)
* Fix EMV field repeatable * Fix tests
1 parent 4c19df9 commit 96d7982

File tree

8 files changed

+72
-79
lines changed

8 files changed

+72
-79
lines changed

.github/workflows/heroku.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,3 @@ jobs:
4242

4343
- name: Publish to Heroku
4444
run: git push heroku `git subtree split --prefix demo master`:master --force
45-

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## [Unreleased]
22

3+
## [0.3.4] - 2021-06-28
4+
5+
- Fix behavior of EMV field 'repeatable' (the logic was inversed)
6+
37
## [0.3.3] - 2021-06-25
48

59
- Rubocop setup

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021 TODO: Write your name
3+
Copyright (c)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ puts pix.base64
7474
* https://www.bcb.gov.br/estabilidadefinanceira/pix
7575
* https://gerencianet.com.br/blog/qr-code-estatico-qr-code-dinamico-no-pix
7676
* https://blog.juno.com.br/pix-qr-code-estatico-x-qr-code-dinamico
77+
* https://github.com/entria/awesome-pix
7778

7879
## Execute tests/specs
7980

@@ -92,7 +93,7 @@ docker run -v $(pwd):/app/ -it qrcode_pix_ruby_specs
9293

9394
## Demo
9495

95-
It's provided a simple demo app, in Heroku, that uses the gem always in latest stable. You can check and test your QRCodes here:
96+
It's provided a simple demo app, in Heroku, that uses the gem always in latest stable. You can check and test your QRCodes here:
9697

9798
https://qrcode-pix-ruby.herokuapp.com
9899

demo/config.ru

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def generate_html_with(env)
6262
<br>
6363
<form action='https://qrcode-pix-ruby.herokuapp.com' method='post'>
6464
<div class='mb-3'>
65-
<label for='pix_key'>PIX key (email, phone, CPF, and random keys)</label>
65+
<label for='pix_key'>Pix key</label>
6666
<input required type='text' class='form-control' id='pix_key' value='#{qrcode_data["pix_key"]}' name='pix_key'>
6767
</div>
6868
<div class='mb-3'>
@@ -78,11 +78,11 @@ def generate_html_with(env)
7878
<input required type='text' class='form-control' id='merchant_city' value='#{qrcode_data["merchant_city"]}' name='merchant_city'>
7979
</div>
8080
<div class='mb-3'>
81-
<label for='transaction_id'>Transaction ID (only numbers/characters without whitespaces)</label>
81+
<label for='transaction_id'>Transaction ID</label>
8282
<input required type='text' class='form-control' id='transaction_id' value='#{qrcode_data["transaction_id"]}' name='transaction_id'>
8383
</div>
8484
<div class='mb-3'>
85-
<label for='amount'>Amount (examples: 1.00, 0.75, 7500.00, 12400.50)</label>
85+
<label for='amount'>Amount</label>
8686
<input required type='text' class='form-control' id='amount' value='#{qrcode_data["amount"]}' name='amount'>
8787
</div>
8888
<div class='mb-3'>
@@ -98,7 +98,7 @@ def generate_html_with(env)
9898
</select>
9999
</div>
100100
<div class='mb-3'>
101-
<label for='postal_code'>Postal code (only numbers)</label>
101+
<label for='postal_code'>Postal code</label>
102102
<input required type='text' class='form-control' id='postal_code' value='#{qrcode_data["postal_code"]}' name='postal_code'>
103103
</div>
104104
<div class='mb-3'>

lib/qrcode_pix_ruby/payload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def emv(id, value)
7272
end
7373

7474
def emv_repeatable
75-
emv(ID_POINT_OF_INITIATION_METHOD, repeatable ? '12' : '11')
75+
emv(ID_POINT_OF_INITIATION_METHOD, repeatable ? '11' : '12')
7676
end
7777

7878
def emv_merchant

lib/qrcode_pix_ruby/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module QrcodePixRuby
4-
VERSION = '0.3.3'
4+
VERSION = '0.3.4'
55
end

spec/qrcode_pix_ruby_spec.rb

Lines changed: 59 additions & 70 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)