Download the PHP package sunveloper/teepluss-gateway without Composer

On this page you can find all versions of the php package sunveloper/teepluss-gateway. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package teepluss-gateway

Gateway for Laravel

For Laravel 4, please use the v1.x branch!

Gateway is payment gateway adapters that support Paypal, Paysbuy, Bangkok Bank, Kasikorn Bank, True Money.

Installation

To get the lastest version of Gateway simply require it in your composer.json file.

"teepluss/gateway": "dev-master"

You'll then need to run composer install to download it and have the autoloader updated.

Once Gateway is installed you need to register the service provider with the application. Open up app/config/app.php and find the providers key.

'providers' => [
    ...
    Teepluss\Gateway\GatewayServiceProvider::class,
)

Gateway also ships with a facade which provides the static syntax for creating collections. You can register the facade in the aliases key of your app/config/app.php file.

'aliases' => [
    ...
    'Gateway' => Teepluss\Gateway\Facades\Gateway::class,

]

Usage

Generate payment form.

$adapter = Gateway::driver('Paypal');

$adapter->setSandboxMode(true);

$adapter->setSuccessUrl('http://www.domain/foreground/success')
        ->setCancelUrl('http://www.domain/foreground/cancel')
        ->setBackendUrl('http://www.domain/background/invoice/00001');

$adapter->setMerchantAccount('[email protected]');

$adapter->setLanguage('TH')
        ->setCurrency('THB');

$adapter->setInvoice(00001)
        ->setPurpose('Buy a beer.')
        ->setAmount(100);

$adapter->setRemark('Short note');

$generated = $adapter->render();

var_dump($generated);

You can use intialize also.

$adapter = Gateway::driver('Paypal')->initialize(array(
    'sandboxMode'     => true,
    'successUrl'      => 'http://www.domain/foreground/success',
    'cancelUrl'       => 'http://www.domain/foreground/cancel',
    'backendUrl'      => 'http://www.domain/background/invoice/00001',
    'merchantAccount' => '[email protected]',
    'language'        => 'TH',
    'currency'        => 'THB',
    'invoice'         => uniqid(),
    'purpose'         => 'Buy a beer.',
    'amount'          => 100,
    'remark'          => 'Short note'
));

$generated = $adapter->render();

var_dump($generated);

How to set TrueMoneyApi and PaysbuyApi

// True Money
$gateway = Gateway::driver('TrueMoneyApi');
$gateway->setMerchantAccount('appId:shopCode:secret:bearer');

// Paysbuy
$gateway = Gateway::driver('PaysbuyApi');
$gateway->setMerchantAccount('merchantId:username:secureCode');

// Paysbuy having non-apu version.
$gateway = Gateway::driver('Paysbuy');
$gateway->setMerchantAccount('email');

Checking foregound process.

$adapter = Gateway::driver('Paypal');

$adapter->setSandboxMode(true);

$adapter->setMerchantAccount('[email protected]');

$adapter->setInvoice(00001);

$result = $adapter->getFrontendResult();

var_dump($result);

Checking background process (IPN).

$adapter = Gateway::driver('Paypal');

$adapter->setSandboxMode(true);

$adapter->setMerchantAccount('[email protected]');

$adapter->setInvoice(00001);

$result = $adapter->getBackendResult();

var_dump($result);

Extending the core.


use Teepluss\Gateway\Drivers\DriverAbstract;
use Teepluss\Gateway\Drivers\DriverInterface;

class Strip extends DriverAbstract imlements DriverInterface {
    //....
}

use Teepluss\Gateway\Repository;

Gateway::extend('Stripe', function()
{
    return new Repository(new Strip);
});

TrueMoneyApi adapter need more addition required data to make it works!

$gateway = Gateway::driver('TrueMoneyApi');

$gateway->setMerchantAccount('appId:shopCode:secret:bearer');

$gateway->setSandboxMode(true);
$gateway->setSuccessUrl(URL::to('demo/thankyou'))
        ->setCancelUrl(URL::to('demo/thankyou'))
        ->setBackendUrl(URL::to('demo/background'));

$gateway->setLanguage('TH')
        ->setCurrency('THB');

$gateway->setInvoice(uniqid())
        ->setPurpose('sale');

