pagseguro/ruby

View on GitHub
lib/pagseguro/subscription_change_payment/response.rb

Summary

Maintainability
A
20 mins
Test Coverage
module PagSeguro
  class SubscriptionChangePayment
    class Response

      attr_reader :response
      attr_reader :object

      def initialize(response, object)
        @response = response
        @object = object
      end

      def serialize
        unless success?
          object.errors.add response
        end

        object
      end

      def success?
        response.success? && response.xml?
      end
    end
  end
end