Skip to content

Instantly share code, notes, and snippets.

View sash's full-sized avatar

SASh sash

View GitHub Profile
<?php
try {
$cardReference = 'recurring_test_reference1234'; // saved from above - $result->getCardReference();
$response = $gateway->purchase([
'cardReference' => $cardReference,
'amount' => 3.00,
'currency' => 'BGN',
'description' => 'Purchase #1234',
])->send();
} catch (EcommException $e) {
<?php
try {
$result = $gateway->transactionResult([
'transactionId' => $transactionId, // Saved from above
'clientIp' => 'CLIENT IP ADDRESS',
])->send();
} catch (EcommException $e) {
abort(422, $e->getMessage());
}
if (!$result->isSuccessful()){
<?php
$gateway = \Omnipay\Omnipay::create('\Ampeco\OmnipayFibank\Gateway');
$gateway->initialize([
'merchantCertificate' => '... The PEM certificate you got from fibank ..',
'merchantCertificatePassword' => '.. the password for the certificate',
'createCardAmount' => 1.00, // The amount and currency to use for the create account initial payment
'createCardCurrency' => 'BGN',
'testMode' => true,
]);
@sash
sash / fibank-create_card.php
Created May 3, 2019 07:20
Omnipay fibank tutorial
<?php
try{
$response = $gateway->createCard([
'clientIp' => 'CLIENT IP ADDRESS',
'expiry' => date('Y-m-d', strtotime('+1 years')), // Save the card for an year
'description' => 'Register a new payment method. The amount will be credited to your account',
])->send();
} catch (EcommException $e) {
abort(422, $e->getMessage());
}
<?php
try{
$response = $gateway->createCard([
'clientIp' => 'CLIENT IP ADDRESS',
'expiry' => date('Y-m-d', strtotime('+1 years')), // Save the card for an year
'description' => 'Register a new payment method. The amount will be credited to your account',
])->send();
} catch (EcommException $e) {
abort(422, $e->getMessage());
}
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
php53
php55
@sash
sash / php -v
Created November 6, 2013 16:03
PHP 5.4.21 (cli) (built: Nov 6 2013 17:56:08)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with XCache v3.0.1, Copyright (c) 2005-2013, by mOo
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
with XCache Cacher v3.0.1, Copyright (c) 2005-2013, by mOo
@sash
sash / brew install php52
Created November 6, 2013 16:02
brew install -V php52 --with-libmysql --with-cgi --without-pear --without-pcntl
==> Downloading http://www.php.net/get/php-5.2.17.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php52-5.2.17
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file configure
Hunk #7 succeeded at 110645 (offset 1324 lines).
Hunk #8 succeeded at 118930 (offset 1324 lines).
Hunk #9 succeeded at 119634 (offset 1324 lines).
Hunk #10 succeeded at 119689 (offset 1324 lines).
@sash
sash / gist:7338281
Created November 6, 2013 15:43
gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
@sash
sash / Ubiquity Command - toodledo via twitter.js
Created January 8, 2009 23:25
Ubiquity plugin - Create toodledo tasks via twitter
Cu.import("resource://ubiquity/modules/oauth.js");
// http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0update
// "Statuses over 140 characters will cause a 403 error from the API"
const TWITTER_STATUS_MAXLEN = 140;
CmdUtils.CreateCommand({
name: ["toodledo", "todo", "task", "do", "to do"],
icon: "http://toodledo.com/favicon.ico",