class UltracartClient::PaymentsConfigurationPayPal
Attributes
Master flag that determine if PayPal is an active payment for this account
Optional accounting code that is set to Quickbooks when an order uses this payment method.
PayPal API password
PayPal API username
(Legacy) true if there is a PayPal certificate already on file. Used to manage the internal UI
The account to deposit funds
The main PayPal email address
PayPal configuration, live or sandbox
The URL for the PayPal header
True if the Bill Me Later button should be hidden during checkout
True if the PayPal express checkout button should be hidden on the view cart page. This will force the customer to enter address information before being able to checkout with PayPal
True if PayPal should be hidden for orders with no shippable product, such as digital orders
If true, PayPal orders are held in Accounts Receivable for review
PayPal landing page
The PayPal mode
PayPal API private key password
Optional additional fee to charge if PayPal is used. It is rare for this to be used.
The processing percentage charged by PayPal
True if the internal UI should recommend opening a PayPal account
True if UltraCart should send recurring orders to PayPal. There are restrictions to what PayPal will accept for recurring orders. Be careful.
Short marketing text
internal ui flag
Internal flag used to manage UI
PayPal signature
PayPal solution type
The email where PayPal summaries should be sent
Description of what mode PayPal is operating
Send free items to PayPal as one cent items and subtract this penny from shipping. PayPal does not allow the sale of free items.
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 126 def self.attribute_map { :'accept_paypal' => :'accept_paypal', :'accounting_code' => :'accounting_code', :'api_password' => :'api_password', :'api_username' => :'api_username', :'certificate_on_file' => :'certificate_on_file', :'deposit_to_account' => :'deposit_to_account', :'email' => :'email', :'environment' => :'environment', :'header_image_url' => :'header_image_url', :'hide_bill_me_later' => :'hide_bill_me_later', :'hide_express_checkout_on_view_cart' => :'hide_express_checkout_on_view_cart', :'hide_for_unshipped_orders' => :'hide_for_unshipped_orders', :'hold_in_ar' => :'hold_in_ar', :'landing_page' => :'landing_page', :'mode' => :'mode', :'private_key_password' => :'private_key_password', :'processing_fee' => :'processing_fee', :'processing_percentage' => :'processing_percentage', :'push_paypal' => :'push_paypal', :'restrictions' => :'restrictions', :'send_recurring' => :'send_recurring', :'short_paypal_marketing_text' => :'short_paypal_marketing_text', :'show_card_logos_not_directly_supported' => :'show_card_logos_not_directly_supported', :'show_signature' => :'show_signature', :'signature' => :'signature', :'solution_type' => :'solution_type', :'summary_email' => :'summary_email', :'summary_mode' => :'summary_mode', :'zero_dollar_penny' => :'zero_dollar_penny' } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 197 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'accept_paypal') self.accept_paypal = attributes[:'accept_paypal'] end if attributes.has_key?(:'accounting_code') self.accounting_code = attributes[:'accounting_code'] end if attributes.has_key?(:'api_password') self.api_password = attributes[:'api_password'] end if attributes.has_key?(:'api_username') self.api_username = attributes[:'api_username'] end if attributes.has_key?(:'certificate_on_file') self.certificate_on_file = attributes[:'certificate_on_file'] end if attributes.has_key?(:'deposit_to_account') self.deposit_to_account = attributes[:'deposit_to_account'] end if attributes.has_key?(:'email') self.email = attributes[:'email'] end if attributes.has_key?(:'environment') self.environment = attributes[:'environment'] end if attributes.has_key?(:'header_image_url') self.header_image_url = attributes[:'header_image_url'] end if attributes.has_key?(:'hide_bill_me_later') self.hide_bill_me_later = attributes[:'hide_bill_me_later'] end if attributes.has_key?(:'hide_express_checkout_on_view_cart') self.hide_express_checkout_on_view_cart = attributes[:'hide_express_checkout_on_view_cart'] end if attributes.has_key?(:'hide_for_unshipped_orders') self.hide_for_unshipped_orders = attributes[:'hide_for_unshipped_orders'] end if attributes.has_key?(:'hold_in_ar') self.hold_in_ar = attributes[:'hold_in_ar'] end if attributes.has_key?(:'landing_page') self.landing_page = attributes[:'landing_page'] end if attributes.has_key?(:'mode') self.mode = attributes[:'mode'] end if attributes.has_key?(:'private_key_password') self.private_key_password = attributes[:'private_key_password'] end if attributes.has_key?(:'processing_fee') self.processing_fee = attributes[:'processing_fee'] end if attributes.has_key?(:'processing_percentage') self.processing_percentage = attributes[:'processing_percentage'] end if attributes.has_key?(:'push_paypal') self.push_paypal = attributes[:'push_paypal'] end if attributes.has_key?(:'restrictions') self.restrictions = attributes[:'restrictions'] end if attributes.has_key?(:'send_recurring') self.send_recurring = attributes[:'send_recurring'] end if attributes.has_key?(:'short_paypal_marketing_text') self.short_paypal_marketing_text = attributes[:'short_paypal_marketing_text'] end if attributes.has_key?(:'show_card_logos_not_directly_supported') self.show_card_logos_not_directly_supported = attributes[:'show_card_logos_not_directly_supported'] end if attributes.has_key?(:'show_signature') self.show_signature = attributes[:'show_signature'] end if attributes.has_key?(:'signature') self.signature = attributes[:'signature'] end if attributes.has_key?(:'solution_type') self.solution_type = attributes[:'solution_type'] end if attributes.has_key?(:'summary_email') self.summary_email = attributes[:'summary_email'] end if attributes.has_key?(:'summary_mode') self.summary_mode = attributes[:'summary_mode'] end if attributes.has_key?(:'zero_dollar_penny') self.zero_dollar_penny = attributes[:'zero_dollar_penny'] end end
Attribute type mapping.
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 161 def self.swagger_types { :'accept_paypal' => :'BOOLEAN', :'accounting_code' => :'String', :'api_password' => :'String', :'api_username' => :'String', :'certificate_on_file' => :'BOOLEAN', :'deposit_to_account' => :'String', :'email' => :'String', :'environment' => :'String', :'header_image_url' => :'String', :'hide_bill_me_later' => :'BOOLEAN', :'hide_express_checkout_on_view_cart' => :'BOOLEAN', :'hide_for_unshipped_orders' => :'BOOLEAN', :'hold_in_ar' => :'BOOLEAN', :'landing_page' => :'String', :'mode' => :'String', :'private_key_password' => :'String', :'processing_fee' => :'Float', :'processing_percentage' => :'Float', :'push_paypal' => :'BOOLEAN', :'restrictions' => :'PaymentsConfigurationRestrictions', :'send_recurring' => :'BOOLEAN', :'short_paypal_marketing_text' => :'BOOLEAN', :'show_card_logos_not_directly_supported' => :'BOOLEAN', :'show_signature' => :'BOOLEAN', :'signature' => :'String', :'solution_type' => :'String', :'summary_email' => :'String', :'summary_mode' => :'String', :'zero_dollar_penny' => :'BOOLEAN' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 383 def ==(o) return true if self.equal?(o) self.class == o.class && accept_paypal == o.accept_paypal && accounting_code == o.accounting_code && api_password == o.api_password && api_username == o.api_username && certificate_on_file == o.certificate_on_file && deposit_to_account == o.deposit_to_account && email == o.email && environment == o.environment && header_image_url == o.header_image_url && hide_bill_me_later == o.hide_bill_me_later && hide_express_checkout_on_view_cart == o.hide_express_checkout_on_view_cart && hide_for_unshipped_orders == o.hide_for_unshipped_orders && hold_in_ar == o.hold_in_ar && landing_page == o.landing_page && mode == o.mode && private_key_password == o.private_key_password && processing_fee == o.processing_fee && processing_percentage == o.processing_percentage && push_paypal == o.push_paypal && restrictions == o.restrictions && send_recurring == o.send_recurring && short_paypal_marketing_text == o.short_paypal_marketing_text && show_card_logos_not_directly_supported == o.show_card_logos_not_directly_supported && show_signature == o.show_signature && signature == o.signature && solution_type == o.solution_type && summary_email == o.summary_email && summary_mode == o.summary_mode && zero_dollar_penny == o.zero_dollar_penny end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 453 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = UltracartClient.const_get(type).new temp_model.build_from_hash(value) end end
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 519 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 432 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end
Custom attribute writer method checking allowed values (enum). @param [Object] environment Object to be assigned
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 343 def environment=(environment) validator = EnumAttributeValidator.new('String', ['Live', 'Sandbox']) unless validator.valid?(environment) fail ArgumentError, 'invalid value for "environment", must be one of #{validator.allowable_values}.' end @environment = environment end
@see the `==` method @param [Object] Object to be compared
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 419 def eql?(o) self == o end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 425 def hash [accept_paypal, accounting_code, api_password, api_username, certificate_on_file, deposit_to_account, email, environment, header_image_url, hide_bill_me_later, hide_express_checkout_on_view_cart, hide_for_unshipped_orders, hold_in_ar, landing_page, mode, private_key_password, processing_fee, processing_percentage, push_paypal, restrictions, send_recurring, short_paypal_marketing_text, show_card_logos_not_directly_supported, show_signature, signature, solution_type, summary_email, summary_mode, zero_dollar_penny].hash end
Custom attribute writer method checking allowed values (enum). @param [Object] landing_page
Object to be assigned
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 353 def landing_page=(landing_page) validator = EnumAttributeValidator.new('String', ['Billing', 'Login']) unless validator.valid?(landing_page) fail ArgumentError, 'invalid value for "landing_page", must be one of #{validator.allowable_values}.' end @landing_page = landing_page end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 322 def list_invalid_properties invalid_properties = Array.new invalid_properties end
Custom attribute writer method checking allowed values (enum). @param [Object] mode Object to be assigned
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 363 def mode=(mode) validator = EnumAttributeValidator.new('String', ['WPPECO', 'WPPECDP']) unless validator.valid?(mode) fail ArgumentError, 'invalid value for "mode", must be one of #{validator.allowable_values}.' end @mode = mode end
Custom attribute writer method checking allowed values (enum). @param [Object] solution_type
Object to be assigned
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 373 def solution_type=(solution_type) validator = EnumAttributeValidator.new('String', ['Sole', 'Mark']) unless validator.valid?(solution_type) fail ArgumentError, 'invalid value for "solution_type", must be one of #{validator.allowable_values}.' end @solution_type = solution_type end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 505 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
Returns the string representation of the object @return [String] String presentation of the object
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 493 def to_s to_hash.to_s end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/ultracart_api/models/payments_configuration_pay_pal.rb, line 329 def valid? environment_validator = EnumAttributeValidator.new('String', ['Live', 'Sandbox']) return false unless environment_validator.valid?(@environment) landing_page_validator = EnumAttributeValidator.new('String', ['Billing', 'Login']) return false unless landing_page_validator.valid?(@landing_page) mode_validator = EnumAttributeValidator.new('String', ['WPPECO', 'WPPECDP']) return false unless mode_validator.valid?(@mode) solution_type_validator = EnumAttributeValidator.new('String', ['Sole', 'Mark']) return false unless solution_type_validator.valid?(@solution_type) true end