firmantr3 / laravel-midtrans Goto Github PK
View Code? Open in Web Editor NEWMidtrans-PHP Wrapper for Laravel.
License: MIT License
Midtrans-PHP Wrapper for Laravel.
License: MIT License
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
});
My project still using some methods from this package: Veritrans-Laravel5
We need to add these to facade for easier replacement
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"
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?
whoops, my bad
how about refund? i have try it but error
For those who uses currencies other than IDR
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.