Class: PaypalServerSdk::OrderConfirmApplicationContext

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/order_confirm_application_context.rb

Overview

Customizes the payer confirmation experience.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(brand_name: SKIP, locale: SKIP, return_url: SKIP, cancel_url: SKIP, stored_payment_source: SKIP) ⇒ OrderConfirmApplicationContext

Returns a new instance of OrderConfirmApplicationContext.



80
81
82
83
84
85
86
87
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 80

def initialize(brand_name: SKIP, locale: SKIP, return_url: SKIP,
               cancel_url: SKIP, stored_payment_source: SKIP)
  @brand_name = brand_name unless brand_name == SKIP
  @locale = locale unless locale == 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_nameString

Label to present to your payer as part of the PayPal hosted web experience.

Returns:

  • (String)


15
16
17
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 15

def brand_name
  @brand_name
end

#cancel_urlString

The URL where the customer is redirected after the customer cancels the payment.

Returns:

  • (String)


36
37
38
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 36

def cancel_url
  @cancel_url
end

#localeString

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/).

Returns:

  • (String)


26
27
28
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 26

def locale
  @locale
end

#return_urlString

The URL where the customer is redirected after the customer approves the payment.

Returns:

  • (String)


31
32
33
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 31

def return_url
  @return_url
end

#stored_payment_sourceStoredPaymentSource

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).<br/>Parameter compatibility:<br/><ul><li>`payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`.</li><li>`usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`.</li><li>`previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`.</li><li>Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request.</li></ul>

Returns:



51
52
53
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 51

def stored_payment_source
  @stored_payment_source
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 90

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
  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.
  OrderConfirmApplicationContext.new(brand_name: brand_name,
                                     locale: locale,
                                     return_url: return_url,
                                     cancel_url: cancel_url,
                                     stored_payment_source: stored_payment_source)
end

.namesObject

A mapping from model property names to API property names.



54
55
56
57
58
59
60
61
62
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 54

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['brand_name'] = 'brand_name'
  @_hash['locale'] = 'locale'
  @_hash['return_url'] = 'return_url'
  @_hash['cancel_url'] = 'cancel_url'
  @_hash['stored_payment_source'] = 'stored_payment_source'
  @_hash
end

.nullablesObject

An array for nullable fields



76
77
78
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 76

def self.nullables
  []
end

.optionalsObject

An array for optional fields



65
66
67
68
69
70
71
72
73
# File 'lib/paypal_server_sdk/models/order_confirm_application_context.rb', line 65

def self.optionals
  %w[
    brand_name
    locale
    return_url
    cancel_url
    stored_payment_source
  ]
end