perfect_money_merchant 0.1.0.alpha.4 → 0.1.1.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a41188bea6b7545e9d1b355a41314c0d69a0b3a
|
4
|
+
data.tar.gz: 5a58f9b0d741394573ae9be5eb8895ba68a48bb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ce57858bfc0b2dce54297038b5e2f4dd4a056442cc305d898bebcb4605efc4da4e2a9821d4977855f9c0d1b3a6ea580912ad18ac7f79b5cb25e18230cb81a9a
|
7
|
+
data.tar.gz: 86a6401dd1aed33c497c271efd091a5c672d0758b2d2a8a79a1b539a81b489a207b43e51c43d0707017e7c1765b1849e81b9cf2504187de31ead97e066c8cfe6
|
@@ -23,11 +23,19 @@ module PerfectMoneyMerchant
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def success
|
26
|
-
|
26
|
+
if sci_params.redirect_url.nil?
|
27
|
+
render status: 200, inline: 'Success! You have paid for it successfully.'
|
28
|
+
else
|
29
|
+
redirect_to sci_params.redirect_url
|
30
|
+
end
|
27
31
|
end
|
28
32
|
|
29
33
|
def error
|
30
|
-
|
34
|
+
if sci_params.redirect_url.nil?
|
35
|
+
render status: 400, inline: 'Error! Error occured.'
|
36
|
+
else
|
37
|
+
redirect_to sci_params.redirect_url
|
38
|
+
end
|
31
39
|
end
|
32
40
|
|
33
41
|
private
|
@@ -22,6 +22,7 @@ module PerfectMoneyMerchant
|
|
22
22
|
attr_reader :suggested_memo
|
23
23
|
attr_reader :baggage_fields
|
24
24
|
attr_reader :payment_purpose
|
25
|
+
attr_reader :redirect_url
|
25
26
|
|
26
27
|
def initialize(attributes = {})
|
27
28
|
set_defaults
|
@@ -35,6 +36,9 @@ module PerfectMoneyMerchant
|
|
35
36
|
set_verification(attributes[:verification]) if attributes[:verification]
|
36
37
|
set_purpose(attributes[:purpose]) if attributes[:purpose]
|
37
38
|
|
39
|
+
set_redirect_url(attributes[:redirect_url]) if attributes[:redirect_url]
|
40
|
+
|
41
|
+
|
38
42
|
verify_fields!
|
39
43
|
end
|
40
44
|
|
@@ -67,6 +71,11 @@ module PerfectMoneyMerchant
|
|
67
71
|
set_baggage_field(:payment_purpose)
|
68
72
|
end
|
69
73
|
|
74
|
+
def set_redirect_url(url)
|
75
|
+
@redirect_url = url
|
76
|
+
set_baggage_field(:redirect_url)
|
77
|
+
end
|
78
|
+
|
70
79
|
def set_field(name, value)
|
71
80
|
singleton_class.class_eval do
|
72
81
|
attr_accessor name
|