Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting data in OrderNotify after payment #119

Open
prithivi-byte opened this issue May 12, 2021 · 1 comment
Open

Not getting data in OrderNotify after payment #119

prithivi-byte opened this issue May 12, 2021 · 1 comment

Comments

@prithivi-byte
Copy link

After completion of payment process, not getting any data in OrderNotify.php .While checking the code found that issue $_SERVER['REQUEST_METHOD'] is GET but it shot be POST method.How to change it or why its get method coming suddenly?Pleaase help me to fix it.

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$body = file_get_contents('php://input');
$data = trim($body);

try {
    if (!empty($data)) {
        $result = OpenPayU_Order::consumeNotification($data);
    }

    if ($result->getResponse()->order->orderId) {

        /* Check if OrderId exists in Merchant Service, update Order data by OrderRetrieveRequest */
        $order = OpenPayU_Order::retrieve($result->getResponse()->order->orderId);
        if($order->getStatus() == 'SUCCESS'){
            //the response should be status 200
            header("HTTP/1.1 200 OK");
        }
    }
} catch (OpenPayU_Exception $e) {
    echo $e->getMessage();
}

}

@WeTruck
Copy link

WeTruck commented Jun 4, 2021

I'm also getting it. Any fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants