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
# lib/gateway/money_monkey.rb | |
class Gateway::MoneyMonkey < Gateway | |
preference :login, :string | |
preference :token, :string | |
def provider_class | |
ActiveMerchant::Billing::MoneyMonkeyGateway | |
end | |
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
# Note: I realize this is trivial, but this is a pattern I use a lot (name from first/last) so I was | |
# curious as to which method was quicker, and if perhaps I've been doing it wrong...? Run on 1.9.3 | |
require 'benchmark' | |
first_name = "john" | |
last_name = "smith" | |
i = 1000000 | |
# Reopen string to add the blank? method |
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 |
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 |
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
// 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
<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
<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/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
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() |