Class: ProcessOut::ApplePayAlternativeMerchantCertificates
- Inherits:
-
Object
- Object
- ProcessOut::ApplePayAlternativeMerchantCertificates
- Defined in:
- lib/processout/apple_pay_alternative_merchant_certificates.rb
Instance Attribute Summary collapse
-
#alternative_merchant_certificates ⇒ Object
Returns the value of attribute alternative_merchant_certificates.
Instance Method Summary collapse
-
#fetch(options = {}) ⇒ Object
- Fetch the project’s alternative certificates by ID Params:
options -
Hashof options.
- Fetch the project’s alternative certificates by ID Params:
-
#fill_with_data(data) ⇒ Object
- Fills the object with data coming from the API Params:
data -
Hashof data coming from the API.
- Fills the object with data coming from the API Params:
-
#initialize(client, data = {}) ⇒ ApplePayAlternativeMerchantCertificates
constructor
- Initializes the ApplePayAlternativeMerchantCertificates object Params:
client ProcessOutclient instancedata-
data that can be used to fill the object.
- Initializes the ApplePayAlternativeMerchantCertificates object Params:
-
#new(data = {}) ⇒ Object
Create a new ApplePayAlternativeMerchantCertificates using the current client.
-
#prefill(data) ⇒ Object
- Prefills the object with the data passed as parameters Params:
data -
Hashof data.
- Prefills the object with the data passed as parameters Params:
-
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want.
Constructor Details
#initialize(client, data = {}) ⇒ ApplePayAlternativeMerchantCertificates
Initializes the ApplePayAlternativeMerchantCertificates object Params:
client-
ProcessOutclient instance data-
data that can be used to fill the object
39 40 41 42 43 44 |
# File 'lib/processout/apple_pay_alternative_merchant_certificates.rb', line 39 def initialize(client, data = {}) @client = client self.alternative_merchant_certificates = data.fetch(:alternative_merchant_certificates, nil) end |
Instance Attribute Details
#alternative_merchant_certificates ⇒ Object
Returns the value of attribute alternative_merchant_certificates.
11 12 13 |
# File 'lib/processout/apple_pay_alternative_merchant_certificates.rb', line 11 def alternative_merchant_certificates @alternative_merchant_certificates end |
Instance Method Details
#fetch(options = {}) ⇒ Object
Fetch the project’s alternative certificates by ID Params:
options-
Hashof options
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/processout/apple_pay_alternative_merchant_certificates.rb', line 87 def fetch( = {}) self.prefill() request = Request.new(@client) path = "/projects/applepay/alternative-merchant-certificates" data = { } response = Response.new(request.get(path, data, )) return_values = Array.new body = response.body body = body["applepay_certificates"] apple_pay_alternative_merchant_certificates = ApplePayAlternativeMerchantCertificates.new(@client) return_values.push(apple_pay_alternative_merchant_certificates.fill_with_data(body)) return_values[0] end |
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
data-
Hashof data coming from the API
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/processout/apple_pay_alternative_merchant_certificates.rb', line 61 def fill_with_data(data) if data.nil? return self end if data.include? "alternative_merchant_certificates" self.alternative_merchant_certificates = data["alternative_merchant_certificates"] end self end |
#new(data = {}) ⇒ Object
Create a new ApplePayAlternativeMerchantCertificates using the current client
47 48 49 |
# File 'lib/processout/apple_pay_alternative_merchant_certificates.rb', line 47 def new(data = {}) ApplePayAlternativeMerchantCertificates.new(@client, data) end |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data-
Hashof data
75 76 77 78 79 80 81 82 |
# File 'lib/processout/apple_pay_alternative_merchant_certificates.rb', line 75 def prefill(data) if data.nil? return self end self.alternative_merchant_certificates = data.fetch(:alternative_merchant_certificates, self.alternative_merchant_certificates) self end |
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want
52 53 54 55 56 |
# File 'lib/processout/apple_pay_alternative_merchant_certificates.rb', line 52 def to_json() { "alternative_merchant_certificates": self.alternative_merchant_certificates, }.to_json end |