Class: CyberSourceMergedSpec::CustomRedirectUrls
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::CustomRedirectUrls
- Defined in:
- lib/cyber_source_merged_spec/models/custom_redirect_urls.rb
Overview
Object containing custom redirect URLs for different payment outcomes. Each property allows specifying a URL to which the customer will be redirected after a payment event.
Instance Attribute Summary collapse
-
#payment_accepted ⇒ String
URL to redirect the customer after a successful payment.
-
#payment_pending ⇒ String
URL to redirect the customer after a payment is pending.
-
#payment_rejected ⇒ String
URL to redirect the customer after a payment is rejected.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.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(payment_accepted: SKIP, payment_rejected: SKIP, payment_pending: SKIP, additional_properties: nil) ⇒ CustomRedirectUrls
constructor
A new instance of CustomRedirectUrls.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ 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(payment_accepted: SKIP, payment_rejected: SKIP, payment_pending: SKIP, additional_properties: nil) ⇒ CustomRedirectUrls
Returns a new instance of CustomRedirectUrls.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 52 def initialize(payment_accepted: SKIP, payment_rejected: SKIP, payment_pending: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @payment_accepted = payment_accepted unless payment_accepted == SKIP @payment_rejected = payment_rejected unless payment_rejected == SKIP @payment_pending = payment_pending unless payment_pending == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#payment_accepted ⇒ String
URL to redirect the customer after a successful payment. If not provided, the default page and message will be shown.
17 18 19 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 17 def payment_accepted @payment_accepted end |
#payment_pending ⇒ String
URL to redirect the customer after a payment is pending. If not provided, the default page and message will be shown.
27 28 29 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 27 def payment_pending @payment_pending end |
#payment_rejected ⇒ String
URL to redirect the customer after a payment is rejected. If not provided, the default page and message will be shown.
22 23 24 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 22 def payment_rejected @payment_rejected end |
Class Method Details
.from_element(root) ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 89 def self.from_element(root) payment_accepted = XmlUtilities.from_element(root, 'paymentAccepted', String) payment_rejected = XmlUtilities.from_element(root, 'paymentRejected', String) payment_pending = XmlUtilities.from_element(root, 'paymentPending', String) new(payment_accepted: payment_accepted, payment_rejected: payment_rejected, payment_pending: payment_pending, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. payment_accepted = hash.key?('paymentAccepted') ? hash['paymentAccepted'] : SKIP payment_rejected = hash.key?('paymentRejected') ? hash['paymentRejected'] : SKIP payment_pending = hash.key?('paymentPending') ? hash['paymentPending'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. CustomRedirectUrls.new(payment_accepted: payment_accepted, payment_rejected: payment_rejected, payment_pending: payment_pending, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['payment_accepted'] = 'paymentAccepted' @_hash['payment_rejected'] = 'paymentRejected' @_hash['payment_pending'] = 'paymentPending' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 48 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 39 def self.optionals %w[ payment_accepted payment_rejected payment_pending ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
127 128 129 130 131 132 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 127 def inspect class_name = self.class.name.split('::').last "<#{class_name} payment_accepted: #{@payment_accepted.inspect}, payment_rejected:"\ " #{@payment_rejected.inspect}, payment_pending: #{@payment_pending.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
119 120 121 122 123 124 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 119 def to_s class_name = self.class.name.split('::').last "<#{class_name} payment_accepted: #{@payment_accepted}, payment_rejected:"\ " #{@payment_rejected}, payment_pending: #{@payment_pending}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/cyber_source_merged_spec/models/custom_redirect_urls.rb', line 103 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'paymentAccepted', payment_accepted) XmlUtilities.add_as_subelement(doc, root, 'paymentRejected', payment_rejected) XmlUtilities.add_as_subelement(doc, root, 'paymentPending', payment_pending) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |