Skip to content

Instantly share code, notes, and snippets.

View ibrahimlawal's full-sized avatar

Ibrahim Lawal ibrahimlawal

View GitHub Profile
@ibrahimlawal
ibrahimlawal / PaystackFees.php
Last active April 6, 2020 00:57
A php class to add paystack's local charge to a transaction total. Totally flops if the user pays with a foreign card.
<?php
class PaystackFees
{
const DEFAULT_PERCENTAGE = 0.015;
const DEFAULT_ADDITIONAL_CHARGE = 10000;
const DEFAULT_THRESHOLD = 250000;
const DEFAULT_CAP = 200000;
public static $default_percentage = PaystackFees::DEFAULT_PERCENTAGE;
@ibrahimlawal
ibrahimlawal / README.md
Last active October 23, 2016 08:27 — forked from jonathantneal/README.md
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@ibrahimlawal
ibrahimlawal / install-wp.sh
Last active October 27, 2016 11:17 — forked from BFTrick/install-wp.sh
Download & Install WordPress via Curl
curl -O https://wordpress.org/latest.zip
unzip latest.zip
mv wordpress wp
rm latest.zip
@ibrahimlawal
ibrahimlawal / MyHashHMAC.cs
Created February 2, 2017 21:33
Paystack .NET Event Handling
using System;
public class MyHashHMACTester
{
public static void Main()
{
// Usage sample
Console.WriteLine(MyHashHMAC.sha512WithKey("{\"event\":\"charge.success\",\"data\":{\"id\":708206,\"domain\":\"test\",\"status\":\"success\",\"reference\":\"AB8760\",\"amount\":9000,\"message\":null,\"gateway_response\":\"Successful\",\"paid_at\":\"2017-02-02T08:18:39.000Z\",\"created_at\":\"2017-02-02T08:18:13.000Z\",\"channel\":\"card\",\"currency\":\"NGN\",\"ip_address\":\"154.118.4.232\",\"metadata\":{\"cancel_action\":\"https://gbeta.gigm.com/PayStack-Response.aspx\",\"custom_fields\":[],\"referrer\":\"http://gbeta.gigm.com/Passenger-Details.aspx\"},\"log\":{\"time_spent\":22,\"attempts\":1,\"authentication\":null,\"errors\":0,\"success\":false,\"mobile\":false,\"input\":[],\"channel\":null,\"history\":[{\"type\":\"input\",\"message\":\"Filled these fields: card number, card expiry, card cvv\",\"time\":22},{\"type\":\"action\",\"message\":\"Attempted to pay\",\"time\":22}]},\"fees\":null,\"fees_split\":n
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@ibrahimlawal
ibrahimlawal / README.md
Last active November 22, 2019 12:19
My PHP libraries Git hooks

PRE-REQUISITES

  • php in your path
  • git
  • your php projects should have phpunit installed

INSTALL

  • download all files, rename them removing the .sh extension.
  • chmod +x each of them
  • copy git-mrm and git-ddev to a folder in your executable path e.g. /usr/local/bin
@ibrahimlawal
ibrahimlawal / PaystackFee.py
Last active October 10, 2018 20:36
Add Paystack fees in Python
import math
class PaystackFee:
"""Work with Paystack's Fees"""
DEFAULT_PERCENTAGE = 0.015
DEFAULT_ADDITIONAL_CHARGE = 10000
DEFAULT_THRESHOLD = 250000
DEFAULT_CAP = 200000
percentage = DEFAULT_PERCENTAGE
@ibrahimlawal
ibrahimlawal / PaystackFee.js
Last active March 23, 2019 07:21
Add Paystack fees in Javascript
function PaystackFee() {
this.DEFAULT_PERCENTAGE = 0.015;
this.DEFAULT_ADDITIONAL_CHARGE = 10000;
this.DEFAULT_THRESHOLD = 250000;
this.DEFAULT_CAP = 200000;
this.percentage = this.DEFAULT_PERCENTAGE;
this.additional_charge = this.DEFAULT_ADDITIONAL_CHARGE;
this.threshold = this.DEFAULT_THRESHOLD;
this.cap = this.DEFAULT_CAP;
@ibrahimlawal
ibrahimlawal / installing-node-with-nvm.md
Created March 23, 2018 22:51 — forked from d2s/installing-node-with-nvm.md
Installing Node.js for Linux & macOS with nvm
@ibrahimlawal
ibrahimlawal / PaystackFees.cs
Last active March 19, 2019 11:48
Add Paystack fees in CSharp
using System;
public class PaystackFees
{
const Double DEFAULT_PERCENTAGE = 0.015;
const Double DEFAULT_ADDITIONAL_CHARGE = 10000;
const Double DEFAULT_THRESHOLD = 250000;
const Double DEFAULT_CAP = 200000;
private Double percentage;