File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ def pay_activities
45
45
transaction_type : :activity ,
46
46
redirect_uri : member_payments_path
47
47
)
48
+
48
49
if payment . save
49
50
# Check URI for safety (supresses brakeman warning)
50
51
url = begin
@@ -54,8 +55,8 @@ def pay_activities
54
55
end
55
56
56
57
# Check if it's a valid URI and matches your whitelist of acceptable domains (e.g., only http(s)://example.com)
57
- if url . is_a? ( URI ::HTTP ) && [ 'mollie.com' ] . include? ( url . host )
58
- redirect_to ( url )
58
+ if url . is_a? ( URI ::HTTP ) && [ 'www. mollie.com' ] . include? ( url . host )
59
+ redirect_to ( url . to_s )
59
60
else
60
61
# Fallback to a safe default redirect if the URI is invalid or not in the whitelist
61
62
redirect_to ( root_path )
Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ def request_payment
65
65
)
66
66
67
67
self . trxid = payment . id
68
+
69
+ # The host of this url is `www.mollie.com` so it will redirect to the mollie payment page
70
+ # if this ever chanes, the redirect_uri whitelist in the controller should be updated
68
71
self . payment_uri = payment . _links [ 'checkout' ] [ 'href' ]
69
72
self . status = :in_progress
70
73
You can’t perform that action at this time.
0 commit comments