Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Working from home

Ali Gajani aligajani

:octocat:
Working from home
View GitHub Profile
@aligajani
aligajani / getStripeCustomersViaEmail.php
Created Aug 31, 2017
Retrieve Stripe Customers via email
View getStripeCustomersViaEmail.php
<?php
$email = "your_email_query_here";
try {
$client = $client = new \GuzzleHttp\Client();
$client->setDefaultOption('verify', true);
$httpResource = 'https://api.stripe.com/v1/search?query="'.$email.'"&prefix=false';
$request = $client->get($httpResource, [
@aligajani
aligajani / Base64_Encryption.php
Last active Sep 14, 2015
Base64 with Encryption
View Base64_Encryption.php
<?php
namespace Gajani;
class Base64_Encryption {
public static function aes128Encrypt($key, $data) {
if(16 !== strlen($key)) $key = hash('MD5', $key, true);
$padding = 16 - (strlen($data) % 16);
$data .= str_repeat(chr($padding), $padding);