diff --git a/lib/datatrans/web/transaction.rb b/lib/datatrans/web/transaction.rb index 7e45e78..d089c44 100644 --- a/lib/datatrans/web/transaction.rb +++ b/lib/datatrans/web/transaction.rb @@ -24,6 +24,10 @@ def authorize @response.successful? end + def respond_to_missing?(method, *) + response.respond_to?(method.to_sym) || super + end + def method_missing(method, *args, &block) if response.respond_to? method.to_sym response.send(method) diff --git a/lib/datatrans/xml/transaction.rb b/lib/datatrans/xml/transaction.rb index fdf0ef9..36c838e 100644 --- a/lib/datatrans/xml/transaction.rb +++ b/lib/datatrans/xml/transaction.rb @@ -36,6 +36,10 @@ def status # TODO: purchase, credit methods + def respond_to_missing?(method, *) + response.respond_to?(method.to_sym) || request.respond_to?(method.to_sym) || super + end + def method_missing(method, *args, &block) if response.respond_to? method.to_sym response.send(method) diff --git a/lib/datatrans/xml/transaction/status.rb b/lib/datatrans/xml/transaction/status.rb index 2aff4b1..1cf9628 100644 --- a/lib/datatrans/xml/transaction/status.rb +++ b/lib/datatrans/xml/transaction/status.rb @@ -85,12 +85,6 @@ def authorization_code nil end - def authorization_code - params_root_node["response"]["authorizationCode"] - rescue - nil - end - def payment_method params_root_node["response"]["pmethod"] rescue