Class: MC2P::PayData

Inherits:
ReadOnlyObjectItem show all
Defined in:
lib/objects.rb

Overview

PayData object

Instance Attribute Summary

Attributes inherited from ObjectItemMixin

#_deleted, #json_dict, #resource

Instance Method Summary collapse

Methods inherited from ReadOnlyObjectItem

get, #retrieve

Methods inherited from ObjectItem

#method_missing, #respond_to?, #respond_to_missing?, #set

Methods inherited from ObjectItemMixin

#id_required_and_not_deleted, #to_s

Constructor Details

#initialize(json_dict, resource) ⇒ PayData

Initializes an object item Params:

json_dict

Data of the object

resource

Resource used to delete, save, create or retrieve the object



128
129
130
131
# File 'lib/objects.rb', line 128

def initialize(json_dict, resource)
  super(json_dict, resource, 'token')
  @cs_mixin = CardShareObjectItemMixin.new(json_dict, resource, 'token')
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MC2P::ObjectItem

Instance Method Details

#card(gateway_code, data = nil) ⇒ Object

Send card details Params:

gateway_code

gateway_code to send

data

data to send

Returns: response dictionary



138
139
140
141
142
143
144
# File 'lib/objects.rb', line 138

def card(gateway_code, data = nil)
  @cs_mixin.json_dict = @json_dict
  @cs_mixin._deleted = @_deleted
  @cs_mixin.card(gateway_code, data)
  @json_dict = @cs_mixin.json_dict
  @_deleted = @cs_mixin._deleted
end

#share(data = nil) ⇒ Object

Send share details Params:

data

data to send

Returns: response dictionary



150
151
152
153
154
155
156
# File 'lib/objects.rb', line 150

def share(data = nil)
  @cs_mixin.json_dict = @json_dict
  @cs_mixin._deleted = @_deleted
  @cs_mixin.share(data)
  @json_dict = @cs_mixin.json_dict
  @_deleted = @cs_mixin._deleted
end