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
module Tire | |
module Model | |
# Main module containing the infrastructure for automatic updating | |
# of the _ElasticSearch_ index on model instance create, update or delete. | |
# | |
# Include it in your model: `include Tire::Model::Callbacks` | |
# | |
# The model must respond to `after_save` and `after_destroy` callbacks | |
# (ActiveModel and ActiveRecord models do so, by default). |
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
module Sidekiq | |
module Extensions | |
module Klass | |
def delay_until_reasonable(options = {}) | |
reasonable_time = case Time.now.hour | |
when 0..7 | |
Time.now.change(hour: 8) | |
when 22..24 | |
Date.tomorrow.to_time.change(hour: 8) | |
else |
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
worker: QUEUE=* bundle exec rake environment resque:work | |
scheduler: bundle exec rake environment resque:scheduler |
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
https = require('https'); | |
var payload = { | |
amount: 1000, | |
card_holder: "Mark Smith", | |
card_number: "5123456789012346", | |
card_expiry: "05/2013", | |
cvv: "123", | |
customer_ip: "123.4.5.6", | |
reference: "NODE" + Math.random() |
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
<form action="https://gateway.sandbox.fatzebra.com.au/v1.0/credit_cards/direct/TEST" id="direct-form" method="POST" novalidate="novalidate"> | |
<input id="verification" name="verification" type="hidden" value="a36d46f0ac1af213b304a95c5d0354ee"> | |
<input id="return_path" name="return_path" type="hidden" value="http://yourwebsite.com/purchase/complete"> | |
<div class="control-group"> | |
<label class="control-label" for="card_holder">Card Holder</label> | |
<div class="controls"> | |
<input class="required" id="card_holder" minlength="2" name="card_holder" type="text"> | |
</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
<form action="https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/direct/TEST" id="direct-form" method="POST" novalidate="novalidate"> | |
<input id="reference" name="reference" type="hidden" value="INV-90386"> | |
<input id="currency" name="currency" type="hidden" value="AUD"> | |
<input id="verification" name="verification" type="hidden" value="a36d46f0ac1af213b304a95c5d0354ee"> | |
<input id="amount" name="amount" type="hidden" value="100000"> | |
<input id="return_path" name="return_path" type="hidden" value="http://yourwebsite.com/purchase/complete"> | |
<p>Your Credit Card (5123XXXXXXXX2346) will be charged the amount of $1000.00. Please enter your card security code to confirm.</p> | |
<input type="hidden" name="card_token" value="xj8lk08a"> | |
<div class="control-group"> |
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
<form action="https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/direct/TEST" id="direct-form" method="POST" novalidate="novalidate"> | |
<input id="reference" name="reference" type="hidden" value="INV-90386"> | |
<input id="currency" name="currency" type="hidden" value="AUD"> | |
<input id="verification" name="verification" type="hidden" value="a36d46f0ac1af213b304a95c5d0354ee"> | |
<input id="amount" name="amount" type="hidden" value="100000"> | |
<input id="return_path" name="return_path" type="hidden" value="http://yourwebsite.com/purchase/complete"> | |
<div class="control-group"> | |
<label class="control-label" for="card_holder">Card Holder</label> | |
<div class="controls"> |
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
// ensure you have added reference to the FatZebra DLL | |
FatZebra.Gateway.Username = "TEST"; | |
FatZebra.Gateway.Token = "TEST"; | |
FatZebra.Gateway.TestMode = true; | |
FatZebra.Gateway.SandboxMode = true; | |
var response = FatZebra.Purchase.Create(12000, "Mark Smith", "5123456789012346", DateTime.new(2013, 5, 30), "123", "INV-123009", "203.123.99.8"); | |
if (response.Successful && response.Result.Successful) |
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
# Gemfile | |
gem "fat_zebra" | |
# In your code | |
require 'fat_zebra' | |
gw = FatZebra::Gateway.new("TEST", "TEST") | |
card = { | |
:number => "5123456789012346", | |
:expiry => "05/2013", | |
:cvv => "123", |
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
<?php | |
include_once("FatZebra.class.php"); | |
define("FATZEBRA_USERNAME", "TEST"); | |
define("FATZEBRA_TOKEN", "TEST"); | |
define("FATZEBRA_GATEWAY", "gateway.sandbox.fatzebra.com.au"); // Live: gateway.fatzebra.com.au | |
define("FATZEBRA_TEST_MODE", true); | |
$gateway = new FatZebra\Gateway(FATZEBRA_USERNAME, FATZEBRA_TOKEN, FATZEBRA_TEST_MODE, FATZEBRA_GATEWAY); // The last option can be omitted to use the live gateway |
NewerOlder