Skip to content

Instantly share code, notes, and snippets.

View Prometee's full-sized avatar
🎯
Focusing

Francis Hilaire Prometee

🎯
Focusing
View GitHub Profile
@Prometee
Prometee / PsrHttpClient.php
Created April 18, 2023 14:13
Adapter for `stripe/stripe-php` library to be able to use a PSR-18 HTTP Client
<?php
declare(strict_types=1);
namespace App\Stripe\HttpClient;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Client\ClientInterface as PsrClientInterface;
use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\RequestInterface;
@Prometee
Prometee / CaptureThirdPartyAction.php
Last active February 8, 2022 09:48
[Sylius] Payum Stripe Checkout Session with Stripe Connect direct charge
<?php
declare(strict_types=1);
namespace App\PayumStripe\Action\StripeCheckoutSession;
use App\PayumStripe\Provider\OnboardedUserInfoProviderInterface;
use ArrayObject;
use FluxSE\PayumStripe\Action\StripeCheckoutSession\CaptureAction;
use FluxSE\PayumStripe\Request\Api\Resource\CreateSession;
@Prometee
Prometee / CheckCouponsExtension.php
Created January 20, 2022 12:43
Payum Extension to allows GiftCard with SyliusPayumStripePlugin
<?php
declare(strict_types=1);
namespace App\GiftCard\Payum\Extension;
use FluxSE\PayumStripe\Request\Api\Resource\CreateCoupon;
use FluxSE\PayumStripe\Request\Api\Resource\RetrieveCoupon;
use FluxSE\SyliusPayumStripePlugin\Action\ConvertPaymentAction;
use Payum\Core\Extension\Context;
@Prometee
Prometee / AbstractTwigTemplateCompilerPass.php
Created December 11, 2018 16:24
Allow twig template override into a Bundle or an App
<?php
declare(strict_types=1);
namespace App\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
abstract class AbstractTwigTemplateCompilerPass implements CompilerPassInterface
@Prometee
Prometee / iOSPNGNormalizer.php
Last active July 28, 2020 10:16 — forked from juban/iOSPNGNormalizer.php
Update script to fit the newest version of the initial python script
<?php
class iOSPNGNormalizer
{
public static function fix($filename, $destfilename = null)
{
try {
$handle = fopen($filename, "rb");
$oldPNG = fread($handle, filesize($filename));
fclose($handle);