Giter VIP home page Giter VIP logo

esh-dompet's Introduction

๐Ÿ”’ ESH Dompet

Package ini berfungsi untuk menyimpan saldo ke dompet digital

๐Ÿ› ๏ธ Installation with Composer

composer require irfa/dompet

You can get Composer here


๐Ÿ› ๏ธ Laravel Setup

1. Add to config/app.php

'providers' => [
      	 ....
         Irfa\Dompet\DompetServiceProvider::class, 
     ];

2. Add to config/app.php

'aliases' => [
         ....
    	'Dompet' => Irfa\Dompet\Saku\Dompet::class,
],

3. Publish Vendor

php artisan vendor:publish --tag=dompet

4.Migrate Tables

php artisan migrate

Basic Usage


Create new PIN

use Dompet;
...
Dompet::make($user->id, 123456);
//return boolean

Update PIN

...
Dompet::credential($userID,$pin)->update($new_pin);
//return boolean

Add Balance to account

... 
Dompet::credential($userID,$pin)->balance(20000)->add("Some Transaction",$transaction_id);
//return boolean

Reduce Balance to account

...
Dompet::credential($userID,$pin)->balance(20000)->reduce("Some Transaction",$transaction_id);
//return boolean

Get total Balance

...
Dompet::credential($user->id)->sumBalance();
//result 5000
//Formated number
Dompet::credential($user->id)->sumBalance(true);
// result 5,000

Get Transaction History

... 
foreach(Dompet::credential($userID)->history() as $d)
 {
     echo $d->annotation." | ".$d->balance."<br>";
 }

Get Message success or fail

if(Dompet::credential()->balance(2000)->add("Some Transaction",$transaction_id))
{
     echo "Succeded, ".Dompet::message();
} else 
	{
     	echo "Failed, ".Dompet::message();
	}

How to Contributing

  1. Fork it (https://github.com/irfaardy/esh-dompet/fork)
  2. Commit your changes (git commit -m 'Add some Feature')
  3. Push to the branch (git push origin version)
  4. Create a new Pull Request

LICENSE
GitHub license

esh-dompet's People

Contributors

irfaardy avatar

Stargazers

Ahmad Ramli avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.