smartkiosk-client 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,15 +41,20 @@ class Application
41
41
  Smartware.cash_acceptor.close
42
42
 
43
43
  if payment.payment_type == 0
44
- payment.update_attributes(:banknotes => Smartware.cash_acceptor.banknotes)
44
+ attributes = {
45
+ :banknotes => Smartware.cash_acceptor.banknotes
46
+ }
45
47
  else
46
- payment.update_attributes(
48
+ attributes = {
47
49
  :paid_amount => params['payment']['paid_amount'],
48
50
  :card_track1 => params['payment']['card_track1'],
49
51
  :card_track2 => params['payment']['card_track2']
50
- )
52
+ }
51
53
  end
52
54
 
55
+ attributes[:meta] = params['payment']['meta']
56
+
57
+ payment.update_attributes attributes
53
58
  payment.receipt.print
54
59
  payment.pay
55
60
  nil
@@ -13,6 +13,7 @@ class Payment < ActiveRecord::Base
13
13
  serialize :limit
14
14
  serialize :commissions
15
15
  serialize :banknotes
16
+ serialize :meta
16
17
 
17
18
  validates :provider, :presence => true
18
19
  validates :payment_type, :presence => true
@@ -11,6 +11,7 @@ module Payments
11
11
  response = RestClient.post "#{Terminal.config.host}/payments/#{payment.foreign_id}/pay",
12
12
  :provider => payment.provider.keyword,
13
13
  :terminal => Terminal.config.keyword,
14
+ :meta => payment.meta,
14
15
  :payment => {
15
16
  :paid_amount => payment.paid_amount,
16
17
  :card_track1 => payment.card_track1,
@@ -14,6 +14,7 @@ class CreatePayments < ActiveRecord::Migration
14
14
  t.boolean :checked, :default => false
15
15
  t.boolean :processed, :default => false
16
16
  t.boolean :failed, :default => false
17
+ t.text :meta
17
18
 
18
19
  t.decimal :paid_amount, :precision => 38, :scale => 2
19
20
  t.decimal :commission_amount, :precision => 38, :scale => 2
@@ -2,6 +2,6 @@ require 'sinatra/base'
2
2
 
3
3
  module Smartkiosk
4
4
  class Client < Sinatra::Base
5
- VERSION = '0.1.9'
5
+ VERSION = '0.1.10'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartkiosk-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -626,7 +626,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
626
626
  version: '0'
627
627
  segments:
628
628
  - 0
629
- hash: 1362776259685194902
629
+ hash: -1955689674729030001
630
630
  required_rubygems_version: !ruby/object:Gem::Requirement
631
631
  none: false
632
632
  requirements:
@@ -635,7 +635,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
635
635
  version: '0'
636
636
  segments:
637
637
  - 0
638
- hash: 1362776259685194902
638
+ hash: -1955689674729030001
639
639
  requirements: []
640
640
  rubyforge_project:
641
641
  rubygems_version: 1.8.23