This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env ruby | |
| require 'time' | |
| require 'thread' | |
| require 'optparse' | |
| require 'rubygems' | |
| require 'aerospike' | |
| include Aerospike | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | devices.each do |device_data| | |
| device = Device.create!(name: device_data[:name], platform: device_data[:platform], audio: device_data[:audio], bluetooth: device_data[:bluetooth]) | |
| device_data[:countries].each do |country| | |
| device.availabilities << Availability.create!( | |
| pinplus: device_data[:pinplus], | |
| chipsig: device_data[:chipsig], | |
| country: Country.find_by_code(country) | |
| ) | |
| end | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class AvaiableCountry < ActiveRecord::Base | |
| has_many :device_compatibilities | |
| end | |
| class device_compatibility < ActiveRecord::Base | |
| belongs_to :available_country | |
| end | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "id": ..., | |
| "customer_email": ..., | |
| "customer_mobile_phone": ..., | |
| "paid_out_at": ..., | |
| "merchant_id": ..., | |
| "total_fee": ..., | |
| "tax_enabled": ..., | |
| "emv_data": ..., | |
| "product_summary": ... | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "amount": 1.5, | |
| "branding": {}, | |
| "card": { | |
| "card_type": "cc", | |
| "last_4_digits": "5384", | |
| "masked_number": "**** **** **** 5384", | |
| "scheme": "VISA", | |
| "scheme_keyword": "VISA" | |
| }, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "amount": 1.5, | |
| "card": { | |
| "card_type": "cc", | |
| "last_4_digits": "0000", | |
| "masked_number": "**** **** **** 0000", | |
| "scheme": "VISA", | |
| "scheme_keyword": "VISA" | |
| }, | |
| "currency": "BRL", | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "amount": 1.5, | |
| "card": { | |
| "card_type": "cc", | |
| "last_4_digits": "0000", | |
| "masked_number": "**** **** **** 0000", | |
| "scheme": "VISA", | |
| "scheme_keyword": "VISA" | |
| }, | |
| "currency": "BRL", | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'gmail' | |
| require 'rails' | |
| # Sets the log path | |
| Rails.logger = Logger.new File.expand_path('../../log/fetcher.log', __FILE__) | |
| # Makes sure the cron is set | |
| Rails.logger.info("Gmail fetcher initialized at #{Time.now}.") | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | module ContentfulAPI | |
| class Sync | |
| def self.sync(access_token) | |
| # Send HTTP call to Contentful API with the given access_token | |
| # Contentful will response with a JSON array | |
| response.inject([]) do |memo, response_item| | |
| memo << self.parse(response_item); memo | |
| end | |
| end | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function NameSpace = function() { | |
| var fun = function() { | |
| } | |
| } | |
| NameSpace.fun() | 
NewerOlder