How to integrate eway payment gateway to a php website?
<p>Does anyone know how to integrate eway payment gateway to a  normal php website ?</p>

<p>I have conected but it is showing the error when I am writing the code in this link :<a href="https://www.eway.com.au/developers/sdk/php" rel="nofollow">https://www.eway.com.au/developers/sdk/php</a></p>

<p>Its showing the error which is given below :
Error: eWAY library has encountered a problem connecting to Rapid</p>

<pre><code>&lt;?php

     require_once 'lib/eway-rapid-php-master/include_eway.php';


    // eWAY Credentials
    $apiKey = 'F9802AS8MHb/rAm6UyRbT2d5eHjOZWhff++jtFOtMU';
  $apiPassword = 'V6E';
  $apiEndpoint = 'Sandbox';

  // Create the eWAY Client
  $client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);


 // Transaction details - these would usually come from the application
  $transaction = [
    'Customer' =&gt; [
    'FirstName' =&gt; 'John',
    'LastName' =&gt; 'Smith',
    'Street1' =&gt; 'Level 5',
    'Street2' =&gt; '369 Queen Street',
    'City' =&gt; 'Sydney',
    'State' =&gt; 'NSW',
    'PostalCode' =&gt; '2000',
    'Country' =&gt; 'au',
    'Email' =&gt; 'demo@example.org',
],
// These should be set to your actual website (on HTTPS of course)
'RedirectUrl' =&gt; "http://$_SERVER[HTTP_HOST]" . dirname($_SERVER['REQUEST_URI']) . '/response.php',
'CancelUrl' =&gt; "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]",
'TransactionType' =&gt; \Eway\Rapid\Enum\TransactionType::PURCHASE,
'Payment' =&gt; [
    'TotalAmount' =&gt; 1000,
]
];

// Submit data to eWAY to get a Shared Page URL
$response = $client-&gt;createTransaction(\Eway\Rapid\Enum\ApiMethod::RESPONSIVE_SHARED, $transaction);


// Check for any errors
if (!$response-&gt;getErrors()) {
     $sharedURL = $response-&gt;SharedPaymentUrl;
 } else {
foreach ($response-&gt;getErrors() as $error) {
    echo "Error: ".\Eway\Rapid::getMessage($error)."&lt;br&gt;";
}
die();
 }


 echo '&lt;a href="'.$sharedURL.'"&gt;Pay with our secure payment page&lt;/a&gt;';
?&gt;
</code></pre>

<p>I have written the code as shown above.</p>