Class: Worldline::Acquiring::SDK::Domain::DataObject

Inherits:
Object
  • Object
show all
Defined in:
lib/worldline/acquiring/sdk/domain/data_object.rb

Overview

Base class for all SDK data objects, supports marshalling and unmarshalling the data object to and from JSON.

Direct Known Subclasses

Communication::MetadataProvider::ServerMetaInfo, ShoppingCartExtension, V1::Domain::AddressVerificationData, V1::Domain::AmountData, V1::Domain::ApiAccountVerificationRequest, V1::Domain::ApiAccountVerificationResponse, V1::Domain::ApiActionResponse, V1::Domain::ApiActionResponseForRefund, V1::Domain::ApiBalanceInquiryRequest, V1::Domain::ApiBalanceInquiryResponse, V1::Domain::ApiCaptureRequest, V1::Domain::ApiCaptureRequestForRefund, V1::Domain::ApiIncrementRequest, V1::Domain::ApiPaymentErrorResponse, V1::Domain::ApiPaymentRefundRequest, V1::Domain::ApiPaymentRequest, V1::Domain::ApiPaymentResource, V1::Domain::ApiPaymentResponse, V1::Domain::ApiPaymentReversalRequest, V1::Domain::ApiPaymentSummaryForResponse, V1::Domain::ApiReferencesForResponses, V1::Domain::ApiRefundRequest, V1::Domain::ApiRefundResource, V1::Domain::ApiRefundResponse, V1::Domain::ApiRefundSummaryForResponse, V1::Domain::ApiTechnicalReversalRequest, V1::Domain::ApiTechnicalReversalResponse, V1::Domain::CardDataForDcc, V1::Domain::CardOnFileData, V1::Domain::CardPaymentData, V1::Domain::CardPaymentDataForBalanceInquiry, V1::Domain::CardPaymentDataForRefund, V1::Domain::CardPaymentDataForResource, V1::Domain::CardPaymentDataForResponse, V1::Domain::CardPaymentDataForVerification, V1::Domain::DccData, V1::Domain::DccProposal, V1::Domain::ECommerceData, V1::Domain::ECommerceDataForAccountVerification, V1::Domain::ECommerceDataForResponse, V1::Domain::EmvDataItem, V1::Domain::GetDCCRateRequest, V1::Domain::GetDccRateResponse, V1::Domain::InitialCardOnFileData, V1::Domain::MerchantData, V1::Domain::NetworkTokenData, V1::Domain::PaymentReferences, V1::Domain::PlainCardData, V1::Domain::PointOfSaleData, V1::Domain::PointOfSaleDataForDcc, V1::Domain::PointOfSaleDataForResponse, V1::Domain::RateData, V1::Domain::SubOperation, V1::Domain::SubOperationForRefund, V1::Domain::SubsequentCardOnFileData, V1::Domain::TerminalData, V1::Domain::ThreeDSecure, V1::Domain::TransactionDataForDcc

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new_from_hash(hash) ⇒ Object

Create a new instance of this object (DataObject or descendant) from a hash containing attribute values in camelCase. Note that the hash contains Strings as keys instead of more commonly used tokens.



20
21
22
23
24
# File 'lib/worldline/acquiring/sdk/domain/data_object.rb', line 20

def self.new_from_hash(hash)
  obj = self.new
  obj.from_hash(hash)
  obj
end

Instance Method Details

#from_hash(hash) ⇒ Object

Set attributes from values in parameter hash. Should be overridden by descendants in order to properly restore their attributes from the hash. Note that the hash contains Strings as keys instead of more commonly used tokens.



29
# File 'lib/worldline/acquiring/sdk/domain/data_object.rb', line 29

def from_hash(hash) end

#to_hHash

Returns a hash representation of the DataObject. The hash contains camelCase representations of the variables, and their values. Should be overridden to add all instance variables of the object.

Returns:

  • (Hash)


13
14
15
# File 'lib/worldline/acquiring/sdk/domain/data_object.rb', line 13

def to_h
  {}
end