Class: MC2P::PayURLMixin

Inherits:
ObjectItemMixin show all
Defined in:
lib/mixins.rb

Overview

Add property to get pay_url based on token

Instance Attribute Summary

Attributes inherited from ObjectItemMixin

#_deleted, #json_dict, #resource

Instance Method Summary collapse

Methods inherited from ObjectItemMixin

#id_required_and_not_deleted, #to_s

Constructor Details

#initialize(json_dict, resource) ⇒ PayURLMixin

Returns a new instance of PayURLMixin.



176
177
178
179
180
# File 'lib/mixins.rb', line 176

def initialize(json_dict, resource)
  super(json_dict, resource)
  @pay_url = 'https://pay.mychoice2pay.com/#/%s'
  @iframe_url = 'https://pay.mychoice2pay.com/#/%s/iframe'
end

Instance Method Details

#iframe_urlObject

Returns: iframe url



189
190
191
192
# File 'lib/mixins.rb', line 189

def iframe_url
  id_required_and_not_deleted
  @iframe_url % @json_dict['token']
end

#pay_urlObject

Returns: pay url



183
184
185
186
# File 'lib/mixins.rb', line 183

def pay_url
  id_required_and_not_deleted
  @pay_url % @json_dict['token']
end