Class: PaypalServerSdk::OrderApplicationContext
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::OrderApplicationContext
- Defined in:
- lib/paypal_server_sdk/models/order_application_context.rb
Overview
Customizes the payer experience during the approval process for the payment with PayPal. Note: Partners and Marketplaces might configure brand_name and shipping_preference during partner account setup, which overrides the request values.
Instance Attribute Summary collapse
-
#brand_name ⇒ String
DEPRECATED.
-
#cancel_url ⇒ String
DEPRECATED.
-
#landing_page ⇒ OrderApplicationContextLandingPage
DEPRECATED.
-
#locale ⇒ String
The [language tag](tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions.
-
#payment_method ⇒ PaymentMethodPreference
The customer and merchant payment preferences.
-
#return_url ⇒ String
DEPRECATED.
-
#shipping_preference ⇒ OrderApplicationContextShippingPreference
DEPRECATED.
-
#stored_payment_source ⇒ StoredPaymentSource
Provides additional details to process a payment using a ‘payment_source` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file).
-
#user_action ⇒ OrderApplicationContextUserAction
DEPRECATED.
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(brand_name: SKIP, locale: SKIP, landing_page: OrderApplicationContextLandingPage::NO_PREFERENCE, shipping_preference: OrderApplicationContextShippingPreference::GET_FROM_FILE, user_action: OrderApplicationContextUserAction::CONTINUE, payment_method: SKIP, return_url: SKIP, cancel_url: SKIP, stored_payment_source: SKIP) ⇒ OrderApplicationContext
constructor
A new instance of OrderApplicationContext.
-
#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(brand_name: SKIP, locale: SKIP, landing_page: OrderApplicationContextLandingPage::NO_PREFERENCE, shipping_preference: OrderApplicationContextShippingPreference::GET_FROM_FILE, user_action: OrderApplicationContextUserAction::CONTINUE, payment_method: SKIP, return_url: SKIP, cancel_url: SKIP, stored_payment_source: SKIP) ⇒ OrderApplicationContext
Returns a new instance of OrderApplicationContext.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 138 def initialize( brand_name: SKIP, locale: SKIP, landing_page: OrderApplicationContextLandingPage::NO_PREFERENCE, shipping_preference: OrderApplicationContextShippingPreference::GET_FROM_FILE, user_action: OrderApplicationContextUserAction::CONTINUE, payment_method: SKIP, return_url: SKIP, cancel_url: SKIP, stored_payment_source: SKIP ) @brand_name = brand_name unless brand_name == SKIP @locale = locale unless locale == SKIP @landing_page = landing_page unless landing_page == SKIP @shipping_preference = shipping_preference unless shipping_preference == SKIP @user_action = user_action unless user_action == SKIP @payment_method = payment_method unless payment_method == SKIP @return_url = return_url unless return_url == SKIP @cancel_url = cancel_url unless cancel_url == SKIP @stored_payment_source = stored_payment_source unless stored_payment_source == SKIP end |
Instance Attribute Details
#brand_name ⇒ String
DEPRECATED. The label that overrides the business name in the PayPal account on the PayPal site. The fields in ‘application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.brand_name`). Please specify this field in the `experience_context` object instead of the `application_context` object.
23 24 25 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 23 def brand_name @brand_name end |
#cancel_url ⇒ String
DEPRECATED. The URL where the customer is redirected after the customer cancels the payment. The fields in ‘application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.cancel_url`). Please specify this field in the `experience_context` object instead of the `application_context` object.
88 89 90 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 88 def cancel_url @cancel_url end |
#landing_page ⇒ OrderApplicationContextLandingPage
DEPRECATED. DEPRECATED. The type of landing page to show on the PayPal site for customer checkout. The fields in ‘application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.landing_page`). Please specify this field in the `experience_context` object instead of the `application_context` object.
44 45 46 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 44 def landing_page @landing_page end |
#locale ⇒ String
The [language tag](tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](unstats.un.org/unsd/methodology/m49/).
34 35 36 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 34 def locale @locale end |
#payment_method ⇒ PaymentMethodPreference
The customer and merchant payment preferences.
69 70 71 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 69 def payment_method @payment_method end |
#return_url ⇒ String
DEPRECATED. The URL where the customer is redirected after the customer approves the payment. The fields in ‘application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.return_url`). Please specify this field in the `experience_context` object instead of the `application_context` object.
79 80 81 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 79 def return_url @return_url end |
#shipping_preference ⇒ OrderApplicationContextShippingPreference
DEPRECATED. DEPRECATED. The shipping preference: Displays the shipping address to the customer. Enables the customer to choose an address on the PayPal site. Restricts the customer from changing the address during the payment-approval process. . The fields in ‘application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.shipping_preference`). Please specify this field in the `experience_context` object instead of the `application_context` object.
56 57 58 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 56 def shipping_preference @shipping_preference end |
#stored_payment_source ⇒ StoredPaymentSource
Provides additional details to process a payment using a ‘payment_source` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request.
101 102 103 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 101 def stored_payment_source @stored_payment_source end |
#user_action ⇒ OrderApplicationContextUserAction
DEPRECATED. Configures a Continue or Pay Now checkout flow. The fields in ‘application_context` are now available in the `experience_context` object under the `payment_source` which supports them (eg. `payment_source.paypal.experience_context.user_action`). Please specify this field in the `experience_context` object instead of the `application_context` object.
65 66 67 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 65 def user_action @user_action end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 158 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. brand_name = hash.key?('brand_name') ? hash['brand_name'] : SKIP locale = hash.key?('locale') ? hash['locale'] : SKIP landing_page = hash['landing_page'] ||= OrderApplicationContextLandingPage::NO_PREFERENCE shipping_preference = hash['shipping_preference'] ||= OrderApplicationContextShippingPreference::GET_FROM_FILE user_action = hash['user_action'] ||= OrderApplicationContextUserAction::CONTINUE payment_method = PaymentMethodPreference.from_hash(hash['payment_method']) if hash['payment_method'] return_url = hash.key?('return_url') ? hash['return_url'] : SKIP cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : SKIP stored_payment_source = StoredPaymentSource.from_hash(hash['stored_payment_source']) if hash['stored_payment_source'] # Create object from extracted values. OrderApplicationContext.new(brand_name: brand_name, locale: locale, landing_page: landing_page, shipping_preference: shipping_preference, user_action: user_action, payment_method: payment_method, return_url: return_url, cancel_url: cancel_url, stored_payment_source: stored_payment_source) end |
.names ⇒ Object
A mapping from model property names to API property names.
104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 104 def self.names @_hash = {} if @_hash.nil? @_hash['brand_name'] = 'brand_name' @_hash['locale'] = 'locale' @_hash['landing_page'] = 'landing_page' @_hash['shipping_preference'] = 'shipping_preference' @_hash['user_action'] = 'user_action' @_hash['payment_method'] = 'payment_method' @_hash['return_url'] = 'return_url' @_hash['cancel_url'] = 'cancel_url' @_hash['stored_payment_source'] = 'stored_payment_source' @_hash end |
.nullables ⇒ Object
An array for nullable fields
134 135 136 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 134 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 119 def self.optionals %w[ brand_name locale landing_page shipping_preference user_action payment_method return_url cancel_url stored_payment_source ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
199 200 201 202 203 204 205 206 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 199 def inspect class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name.inspect}, locale: #{@locale.inspect},"\ " landing_page: #{@landing_page.inspect}, shipping_preference:"\ " #{@shipping_preference.inspect}, user_action: #{@user_action.inspect}, payment_method:"\ " #{@payment_method.inspect}, return_url: #{@return_url.inspect}, cancel_url:"\ " #{@cancel_url.inspect}, stored_payment_source: #{@stored_payment_source.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
190 191 192 193 194 195 196 |
# File 'lib/paypal_server_sdk/models/order_application_context.rb', line 190 def to_s class_name = self.class.name.split('::').last "<#{class_name} brand_name: #{@brand_name}, locale: #{@locale}, landing_page:"\ " #{@landing_page}, shipping_preference: #{@shipping_preference}, user_action:"\ " #{@user_action}, payment_method: #{@payment_method}, return_url: #{@return_url},"\ " cancel_url: #{@cancel_url}, stored_payment_source: #{@stored_payment_source}>" end |