$gateway->payer(array(
    'installment'       => null,
    'fundingInstrument' => null,
    'payerInfo' => array(
        'email'     => '[email protected]',
        'firstName' => 'Tee',
        'lastName'  => 'Plus',
        'payerId'   => '11',
        'phone'     => '9999999'
    ),
    'paymentMethod' => 'creditcard'
));

$gateway->address(array(
    'cityDistrict'  => 'Patumwan',
    'companyName'   => 'eCommerce Solution',
    'companyTaxId'  => '3334567',
    'country'       => 'Thailand',
    'email'         => '[email protected]',
    'forename'      => 'Tee',
    'line1'         => 'Ratchadapisak Rd.',
    'line2'         => 'OX',
    'phone'         => '0888773390',
    'postalCode'    => '10310',
    'stateProvince' => 'Bangkok',
    'surname'       => 'Pluss',
));

$gateway->payment(array(
    'ref1' => 1,
    'ref2' => 2,
    'ref3' => 3
));

$gateway->product()->add(array(
    'shopCode'  => null,
    'itemId'    => 1,
    'service'   => 'bill',
    'productId' => 'p1',
    'detail'    => 'd1',
    'price'     => 5000,
    'ref1'      => '1',
    'ref2'      => '2',
    'ref3'      => '3',
));

$gateway->product()->add(array(
    'shopCode'  => null,
    'itemId'    => 2,
    'service'   => 'bill',
    'productId' => 'p1',
    'detail'    => 'd1',
    'price'     => 300,
    'ref1'      => '1',
    'ref2'      => '2',
    'ref3'      => '3',
));

echo $gateway->includeSubmitButton()->render();

For old version of TrueMoney, we call TruePaymentApi instead.

$gateway = Gateway::driver('TruePaymentApi');

$gateway->setAppId('AppId')
        ->setShopId('ShopId')
        ->setPassword('Password')
        ->setPrivateKey('PrivateKey')
        ->setRC4Key('RC4Key');

// $gateway->setMerchantAccount('appId:ShopId:Password:PrivateKey:RC4Key');

$gateway->setSandboxMode(true);
$gateway->setSuccessUrl(URL::to('demo/thankyou'))
        ->setCancelUrl(URL::to('demo/thankyou'))
        ->setBackendUrl(URL::to('demo/background'));

$gateway->setLanguage('TH')
        ->setCurrency('THB');

$gateway->setRemark('Something');

$gateway->setInvoice(uniqid());

$gateway->payer(array(
    'ssoId'     => '4620762',
    'trueId'    => '[email protected]',
    'fullName'  => 'Test Dev2',
    'address'   => 'RS ห้วยขวาง ห้วยขวาง',
    'district'  => 'ห้วยขวาง',
    'province'  => 'กรุงเทพมหานคร',
    'zip'       => '11115',
    'country'   => 'Thailand',
    'mphone'    => '0890000001',
    'citizenId' => '4100799036048'
));

$gateway->billing(array(
    'fullname' => 'Teepluss',
    'address'  => '33/1 Pattanakarn',
    'district' => 'Pattanakarn',
    'province' => 'Bangkok',
    'zip'      => '10220',
    'country'  => 'Thailand'
));

$gateway->product()->add(array(
    'pid'         => 18051,
    'productId'   => 'ME161',
    'topic'       => 'Winnie Jewelry : ต่างหูสแควร์ไดมอนด์ (ME162)',
    'quantity'    => 1,
    'totalPrice'  => 10,
    'shopIdRef'   => 'inherit',
    'marginPrice' => 0
));

$gateway->product()->add(array(
    'pid'         => 18052,
    'productId'   => 'ME162',
    'topic'       => 'Winnie Jewelry : ต่างหูสแควร์ไดมอนด์ (ME162)',
    'quantity'    => 3,
    'totalPrice'  => 10,
    'shopIdRef'   => 'inherit',
    'marginPrice' => 0
));

echo $gateway->includeSubmitBtn()->render();

Support or Contact

If you have some problem, Contact [email protected]

Support via PayPal


All versions of teepluss-gateway with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sunveloper/teepluss-gateway contains the following files

Loading the files please wait ....