Coder Social home page Coder Social logo

kasirphp / kasir Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 0.0 1.43 MB

Midtrans package for Laravel, in Laravel way.

Home Page: https://kasirphp.com

License: MIT License

PHP 99.58% Blade 0.42%
composer laravel php midtrans midtrans-php payment-gateway

kasir's People

Contributors

dependabot[bot] avatar risangbaskoro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

kasir's Issues

Apply Taxes and Discounts to Kasir Object

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.

[Feature]: Copy or Clone Object

Is your feature request related to a problem?

Just like the Carbon Date copy() or clone() function, Kasir maybe can have a function that will clone the object too.

Describe alternatives you've considered

A function that returns a clone of the object.

public functione clone(){
    return new clone $this
}

public function copy(){
   return $this->clone()
}

Additional context

No response

Terms of Agreement

  • I have searched this issue I am experiencing in GitHub Issue and I ensure it is not a duplicated issue.

GoPay Account Link, Unlink, & Get Status

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();
}

Docs Update

Some things to update in the docs:

  • Credit card tokenization
  • GoPay tokenization
  • PaymentMethod
    • E-Money
    • Over the Counter
    • Cardless Credit
  • Charging customer
  • Capture a credit card transaction
  • Approve a challenged credit card transaction
  • Deny a challenged credit card transaction
  • Cancel a transaction
  • Refund a transaction
  • Expire a transaction

[Bug]: Error saat pakai production

Package Version

v1.0.0

Laravel Version

v10.0.0

PHP Version

PHP 8.2.0

Problem description

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

image

mohon bantuannya
Terima kasih

Expected behavior

Segera diberitahu kesalahannya dimana

Steps to reproduce

tidak ada

Terms of Agreement

  • I have searched this issue I am experiencing in GitHub Issue and I ensure it is not a duplicated issue.

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.