Class: PaypalServerSdk::SubscriberRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::SubscriberRequest
- Defined in:
- lib/paypal_server_sdk/models/subscriber_request.rb
Overview
The subscriber request information .
Instance Attribute Summary collapse
-
#name ⇒ Name
The name of the party.
-
#payment_source ⇒ SubscriptionPaymentSource
The payment source definition.
-
#phone ⇒ PhoneWithType
The phone information.
-
#shipping_address ⇒ ShippingDetails
The shipping details.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(name: SKIP, phone: SKIP, shipping_address: SKIP, payment_source: SKIP) ⇒ SubscriberRequest
constructor
A new instance of SubscriberRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(name: SKIP, phone: SKIP, shipping_address: SKIP, payment_source: SKIP) ⇒ SubscriberRequest
Returns a new instance of SubscriberRequest.
56 57 58 59 60 61 62 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 56 def initialize(name: SKIP, phone: SKIP, shipping_address: SKIP, payment_source: SKIP) @name = name unless name == SKIP @phone = phone unless phone == SKIP @shipping_address = shipping_address unless shipping_address == SKIP @payment_source = payment_source unless payment_source == SKIP end |
Instance Attribute Details
#name ⇒ Name
The name of the party.
14 15 16 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 14 def name @name end |
#payment_source ⇒ SubscriptionPaymentSource
The payment source definition. To be eligible to create subscription using debit or credit card, you will need to sign up here (www.paypal.com/bizsignup/entry/product/ppcp). Please note, its available only for non-3DS cards and for merchants in US and AU regions.
29 30 31 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 29 def payment_source @payment_source end |
#phone ⇒ PhoneWithType
The phone information.
18 19 20 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 18 def phone @phone end |
#shipping_address ⇒ ShippingDetails
The shipping details.
22 23 24 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 22 def shipping_address @shipping_address end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = Name.from_hash(hash['name']) if hash['name'] phone = PhoneWithType.from_hash(hash['phone']) if hash['phone'] shipping_address = ShippingDetails.from_hash(hash['shipping_address']) if hash['shipping_address'] payment_source = SubscriptionPaymentSource.from_hash(hash['payment_source']) if hash['payment_source'] # Create object from extracted values. SubscriberRequest.new(name: name, phone: phone, shipping_address: shipping_address, payment_source: payment_source) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 39 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['phone'] = 'phone' @_hash['shipping_address'] = 'shipping_address' @_hash['payment_source'] = 'payment_source' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
42 43 44 45 46 47 48 49 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 42 def self.optionals %w[ name phone shipping_address payment_source ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
91 92 93 94 95 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 91 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, phone: #{@phone.inspect}, shipping_address:"\ " #{@shipping_address.inspect}, payment_source: #{@payment_source.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
84 85 86 87 88 |
# File 'lib/paypal_server_sdk/models/subscriber_request.rb', line 84 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, phone: #{@phone}, shipping_address: #{@shipping_address},"\ " payment_source: #{@payment_source}>" end |