paypal-express 0.2.4 → 0.2.5

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
@@ -28,7 +28,7 @@ module Paypal
28
28
  v.blank?
29
29
  end
30
30
  if self.items.present?
31
- params[:"PAYMENTREQUEST_#{index}_ITEMAMT"] = Util.formatted_amount(items.sum(&:amount))
31
+ params[:"PAYMENTREQUEST_#{index}_ITEMAMT"] = Util.formatted_amount(items.sum(&:quantity) * items.sum(&:amount).to_f)
32
32
  self.items.each_with_index do |item, item_index|
33
33
  params.merge! item.to_params(index, item_index)
34
34
  end
@@ -3,11 +3,12 @@ require 'spec_helper.rb'
3
3
  describe Paypal::Payment::Request do
4
4
  let :instant_request do
5
5
  Paypal::Payment::Request.new(
6
- :amount => 10.25,
6
+ :amount => 20.5,
7
7
  :currency_code => :JPY,
8
8
  :description => 'Instant Payment Request',
9
9
  :notify_url => 'http://merchant.example.com/notify',
10
10
  :items => [{
11
+ :quantity => 2,
11
12
  :name => 'Item1',
12
13
  :description => 'Awesome Item!',
13
14
  :amount => 10.25
@@ -25,7 +26,7 @@ describe Paypal::Payment::Request do
25
26
 
26
27
  describe '.new' do
27
28
  it 'should handle Instant Payment parameters' do
28
- instant_request.amount.should == 10.25
29
+ instant_request.amount.should == 20.5
29
30
  instant_request.currency_code.should == :JPY
30
31
  instant_request.description.should == 'Instant Payment Request'
31
32
  instant_request.notify_url.should == 'http://merchant.example.com/notify'
@@ -41,15 +42,15 @@ describe Paypal::Payment::Request do
41
42
  describe '#to_params' do
42
43
  it 'should handle Instant Payment parameters' do
43
44
  instant_request.to_params.should == {
44
- :PAYMENTREQUEST_0_AMT => "10.25",
45
+ :PAYMENTREQUEST_0_AMT => "20.50",
45
46
  :PAYMENTREQUEST_0_CURRENCYCODE => :JPY,
46
47
  :PAYMENTREQUEST_0_DESC => "Instant Payment Request",
47
48
  :PAYMENTREQUEST_0_NOTIFYURL => "http://merchant.example.com/notify",
48
- :PAYMENTREQUEST_0_ITEMAMT => "10.25",
49
+ :PAYMENTREQUEST_0_ITEMAMT => "20.50",
49
50
  :L_PAYMENTREQUEST_0_NAME0 => "Item1",
50
51
  :L_PAYMENTREQUEST_0_DESC0 => "Awesome Item!",
51
52
  :L_PAYMENTREQUEST_0_AMT0 => "10.25",
52
- :L_PAYMENTREQUEST_0_QTY0 => 1
53
+ :L_PAYMENTREQUEST_0_QTY0 => 2
53
54
  }
54
55
  end
55
56
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal-express
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - nov matake
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-12 00:00:00 +09:00
18
+ date: 2011-04-20 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  requirements: []
247
247
 
248
248
  rubyforge_project:
249
- rubygems_version: 1.5.2
249
+ rubygems_version: 1.5.3
250
250
  signing_key:
251
251
  specification_version: 3
252
252
  summary: PayPal Express Checkout API Client for Instance, Recurring and Digital Goods Payment.