puntopagos 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,6 +36,7 @@ module PuntoPagos
36
36
  #
37
37
  # Returns a message as a String.
38
38
  def create_message token, trx_id, amount, timestamp
39
+ amount = amount.to_i.to_s + ".00"
39
40
  @@function + "\n" + token + "\n" + trx_id + "\n" + amount + "\n" + timestamp
40
41
  end
41
42
 
@@ -9,6 +9,7 @@ module PuntoPagos
9
9
 
10
10
  # TODO validate JSON
11
11
  def success?
12
+ puts "#{@@response['respuesta']}"
12
13
  @@response["respuesta"] == "00"
13
14
  end
14
15
 
@@ -1,3 +1,3 @@
1
1
  module PuntoPagos
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -4,14 +4,14 @@ require 'test_helper'
4
4
  class CreateRequestTest < Test::Unit::TestCase
5
5
 
6
6
  def setup
7
- @req = PuntoPagos::Request.new('test')
7
+ @req = PuntoPagos::Request.new('production')
8
8
  end
9
9
 
10
10
  def test_valid_create
11
11
  puts "-------"
12
12
  puts "webpay valid"
13
13
 
14
- resp = @req.create("#{Time.now.to_i}", "100.00")
14
+ resp = @req.create("#{Time.now.to_i}", "100.00")
15
15
 
16
16
  assert resp.success? == true, "Pass"
17
17
 
@@ -31,7 +31,7 @@ class CreateRequestTest < Test::Unit::TestCase
31
31
  puts "testing notification"
32
32
  notification = PuntoPagos::Notification.new('test')
33
33
  headers = {'Fecha' => 'Thu, 14 Jun 2012 22:52:47 GMT', 'Autorizacion' => 'PP rkdXmAGWLHCKdPyyk6ig:qOSavthLY3ElqsRCtxFEl02lL1s='}
34
- params = {'token' => 'M5N1DAE6PALVAF8K', 'monto' => '1000000.00', 'trx_id' => '9787415132'}
34
+ params = {'token' => 'M5N1DAE6PALVAF8K', 'monto' => "1000000.0", 'trx_id' => '9787415132'}
35
35
  assert notification.valid?(headers, params) == true
36
36
  end
37
37
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puntopagos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2012-07-10 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
17
- requirement: &2157206220 !ruby/object:Gem::Requirement
17
+ requirement: &2161111680 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: 1.6.7
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2157206220
25
+ version_requirements: *2161111680
26
26
  description: Ruby wrapper for PuntoPagos Payment API
27
27
  email:
28
28
  - imella@acid.cl