Sha256: 40432b65b233e7c388163aa7968111c0058ca0125e3f6fc11f7d2ee969be5d4e

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class PaypalExpressNvResponse < Response
      def email
        @params['email']
      end

      def name
        [@params['firstname'], @params['middlename'], @params['lastname']].compact.join(' ')
      end

      def token
        @params['token']
      end

      def payer_id
        @params['payerid']
      end

      def payer_country
        @params['payer_country']
      end

      def complete?
        @params['paymentstatus'] == "Completed"
      end

      def address
        {  'name'       => self.name,
           'company'    => @params['business'],
           'address1'   => @params['shiptostreet'],
           'address2'   => @params['shiptostreet2'],
           'city'       => @params['shiptocity'],
           'state'      => @params['shiptostate'],
           'country'    => @params['shiptocountrycode'],
           'zip'        => @params['shiptozip'],
           'phone'      => @params['phonenum'],
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
martinstannard-activemerchant-0.1.0 lib/active_merchant/billing/gateways/paypal_nv/paypal_express_nv_response.rb