This file contains 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
# before | |
<%= form.fields_for :desc_translations do |trans_field| %> | |
<div class="col-md-5"> | |
<%= trans_field.text_area :de, :value => form.object.desc_translations[:de], :class => 'form-control', :required => true %> | |
<div class="help-block with-errors"></div> | |
</div> | |
<div class="col-md-5"> | |
<%= trans_field.text_area :'zh-CN', :value => form.object.desc_translations[:'zh-CN'], :class => 'form-control', :required => true %> | |
<div class="help-block with-errors"></div> | |
</div> |
This file contains 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
defmodule FeedApi.Utils.Feeder do | |
@doc """ | |
We try to get the tweets from the timeline of the user | |
It will fetch all the needed entry and return them into an array | |
""" | |
def feed! do | |
from_twitter! | |
end |
This file contains 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
defmodule FeedApi.Utils.Feeder do | |
@doc """ | |
We try to get the tweets from the timeline of the user | |
It will fetch all the needed entry and return them into an array | |
""" | |
def feed!, do: from_twitter! | |
def from_twitter! do | |
FeedApi.Scrappers.Twitter.dispatch! |> fetch! |
This file contains 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
require 'cgi' | |
# Get notifications from Wirecard when a transaction has been done | |
class Api::Webhook::Wirecard::CustomersController < Api::ApplicationController | |
skip_before_filter :verify_authenticity_token | |
WIRECARD_CONFIG = Rails.application.config.wirecard | |
REQUEST_ID_TRIM = %w(-check-enrollment) |
This file contains 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
require 'cgi' | |
# Get notifications from Wirecard when a transaction has been done | |
class Api::Webhook::Wirecard::CustomersController < Api::ApplicationController | |
skip_before_filter :verify_authenticity_token | |
WIRECARD_CONFIG = Rails.application.config.wirecard | |
REQUEST_ID_TRIM = %w(-check-enrollment) |
This file contains 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
# webhook communication with Wirecard. | |
# any communication with Wirecard from server to server linked to the merchant / shopkeeper | |
# such as `wirecard_status` to activate their payment account is under this controller. | |
class Api::Webhook::Wirecard::MerchantsController < Api::ApplicationController | |
WIRECARD_CONFIG = Rails.application.config.wirecard | |
CREDENTIALS_PAYMENT_METHODS = { | |
:creditcard => [:ee_maid_cc, :ee_secret_cc], | |
:upop => [:ee_maid_cup, :ee_secret_cup], | |
:paypal => [:ee_maid_paypal, :ee_secret_paypal] |
This file contains 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 Customer::Checkout::Callback::WirecardController < ApplicationController | |
authorize_resource :class => false | |
layout :default_layout | |
protect_from_forgery :except => [:success, :fail, :cancel, :processing] | |
def success | |
callback = checkout_callback.wirecard! | |
unless callback.success? | |
SlackDispatcher.new.message("[Exception] Error checkout callback #{callback.error}") |
This file contains 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
/** | |
* Charts Class | |
*/ | |
var Charts = { | |
/** | |
* Initializer | |
*/ | |
init: function() { |
This file contains 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
def perform | |
if requests[request] | |
requests[request].response | |
end | |
# if requests.map(&:keys).include? request | |
# # it's a match | |
# end | |
end | |
def subclasses(target) |
This file contains 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 WechatBot | |
class Exchange < Base | |
class Qrcode < Base | |
def request | |
'二维码' | |
end | |
# this is not the best way at a performance level because it accepts #request and then cancel it via a false if the user is not referrer | |
# best is to control this from the #request itself and return nil. The result is the same tho. | |
# WE KEPT THIS AS A GOOD EXAMPLE |