kasirphp / kasir Goto Github PK
View Code? Open in Web Editor NEWMidtrans package for Laravel, in Laravel way.
Home Page: https://kasirphp.com
License: MIT License
Midtrans package for Laravel, in Laravel way.
Home Page: https://kasirphp.com
License: MIT License
Taxes and Discounts is basically just another item. For discounts, the value must subtract the gross_amount
from item_details
.
Create a discount()
method to add discount. This method receives these parameters:
int $amount
- The amount of discount. Automatically converts to a negative value if fixed, positive if percentage.string|null $name
- The name of applied discount. Defaults to null
. If null
, 'Discount #<discount_id>'
name will be used.bool $percent
- Determine if the discount in fixed value or in percentage of gross_amount
. Default: false
.Create a tax()
method to add tax. This method receives these parameters:
int $amount
- The amount of tax. Automatically converts to a negative value if fixed, positive if percentage.string|null $name
- The name of applied tax. Defaults to null
. If null
, 'Tax #<tax_id>'
name will be used.bool $percent
- Determine if the tax in fixed value or in percentage of gross_amount
. Default: false
.Just like the Carbon Date copy()
or clone()
function, Kasir maybe can have a function that will clone the object too.
A function that returns a clone of the object.
public functione clone(){
return new clone $this
}
public function copy(){
return $this->clone()
}
No response
In Midtrans, there are abilities to bind, unbind, and get status of a GoPay payment account. This allows gopay()
method to receive tokenized GoPay account ID in $account_id
parameter. This will be beneficial to backend engineers who needs to build a backend for a mobile or web app that can utilize GoPay Wallet or GoPay Paylater.
I am thinking of a class (may be called GoPay) with some properties like account_id
and account_status
.
This class will likely to have bind()
method to link a GoPay account from Midtrans API, unbind()
method to unlink an existing GoPay account from a given account_id
, and status()
method to receive an account status from a given account_id
.
Since a "PENDING"
binding account status response body will have 'actions'
array as well, it will be powerfull to have some sort of action choosing method where this class can returns an array of a given action name (like MidtransResponse does).
The same also applies to 'metadata.payment_options'
array. For example: wallet()
method will returns an array of 'name'=>'GOPAY_WALLET'
in the option, and paylaterBalance()
will return an array of the users balance
and currency
from an option that has 'name'=>'PAY_LATER'
.
interface GoPayAccount
{
protected $account_id;
protected $account_status;
protected $actions;
private $payment_options;
public static function bind(string $phone_number, string $callback_url, string|int|null $country_code = 62);
public function status();
public function unbind();
public function wallet();
public function walletBalance();
public function paylater();
public function paylaterBalance();
}
Some things to update in the docs:
v1.0.0
v10.0.0
PHP 8.2.0
Hallo kak risang, terima kasih karena packagenya sangat membantu dalam pengembangan aplikasi saya
untuk saat ini dalam mode sandbox tidak ada masalah, akan tetapi saat saya pakai mode production Basic Auth salah, untuk key dan secret nya tidak ada yang salah
mohon bantuannya
Terima kasih
Segera diberitahu kesalahannya dimana
tidak ada
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.