diff --git a/lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb b/lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb index 0fb0271..b89ea1f 100644 --- a/lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb +++ b/lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb @@ -27,6 +27,14 @@ def address end + def method_missing :name + begin + @params[name.to_s] + rescue + raise AttributenotFound + end + end + end class AdaptivePaypalErrorResponse diff --git a/lib/active_merchant/billing/gateways/paypal_adaptive_payments/exceptions.rb b/lib/active_merchant/billing/gateways/paypal_adaptive_payments/exceptions.rb index 53d1745..505df4f 100644 --- a/lib/active_merchant/billing/gateways/paypal_adaptive_payments/exceptions.rb +++ b/lib/active_merchant/billing/gateways/paypal_adaptive_payments/exceptions.rb @@ -1,5 +1,7 @@ class ConfigDoesNotExist < StandardError; end; +class AttributenotFound < StandardError; end; + class PaypalAdaptivePaymentsApiError < StandardError attr_reader :response