From 5a7bc087fbd96981723c240a564c53443d9780c2 Mon Sep 17 00:00:00 2001 From: piotrpanko Date: Wed, 23 Dec 2020 14:45:26 +0100 Subject: [PATCH] Verify the response from the payment provider responds to params --- app/models/spree/payment_decorator.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/spree/payment_decorator.rb b/app/models/spree/payment_decorator.rb index 864b43bb..83b10612 100644 --- a/app/models/spree/payment_decorator.rb +++ b/app/models/spree/payment_decorator.rb @@ -1,7 +1,9 @@ module Spree module PaymentDecorator def handle_response(response, success_state, failure_state) - self.intent_client_key = response.params['client_secret'] if response.params['client_secret'] && response.success? + if response.success? && response.respond_to?(:params) + self.intent_client_key = response.params['client_secret'] if response.params['client_secret'] + end super end