Skip to content

Instantly share code, notes, and snippets.

Avatar

Bhaktaraz Bhata bhaktaraz

View GitHub Profile
@bhaktaraz
bhaktaraz / MobileNumberClassifier.php
Created Aug 19, 2016
MobileNumberClassifier return the carrier of the phone number. e.g. NTC, NCELL etc. (For Nepal)
View MobileNumberClassifier.php
<?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 Jul 26, 2018
nPay Integration Example
View NpayController.php
<?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 Jul 17, 2018
nPay Integration Example
View redirect.html.twig
<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 Jul 26, 2018
eSewa Integration Example
View EsewaController.php
<?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 Jul 26, 2018
eSewa Integration Example
View redirect.html.twig
<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 Sep 11, 2019
Symfony and JMS Serialier, Listener to add extra fields
View ResponseSerializationSubscriber.php
<?php
/**
* Created by PhpStorm.
* User: bhaktaraz
* Date: 9/11/19
* Time: 11:33 AM
*/
namespace App\Serializer;
@bhaktaraz
bhaktaraz / UtilityController.php
Last active Jan 21, 2020
Build a JWT endpoint to work with the Support SDK for mobile applications to authenticate users in Zendesk Support (PHP/Symfony) Implentation
View UtilityController.php
<?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 Nov 7, 2020
Symfony Event Listener to Increase Post View Count
View PostController.php
<?php
/**
* Created by PhpStorm.
* User: bhaktaraz
* Date: 8/24/15
* Time: 9:51 AM
*/
namespace BRB\Bundle\PostBundle\Controller;