Commit 81bb7762 authored by mr.amirka's avatar mr.amirka

refactor

parent 5a350ec6
......@@ -617,7 +617,7 @@ function lunu_payment_create($auth = array(
$order_id = $order['id'];
$now = time();
$expires = $now + (3 * 24 * 60 * 60);
$expires = $now + 3600;
$data = array(
'amount' => $order['amount'],
......@@ -697,9 +697,13 @@ function lunu_rest_notify(WP_REST_Request $request) {
return $gateways['lunupayments']->lunupayment_callback($payment);
}
function lunu_permission_callback() {
return true;
}
add_action('rest_api_init', function() {
register_rest_route('lunu/payment/v1', '/notify', array(
'methods' => 'POST',
'callback' => 'lunu_rest_notify',
'permission_callback' => 'lunu_permission_callback'
));
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment