Code Monkey home page Code Monkey logo

laravel-midtrans's People

Contributors

firmantr3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-midtrans's Issues

Notification Callback

I think it will be cleaner if we write the notification handler with callback like so:

Midtrans::notification()->onPending(function($transaction) {
// do something
})->onSuccess(function($transaction) {
// do something
})->onExpired(function($transaction) {
// do something
});

Undefined index: transaction_id

I am using snap redirect which the users will redirect to another page and after payment will return to my website again.

In the returning page I receive this info:

order_id: "8640629786"
status_code: "200"
transaction_status: "capture"

and I get this error when I use web hook:

file: "..........\vendor\firmantr3\laravel-midtrans\src\Notification.php"
line: 44
message: "Undefined index: transaction_id"

code

public function notificationsHandler(Request $request) {
        $notification = Midtrans::notification();
        /**
        * $notificationArray = $notification->toArray();
        * $notificationObject = $notification->toObject();
        **/
        $transaction = $notification->transaction_status;
        $fraud = $notification->fraud_status;

        $order = Order::where('ordernu', $notification->order_id)->first();
        $status = Midtrans::status($notification->order_id);

        return response()->json([
            'data' => $transaction,
            'fraud' => $fraud,
            'order' => $order,
            'status' => $status,
        ]);
}

any idea?

refund

how about refund? i have try it but error

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.