@@ -54,12 +54,15 @@ def request_payment
54
54
else
55
55
Rails . application . routes . url_helpers . mollie_hook_url
56
56
end
57
+ redirect_url = Rails . application . routes . url_helpers . payment_redirect_url ( token : token )
57
58
58
59
payment = Mollie ::Payment . create (
59
- amount : { value : amount . to_s , currency : 'EUR' } ,
60
+ amount : { value : "#{ '%.2f' % amount } " , currency : 'EUR' } ,
61
+ method : 'ideal' , # only ideal for now
62
+ issuer : issuer ,
60
63
description : description ,
61
- webhookUrl : webhook_url ,
62
- redirectUrl : Rails . application . routes . url_helpers . payment_redirect_url ( token : token )
64
+ webhook_url : webhook_url ,
65
+ redirect_url : redirect_url ,
63
66
)
64
67
65
68
self . trxid = payment . id
@@ -158,10 +161,10 @@ def activities
158
161
private
159
162
160
163
def status_update ( new_status )
161
- self . status = case new_status . downcase
162
- when "succeeded " , "paid "
164
+ self . status = case new_status
165
+ when "paid " , "authorized "
163
166
:successful
164
- when "expired" , "canceled" , " failed", "cancelled" , "authorization_failed "
167
+ when "expired" , "failed" , "canceled "
165
168
:failed
166
169
else
167
170
:in_progress
0 commit comments