Skip to content

Instantly share code, notes, and snippets.

View bhaktaraz's full-sized avatar

Bhaktaraz Bhata bhaktaraz

View GitHub Profile
@bhaktaraz
bhaktaraz / MobileNumberClassifier.php
Created August 19, 2016 17:29
MobileNumberClassifier return the carrier of the phone number. e.g. NTC, NCELL etc. (For Nepal)
<?php
/**
* @Author Bhaktaraz Bhatta <bhattabhakta@gmail.com>
*/
namespace SMS\Bundle\MainBundle\Services;
/**
* MobileNumberClassifier return the carrier of the phone number. e.g. NTC, NCELL etc.
*/
@bhaktaraz
bhaktaraz / NpayController.php
Last active July 26, 2018 04:55
nPay Integration Example
<?php
/**
* Created by PhpStorm.
* User: bhaktaraz
* Date: 6/13/18
* Time: 2:47 PM
*/
namespace Fundprabhu\Bundle\PaymentBundle\Controller;
@bhaktaraz
bhaktaraz / redirect.html.twig
Created July 17, 2018 11:25
nPay Integration Example
<h1>Redirecting...</h1>
<div style="display: none;">
<form action="{{ npay_payment_url }}" method="post" target="_parent" name="npay">
<input type="hidden" value="{{ processID }}" name="ProcessID">
<input type="hidden" value="{{ MerchantID }}" name="MerchantID">
<input type="hidden" value="{{ MerchantTxnID }}" name="MerchantTxnID">
<input type="hidden" value="{{ PayAmount }}" name="PayAmount">
<input type="hidden" value="{{ MerchantUsername }}" name="MerchantUsername">
<input type="hidden" value="{{ description }}" name="Description">
@bhaktaraz
bhaktaraz / EsewaController.php
Created July 26, 2018 05:24
eSewa Integration Example
<?php
/**
* Created by PhpStorm.
* User: bhaktaraz
* Date: 6/13/18
* Time: 2:47 PM
*/
namespace Fundprabhu\Bundle\PaymentBundle\Controller;
@bhaktaraz
bhaktaraz / redirect.html.twig
Created July 26, 2018 05:24
eSewa Integration Example
<h1>Redirecting...</h1>
<div style="display: none;">
<form action="{{ esewa_payment_url }}" method="POST" target="_parent" name="esewa">
<input value="{{ tAmt }}" name="tAmt" type="hidden">
<input value="{{ tAmt }}" name="amt" type="hidden">
<input value="0" name="txAmt" type="hidden">
<input value="0" name="psc" type="hidden">
<input value="0" name="pdc" type="hidden">
<input value="{{ esewa_service_code }}" name="scd" type="hidden">
@bhaktaraz
bhaktaraz / ResponseSerializationSubscriber.php
Created September 11, 2019 06:56
Symfony and JMS Serialier, Listener to add extra fields
<?php
/**
* Created by PhpStorm.
* User: bhaktaraz
* Date: 9/11/19
* Time: 11:33 AM
*/
namespace App\Serializer;
@bhaktaraz
bhaktaraz / UtilityController.php
Last active January 21, 2020 05:44
Build a JWT endpoint to work with the Support SDK for mobile applications to authenticate users in Zendesk Support (PHP/Symfony) Implentation
<?php
/**
* Created by PhpStorm.
* User: bhaktaraz
* Date: 11/26/19
* Time: 2:10 PM
*/
namespace App\Controller\API\V1;
@bhaktaraz
bhaktaraz / PostController.php
Last active November 7, 2020 15:16
Symfony Event Listener to Increase Post View Count
<?php
/**
* Created by PhpStorm.
* User: bhaktaraz
* Date: 8/24/15
* Time: 9:51 AM
*/
namespace BRB\Bundle\PostBundle\Controller;
@bhaktaraz
bhaktaraz / GorseClient.php
Created July 17, 2022 08:59
gorse.io php client
<?php
namespace App\Services;
use GuzzleHttp\Client;
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface;
/**
* PHP client for Gorse https://gorse.io/
*