Class: PayPal::ExpressCheckout::Response::Profile

Inherits:
Base
  • Object
show all
Defined in:
lib/paypal/express_checkout/response/profile.rb

Constant Summary collapse

OUTSTANDING =
{
  "AddToNextBilling"    => :next_billing,
  "NoAutoBill"          => :no_auto_bill
}
STATUS =
{
  "Cancelled"           => :cancelled,
  "Active"              => :active,
  "Suspended"           => :suspended
}
PERIOD =
{
  "Month"               => :monthly,
  "Weekly"              => :weekly,
  "Year"                => :yearly,
  "Day"                 => :daily
}

Constants included from Fields

Fields::ASSOCIATIONS, Fields::ATTRIBUTES

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#build_association, #build_billings, #build_fmfs, #build_payment_items, #build_payments, #build_shipping_options, #build_values, #errors, #initialize, #params, #success?, #valid?

Methods included from Utils

#convert_to_time, #mapping

Methods included from Fields

#field_map, #group_collect, #group_fields, #has_fields?, #has_many?, included, #inverted_field_map

Constructor Details

This class inherits a constructor from PayPal::ExpressCheckout::Response::Base

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/paypal/express_checkout/response/profile.rb', line 25

def active?
  status == :active
end

#build_auto_bill_outstanding(value) ⇒ Object



29
30
31
# File 'lib/paypal/express_checkout/response/profile.rb', line 29

def build_auto_bill_outstanding(value)
  OUTSTANDING.fetch(value, value)
end

#build_date(string) ⇒ Object Also known as: build_start_at, build_last_payment_date



37
38
39
# File 'lib/paypal/express_checkout/response/profile.rb', line 37

def build_date(string)
  Time.parse(string)
end

#build_period(value) ⇒ Object



49
50
51
# File 'lib/paypal/express_checkout/response/profile.rb', line 49

def build_period(value)
  PERIOD.fetch(value, value)
end

#build_status(value) ⇒ Object



33
34
35
# File 'lib/paypal/express_checkout/response/profile.rb', line 33

def build_status(value)
  STATUS.fetch(value, value)
end