malbec 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/lib/malbec/notification_mapper.rb +14 -2
- data/lib/malbec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20c77962f23086a0a71bd5a218e50be0a54c9a48
|
4
|
+
data.tar.gz: 6d5f4261ed78cfd24f3bb5fef0d09134b681bc37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 118589ba700d92738e57d46820d68ab76933ccce204ad3f968144f11ae4b4f521351ab337545f383ef3a6a5f6801c9d9defb8154ccb119d78169b8bb1322996b
|
7
|
+
data.tar.gz: 04d66c82d97f8dbd910d4be2e316bc67020c9d8e84dcaf3161000ce097a962f347e6b969f14a3d8432cbb627145263e356d09d626c3d2e75ce08376ac832df0f
|
@@ -1,17 +1,29 @@
|
|
1
|
+
require 'active_support'
|
2
|
+
require 'offsite_payments'
|
3
|
+
|
4
|
+
include OffsitePayments::Integrations
|
1
5
|
|
2
6
|
module Malbec
|
3
7
|
class NotificationMapper
|
4
8
|
def initialize(raw_data)
|
5
|
-
@notify =
|
9
|
+
@notify = Paypal::Notification.new(raw_data)
|
6
10
|
end
|
7
11
|
|
8
|
-
%w(item_name item_number).each do |m|
|
12
|
+
%w(item_name item_number payer_id payer_email).each do |m|
|
9
13
|
class_eval %(
|
10
14
|
def #{m}
|
11
15
|
(@notify.params['#{m}'])
|
12
16
|
end
|
13
17
|
)
|
14
18
|
end
|
19
|
+
|
20
|
+
%w(complete? transaction_id gross status test? currency params invoice account).each do |m|
|
21
|
+
class_eval %(
|
22
|
+
def #{m}
|
23
|
+
(@notify.send(:#{m}))
|
24
|
+
end
|
25
|
+
)
|
26
|
+
end
|
15
27
|
end
|
16
28
|
|
17
29
|
end
|
data/lib/malbec/version.rb
CHANGED