如何在我的Joomla网站上打印eWAY PayNow按钮响应

I am using eWAY PayNow button on my Joomla site. I need capture response message after proceed payments and want to display that message on my Joomla site. Here is the eWAY PayNow button script. How do I capture and view response message ???

I have put this one within Joomla ChronoForms.

 <script src="https://secure.ewaypayments.com/scripts/eCrypt.js"
   class="eway-paynow-button" 
   data-publicapikey="epk-CCEEEFDB-13FC-4094-BA0B-1F0B96B9D13C"
   data-amount="0"
   data-currency="AUD"  data-resulturl="http://
www.mysite.com/responseMsg.php">
</script>

</div>

Since you are using the data-resulturl parameter, once a transaction is complete the user will be redirected to the page you specify (in your example it is http:// www.mysite.com/responseMsg.php). On this page, an AccessCode will be added to the query string - this can be used to fetch the result of the transaction.

So you can use the AccessCode in your code as you would any query variable: $_GET['AccessCode'].

You can fetch the result of the transaction using eWAY's Transaction Query API. An example of doing this would look like:

<?php

// eWAY API key & Password
$api_key = '60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR';
$api_password = 'API-P4ss';

$ch = curl_init();

// Note: using the Sandbox API endpoint
curl_setopt($ch, CURLOPT_URL, 'https://api.sandbox.ewaypayments.com/Transaction/'.$_GET['AccessCode']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, $api_key . ":" . $api_password);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

$output = curl_exec($ch);
curl_close($ch);

$result = json_decode($output);

if ($result->Transactions[0]->TransactionStatus) {
    echo "Transaction successful";
} else {
    echo "Transaction declined";
}