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: 3e88396c40801efd18e7ee80f2b48f99ae563ad8
4
- data.tar.gz: 3715195c1a2bfad2beb17a4bd1f90adcc3b321d8
3
+ metadata.gz: 9a41188bea6b7545e9d1b355a41314c0d69a0b3a
4
+ data.tar.gz: 5a58f9b0d741394573ae9be5eb8895ba68a48bb7
5
5
  SHA512:
6
- metadata.gz: 18db37bd8ffe73bbc56c3d53a1bf9e672ce3ea41ce2e0e122581b8e7b6ace55955bf0764f0bc2d5c304802d122a242a9a845ce58a51f20d235ad79f36f46a285
7
- data.tar.gz: e1a380bf9c235b6ac0a96b10d4654b753da767cd6b027dfc395222d55ba3a6376fcd91aa9926188260af6fdbb7ef898476fe1887ad11aa3d11a4d7ddc0dd9141
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
- render status: 200, nothing: true
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
- render status: 400, nothing: true
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
@@ -1,3 +1,3 @@
1
1
  module PerfectMoneyMerchant
2
- VERSION = '0.1.0.alpha.4'
2
+ VERSION = '0.1.1.alpha.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perfect_money_merchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha.4
4
+ version: 0.1.1.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Pauk