Version Notes
Deploying to Magento Connect
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | PayWay_Net |
| Version | 1.0.2 |
| Comparing to | |
| See all releases | |
Version 1.0.2
- app/code/local/PayWay/Net/Helper/Data.php +6 -0
- app/code/local/PayWay/Net/Model/Net.php +208 -0
- app/code/local/PayWay/Net/Model/PaymentNotify.php +22 -0
- app/code/local/PayWay/Net/controllers/PaymentController.php +82 -0
- app/code/local/PayWay/Net/etc/config.xml +92 -0
- app/code/local/PayWay/Net/etc/system.xml +107 -0
- package.xml +22 -0
app/code/local/PayWay/Net/Helper/Data.php
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class PayWay_Net_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
+
{
|
| 5 |
+
|
| 6 |
+
}
|
app/code/local/PayWay/Net/Model/Net.php
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class PayWay_Net_Model_Net extends Mage_Payment_Model_Method_Abstract {
|
| 3 |
+
protected $_code = 'net';
|
| 4 |
+
protected $_isInitializeNeeded = true;
|
| 5 |
+
protected $_canUseCheckout = true;
|
| 6 |
+
protected $_canUseInternal = false;
|
| 7 |
+
protected $_canUseForMultishipping = false;
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* Config instance
|
| 11 |
+
* @var Mage_payway_Model_Config
|
| 12 |
+
*/
|
| 13 |
+
protected $_config = null;
|
| 14 |
+
|
| 15 |
+
public function _construct()
|
| 16 |
+
{
|
| 17 |
+
parent::_construct();
|
| 18 |
+
$this->_init('net/net');
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
* Whether method is available for specified currency
|
| 23 |
+
*
|
| 24 |
+
* @param string $currencyCode
|
| 25 |
+
* @return bool
|
| 26 |
+
*/
|
| 27 |
+
public function canUseForCurrency($currencyCode)
|
| 28 |
+
{
|
| 29 |
+
return true;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
protected function getToken( $parameters )
|
| 33 |
+
{
|
| 34 |
+
$proxyHostSetting = Mage::getStoreConfig( 'payment/net/proxy_host' );
|
| 35 |
+
$proxyPortSetting = Mage::getStoreConfig( 'payment/net/proxy_port' );
|
| 36 |
+
$proxyUserSetting = Mage::getStoreConfig( 'payment/net/proxy_username' );
|
| 37 |
+
$proxyPasswordSetting = Mage::getStoreConfig( 'payment/net/proxy_password' );
|
| 38 |
+
$proxyHost = strlen( $proxyHostSetting ) == 0 ? null : $proxyHostSetting;
|
| 39 |
+
$proxyPort = strlen( $proxyPortSetting ) == 0 ? null : $proxyPortSetting;
|
| 40 |
+
$proxyUser = strlen( $proxyUserSetting ) == 0 ? null : $proxyUserSetting;
|
| 41 |
+
$proxyPassword = strlen( $proxyPasswordSetting ) == 0 ? null : $proxyPasswordSetting;
|
| 42 |
+
$caCertsFile = $_SERVER['DOCUMENT_ROOT'] . "/cacerts.crt";
|
| 43 |
+
$payWayUrl = Mage::getStoreConfig( 'payment/net/payway_url' );
|
| 44 |
+
|
| 45 |
+
// Find the port setting, if any.
|
| 46 |
+
$port = 443;
|
| 47 |
+
$portPos = strpos( $payWayUrl, ":", 6 );
|
| 48 |
+
$urlEndPos = strpos( $payWayUrl, "/", 8 );
|
| 49 |
+
if ( $portPos !== false && $portPos < $urlEndPos )
|
| 50 |
+
{
|
| 51 |
+
$port = (int)substr( $payWayUrl, ((int)$portPos) + 1, ((int)$urlEndPos));
|
| 52 |
+
$payWayUrl = substr( $payWayUrl, 0, ((int)$portPos))
|
| 53 |
+
. substr( $payWayUrl, ((int)$urlEndPos), strlen($payWayUrl));
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
$ch = curl_init( $payWayUrl . "RequestToken" );
|
| 57 |
+
|
| 58 |
+
if ( $port != 443 )
|
| 59 |
+
{
|
| 60 |
+
curl_setopt( $ch, CURLOPT_PORT, $port );
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
curl_setopt( $ch, CURLOPT_FAILONERROR, true );
|
| 64 |
+
curl_setopt( $ch, CURLOPT_FORBID_REUSE, true );
|
| 65 |
+
curl_setopt( $ch, CURLOPT_FRESH_CONNECT, true );
|
| 66 |
+
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
| 67 |
+
|
| 68 |
+
// Set proxy information as required
|
| 69 |
+
if ( !is_null( $proxyHost ) && !is_null( $proxyPort ) )
|
| 70 |
+
{
|
| 71 |
+
curl_setopt( $ch, CURLOPT_HTTPPROXYTUNNEL, true );
|
| 72 |
+
curl_setopt( $ch, CURLOPT_PROXY, $proxyHost . ":" . $proxyPort );
|
| 73 |
+
if ( !is_null( $proxyUser ) )
|
| 74 |
+
{
|
| 75 |
+
if ( is_null( $proxyPassword ) )
|
| 76 |
+
{
|
| 77 |
+
curl_setopt( $ch, CURLOPT_PROXYUSERPWD, $proxyUser . ":" );
|
| 78 |
+
}
|
| 79 |
+
else
|
| 80 |
+
{
|
| 81 |
+
curl_setopt( $ch, CURLOPT_PROXYUSERPWD,
|
| 82 |
+
$proxyUser . ":" . $proxyPassword );
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
// Set timeout options
|
| 88 |
+
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 30 );
|
| 89 |
+
curl_setopt( $ch, CURLOPT_TIMEOUT, 30 );
|
| 90 |
+
|
| 91 |
+
// Set references to certificate files\
|
| 92 |
+
if ( file_exists ( $caCertsFile ) )
|
| 93 |
+
{
|
| 94 |
+
curl_setopt( $ch, CURLOPT_CAINFO, $caCertsFile );
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
// Check the existence of a common name in the SSL peer's certificate
|
| 98 |
+
// and also verify that it matches the hostname provided
|
| 99 |
+
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 1 );
|
| 100 |
+
|
| 101 |
+
// Verify the certificate of the SSL peer
|
| 102 |
+
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, true );
|
| 103 |
+
|
| 104 |
+
// Build the parameters string to pass to PayWay
|
| 105 |
+
$parametersString = '';
|
| 106 |
+
$init = true;
|
| 107 |
+
foreach ( $parameters as $paramName => $paramValue )
|
| 108 |
+
{
|
| 109 |
+
if ( $init )
|
| 110 |
+
{
|
| 111 |
+
$init = false;
|
| 112 |
+
}
|
| 113 |
+
else
|
| 114 |
+
{
|
| 115 |
+
$parametersString = $parametersString . '&';
|
| 116 |
+
}
|
| 117 |
+
$parametersString = $parametersString . urlencode($paramName) . '=' . urlencode($paramValue);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
curl_setopt( $ch, CURLOPT_POSTFIELDS, $parametersString );
|
| 121 |
+
|
| 122 |
+
// Make the request
|
| 123 |
+
$responseText = curl_exec($ch);
|
| 124 |
+
|
| 125 |
+
// Check the response for errors
|
| 126 |
+
$errorNumber = curl_errno( $ch );
|
| 127 |
+
if ( $errorNumber != 0 )
|
| 128 |
+
{
|
| 129 |
+
Mage::throwException( "CURL Error getting token: Error Number: " . $errorNumber .
|
| 130 |
+
", Description: '" . curl_error( $ch ) . "'" );
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
curl_close( $ch );
|
| 134 |
+
|
| 135 |
+
// Split the response into parameters
|
| 136 |
+
$responseParameterArray = explode( "&", $responseText );
|
| 137 |
+
$responseParameters = array();
|
| 138 |
+
foreach ( $responseParameterArray as $responseParameter )
|
| 139 |
+
{
|
| 140 |
+
list( $paramName, $paramValue ) = explode( "=", $responseParameter, 2 );
|
| 141 |
+
$responseParameters[ $paramName ] = $paramValue;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
if ( array_key_exists( 'error', $responseParameters ) )
|
| 145 |
+
{
|
| 146 |
+
Mage::throwException( "Error getting token: " . $responseParameters['error'] );
|
| 147 |
+
}
|
| 148 |
+
else
|
| 149 |
+
{
|
| 150 |
+
return $responseParameters['token'];
|
| 151 |
+
}
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
/**
|
| 155 |
+
* Return Order place redirect url
|
| 156 |
+
*
|
| 157 |
+
* @return string
|
| 158 |
+
*/
|
| 159 |
+
public function getOrderPlaceRedirectUrl()
|
| 160 |
+
{
|
| 161 |
+
return Mage::getUrl('net/payment/redirect', array('_secure' => true));
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
public function getNetCheckoutFormFields()
|
| 165 |
+
{
|
| 166 |
+
$billerCode = Mage::getStoreConfig( 'payment/net/biller_code' );
|
| 167 |
+
$merchantId = Mage::getStoreConfig( 'payment/net/merchant_id' );
|
| 168 |
+
$securityUsername = Mage::getStoreConfig( 'payment/net/security_username' );
|
| 169 |
+
$securityPassword = Mage::getStoreConfig( 'payment/net/security_password' );
|
| 170 |
+
$checkout = Mage::getSingleton('checkout/session');
|
| 171 |
+
$orderIncrementId = $checkout->getLastRealOrderId();
|
| 172 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
|
| 173 |
+
$referenceNumber = $order->getIncrementId();
|
| 174 |
+
$paymentAmount = $order->getBaseGrandTotal();
|
| 175 |
+
$token_variables = Array(
|
| 176 |
+
"username" => $securityUsername,
|
| 177 |
+
"password" => $securityPassword,
|
| 178 |
+
"biller_code" => $billerCode,
|
| 179 |
+
"merchant_id" => $merchantId,
|
| 180 |
+
"payment_reference" => $referenceNumber,
|
| 181 |
+
"payment_amount" => $paymentAmount
|
| 182 |
+
);
|
| 183 |
+
$token = $this->getToken( $token_variables );
|
| 184 |
+
return array(
|
| 185 |
+
'biller_code' => $billerCode,
|
| 186 |
+
'token' => $token );
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
/**
|
| 190 |
+
* Instantiate state and set it to state object
|
| 191 |
+
*/
|
| 192 |
+
public function initialize($paymentAction, $stateObject)
|
| 193 |
+
{
|
| 194 |
+
$state = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
|
| 195 |
+
$stateObject->setState($state);
|
| 196 |
+
$stateObject->setStatus('pending_payment');
|
| 197 |
+
$stateObject->setIsNotified(false);
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
/**
|
| 201 |
+
* Check whether payment method can be used
|
| 202 |
+
*/
|
| 203 |
+
public function isAvailable($quote = null)
|
| 204 |
+
{
|
| 205 |
+
return true;
|
| 206 |
+
}
|
| 207 |
+
}
|
| 208 |
+
?>
|
app/code/local/PayWay/Net/Model/PaymentNotify.php
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class PayWay_Net_Model_PaymentNotify
|
| 3 |
+
{
|
| 4 |
+
public function savePayment( $params )
|
| 5 |
+
{
|
| 6 |
+
// Save payment
|
| 7 |
+
$orderNumber = trim ( stripslashes ( $params ['payment_reference'] ) );
|
| 8 |
+
|
| 9 |
+
// Get the Order Details from the database
|
| 10 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderNumber);
|
| 11 |
+
|
| 12 |
+
if ($params ['cd_summary'] == '0') {
|
| 13 |
+
$order->getPayment()->registerCaptureNotification( $order->getBaseGrandTotal() );
|
| 14 |
+
$order->save();
|
| 15 |
+
}
|
| 16 |
+
else
|
| 17 |
+
{
|
| 18 |
+
$order->registerCancellation( 'Payment failed', true )->save();
|
| 19 |
+
}
|
| 20 |
+
return true;
|
| 21 |
+
}
|
| 22 |
+
}
|
app/code/local/PayWay/Net/controllers/PaymentController.php
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class PayWay_Net_PaymentController extends Mage_Core_Controller_Front_Action {
|
| 3 |
+
|
| 4 |
+
public function redirectAction()
|
| 5 |
+
{
|
| 6 |
+
$net = Mage::getModel('net/net');
|
| 7 |
+
|
| 8 |
+
$form = new Varien_Data_Form();
|
| 9 |
+
$form->setAction( Mage::getStoreConfig( 'payment/net/payway_url' ) . 'MakePayment' )
|
| 10 |
+
->setId('payway_net_checkout')
|
| 11 |
+
->setName('payway_net_checkout')
|
| 12 |
+
->setMethod('GET')
|
| 13 |
+
->setUseContainer(true);
|
| 14 |
+
foreach ($net->getNetCheckoutFormFields() as $field=>$value) {
|
| 15 |
+
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
|
| 16 |
+
}
|
| 17 |
+
$html = '<html><body>';
|
| 18 |
+
$html.= $this->__('You will be redirected to the PayWay website in a few seconds.');
|
| 19 |
+
$html.= $form->toHtml();
|
| 20 |
+
$html.= '<script type="text/javascript">document.getElementById("payway_net_checkout").submit();</script>';
|
| 21 |
+
$html.= '</body></html>';
|
| 22 |
+
|
| 23 |
+
echo $html;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
public function notifyAction()
|
| 27 |
+
{
|
| 28 |
+
/**
|
| 29 |
+
* Read post from PayWay system and create reply
|
| 30 |
+
* starting with: 'cmd=_notify-validate'...
|
| 31 |
+
* then repeating all values sent: that's our VALIDATION.
|
| 32 |
+
**/
|
| 33 |
+
$workstring = 'cmd=_notify-validate'; // Notify validate
|
| 34 |
+
$i = 1;
|
| 35 |
+
foreach ( $_POST as $key => $value ) {
|
| 36 |
+
if (get_magic_quotes_gpc ())
|
| 37 |
+
// Fix issue with magic quotes
|
| 38 |
+
$value = stripslashes ( $value );
|
| 39 |
+
|
| 40 |
+
if (! eregi ( "^[_0-9a-z-]{1,30}$", $key ) || ! strcasecmp ( $key, 'cmd' )) {
|
| 41 |
+
// ^ Antidote to potential variable injection and poisoning
|
| 42 |
+
unset ( $key );
|
| 43 |
+
unset ( $value );
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
$paramString = "";
|
| 48 |
+
foreach ( $_POST as $paramName => $paramValue ) {
|
| 49 |
+
$params [$paramName] = $paramValue;
|
| 50 |
+
if ($paramName != "username" && $paramName != "password") {
|
| 51 |
+
$paramString .= "$paramName=$paramValue;";
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
foreach ( $_GET as $paramName => $paramValue ) {
|
| 55 |
+
$params [$paramName] = $paramValue;
|
| 56 |
+
if ($paramName != "username" && $paramName != "password") {
|
| 57 |
+
$paramString .= "$paramName=$paramValue;";
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
if ($params ['username'] != Mage::getStoreConfig( 'payment/net/security_username' ) || $params ['password'] != Mage::getStoreConfig( 'payment/net/security_password' )) {
|
| 62 |
+
// Usually this means you haven't configured your
|
| 63 |
+
// security username and security password correctly in
|
| 64 |
+
// virtuemart payway net module configuration.
|
| 65 |
+
// If your settings are exactly right, someone's trying
|
| 66 |
+
// to send a fraudulent payment notification.
|
| 67 |
+
header ( "HTTP/1.1 403 Incorrect Username and Password" );
|
| 68 |
+
echo "Incorrect Username and password";
|
| 69 |
+
}
|
| 70 |
+
else
|
| 71 |
+
{
|
| 72 |
+
if ( Mage::getModel('net/paymentNotify')->savePayment( $params ) ) {
|
| 73 |
+
// Tell PayWay that everything's fine
|
| 74 |
+
echo "Success";
|
| 75 |
+
} else {
|
| 76 |
+
// If error results, return HTTP 500
|
| 77 |
+
header ( "HTTP/1.1 500 Database error while updating order status" );
|
| 78 |
+
echo ("Database error while updating order status");
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
}
|
app/code/local/PayWay/Net/etc/config.xml
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* @category PayWay
|
| 5 |
+
* @package PayWay_Net
|
| 6 |
+
* @author Qvalent
|
| 7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 8 |
+
*/
|
| 9 |
+
-->
|
| 10 |
+
<config>
|
| 11 |
+
<modules>
|
| 12 |
+
<PayWay_Net>
|
| 13 |
+
<version>0.1.0</version>
|
| 14 |
+
</PayWay_Net>
|
| 15 |
+
</modules>
|
| 16 |
+
<frontend>
|
| 17 |
+
<routers>
|
| 18 |
+
<net>
|
| 19 |
+
<use>standard</use>
|
| 20 |
+
<args>
|
| 21 |
+
<module>PayWay_Net</module>
|
| 22 |
+
<frontName>net</frontName>
|
| 23 |
+
</args>
|
| 24 |
+
</net>
|
| 25 |
+
</routers>
|
| 26 |
+
</frontend>
|
| 27 |
+
<global>
|
| 28 |
+
<models>
|
| 29 |
+
<net>
|
| 30 |
+
<class>PayWay_Net_Model</class>
|
| 31 |
+
<resourceModel>net_mysql4</resourceModel>
|
| 32 |
+
</net>
|
| 33 |
+
<net_mysql4>
|
| 34 |
+
<class>PayWay_Net_Model_Mysql4</class>
|
| 35 |
+
<entities>
|
| 36 |
+
<net>
|
| 37 |
+
<table>net</table>
|
| 38 |
+
</net>
|
| 39 |
+
</entities>
|
| 40 |
+
</net_mysql4>
|
| 41 |
+
</models>
|
| 42 |
+
<resources>
|
| 43 |
+
<net_setup>
|
| 44 |
+
<setup>
|
| 45 |
+
<module>PayWay_Net</module>
|
| 46 |
+
</setup>
|
| 47 |
+
<connection>
|
| 48 |
+
<use>core_setup</use>
|
| 49 |
+
</connection>
|
| 50 |
+
</net_setup>
|
| 51 |
+
<net_write>
|
| 52 |
+
<connection>
|
| 53 |
+
<use>core_write</use>
|
| 54 |
+
</connection>
|
| 55 |
+
</net_write>
|
| 56 |
+
<net_read>
|
| 57 |
+
<connection>
|
| 58 |
+
<use>core_read</use>
|
| 59 |
+
</connection>
|
| 60 |
+
</net_read>
|
| 61 |
+
</resources>
|
| 62 |
+
<blocks>
|
| 63 |
+
<net>
|
| 64 |
+
<class>PayWay_Net_Block</class>
|
| 65 |
+
</net>
|
| 66 |
+
</blocks>
|
| 67 |
+
<helpers>
|
| 68 |
+
<net>
|
| 69 |
+
<class>PayWay_Net_Helper</class>
|
| 70 |
+
</net>
|
| 71 |
+
</helpers>
|
| 72 |
+
</global>
|
| 73 |
+
<default>
|
| 74 |
+
<payment>
|
| 75 |
+
<net>
|
| 76 |
+
<model>net/net</model>
|
| 77 |
+
<title>Credit Card (via PayWay Secure Payment)</title>
|
| 78 |
+
<payment_action>Sale</payment_action>
|
| 79 |
+
<line_items_enabled>1</line_items_enabled>
|
| 80 |
+
<biller_code />
|
| 81 |
+
<merchant_id>TEST</merchant_id>
|
| 82 |
+
<security_username />
|
| 83 |
+
<security_password />
|
| 84 |
+
<proxy_host />
|
| 85 |
+
<proxy_port />
|
| 86 |
+
<proxy_username />
|
| 87 |
+
<proxy_password />
|
| 88 |
+
<payway_url>https://www.payway.com.au/</payway_url>
|
| 89 |
+
</net>
|
| 90 |
+
</payment>
|
| 91 |
+
</default>
|
| 92 |
+
</config>
|
app/code/local/PayWay/Net/etc/system.xml
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<config>
|
| 3 |
+
<sections>
|
| 4 |
+
<payment>
|
| 5 |
+
<groups>
|
| 6 |
+
<net translate="label" module="net">
|
| 7 |
+
<label>PayWay Net</label>
|
| 8 |
+
<sort_order>670</sort_order>
|
| 9 |
+
<show_in_default>1</show_in_default>
|
| 10 |
+
<show_in_website>1</show_in_website>
|
| 11 |
+
<show_in_store>0</show_in_store>
|
| 12 |
+
<fields>
|
| 13 |
+
<active translate="label">
|
| 14 |
+
<label>Enabled</label>
|
| 15 |
+
<frontend_type>select</frontend_type>
|
| 16 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 17 |
+
<sort_order>1</sort_order>
|
| 18 |
+
<show_in_default>1</show_in_default>
|
| 19 |
+
<show_in_website>1</show_in_website>
|
| 20 |
+
<show_in_store>0</show_in_store>
|
| 21 |
+
</active>
|
| 22 |
+
<title translate="label">
|
| 23 |
+
<label>Title</label>
|
| 24 |
+
<frontend_type>text</frontend_type>
|
| 25 |
+
<sort_order>2</sort_order>
|
| 26 |
+
<show_in_default>1</show_in_default>
|
| 27 |
+
<show_in_website>1</show_in_website>
|
| 28 |
+
<show_in_store>0</show_in_store>
|
| 29 |
+
</title>
|
| 30 |
+
<biller_code translate="label">
|
| 31 |
+
<label>Biller Code</label>
|
| 32 |
+
<frontend_type>text</frontend_type>
|
| 33 |
+
<sort_order>3</sort_order>
|
| 34 |
+
<show_in_default>1</show_in_default>
|
| 35 |
+
<show_in_website>1</show_in_website>
|
| 36 |
+
<show_in_store>0</show_in_store>
|
| 37 |
+
</biller_code>
|
| 38 |
+
<merchant_id translate="label">
|
| 39 |
+
<label>Merchant ID (TEST for test mode)</label>
|
| 40 |
+
<frontend_type>text</frontend_type>
|
| 41 |
+
<sort_order>4</sort_order>
|
| 42 |
+
<show_in_default>1</show_in_default>
|
| 43 |
+
<show_in_website>1</show_in_website>
|
| 44 |
+
<show_in_store>0</show_in_store>
|
| 45 |
+
</merchant_id>
|
| 46 |
+
<security_username translate="label">
|
| 47 |
+
<label>Security Username</label>
|
| 48 |
+
<frontend_type>text</frontend_type>
|
| 49 |
+
<sort_order>6</sort_order>
|
| 50 |
+
<show_in_default>1</show_in_default>
|
| 51 |
+
<show_in_website>1</show_in_website>
|
| 52 |
+
<show_in_store>0</show_in_store>
|
| 53 |
+
</security_username>
|
| 54 |
+
<security_password translate="label">
|
| 55 |
+
<label>Security Password</label>
|
| 56 |
+
<frontend_type>text</frontend_type>
|
| 57 |
+
<sort_order>7</sort_order>
|
| 58 |
+
<show_in_default>1</show_in_default>
|
| 59 |
+
<show_in_website>1</show_in_website>
|
| 60 |
+
<show_in_store>0</show_in_store>
|
| 61 |
+
</security_password>
|
| 62 |
+
<proxy_host translate="label">
|
| 63 |
+
<label>Proxy Host</label>
|
| 64 |
+
<frontend_type>text</frontend_type>
|
| 65 |
+
<sort_order>8</sort_order>
|
| 66 |
+
<show_in_default>1</show_in_default>
|
| 67 |
+
<show_in_website>1</show_in_website>
|
| 68 |
+
<show_in_store>0</show_in_store>
|
| 69 |
+
</proxy_host>
|
| 70 |
+
<proxy_port translate="label">
|
| 71 |
+
<label>Proxy Port</label>
|
| 72 |
+
<frontend_type>text</frontend_type>
|
| 73 |
+
<sort_order>9</sort_order>
|
| 74 |
+
<show_in_default>1</show_in_default>
|
| 75 |
+
<show_in_website>1</show_in_website>
|
| 76 |
+
<show_in_store>0</show_in_store>
|
| 77 |
+
</proxy_port>
|
| 78 |
+
<proxy_username translate="label">
|
| 79 |
+
<label>Proxy Username</label>
|
| 80 |
+
<frontend_type>text</frontend_type>
|
| 81 |
+
<sort_order>10</sort_order>
|
| 82 |
+
<show_in_default>1</show_in_default>
|
| 83 |
+
<show_in_website>1</show_in_website>
|
| 84 |
+
<show_in_store>0</show_in_store>
|
| 85 |
+
</proxy_username>
|
| 86 |
+
<proxy_password translate="label">
|
| 87 |
+
<label>Proxy Password</label>
|
| 88 |
+
<frontend_type>text</frontend_type>
|
| 89 |
+
<sort_order>11</sort_order>
|
| 90 |
+
<show_in_default>1</show_in_default>
|
| 91 |
+
<show_in_website>1</show_in_website>
|
| 92 |
+
<show_in_store>0</show_in_store>
|
| 93 |
+
</proxy_password>
|
| 94 |
+
<payway_url translate="label">
|
| 95 |
+
<label>PayWay URL</label>
|
| 96 |
+
<frontend_type>text</frontend_type>
|
| 97 |
+
<sort_order>12</sort_order>
|
| 98 |
+
<show_in_default>1</show_in_default>
|
| 99 |
+
<show_in_website>1</show_in_website>
|
| 100 |
+
<show_in_store>0</show_in_store>
|
| 101 |
+
</payway_url>
|
| 102 |
+
</fields>
|
| 103 |
+
</net>
|
| 104 |
+
</groups>
|
| 105 |
+
</payment>
|
| 106 |
+
</sections>
|
| 107 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>PayWay_Net</name>
|
| 4 |
+
<version>1.0.2</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>This extension allows secure payments through the PayWay payment gateway, using the Net payment method.</summary>
|
| 10 |
+
<description>This extension allows secure payments through the PayWay payment gateway, using the Net payment method.
|
| 11 |
+

|
| 12 |
+
It uses secure token request to prevent malicious users from tampering with order data, and server-to-server notification to confirm order payment or payment failure.
|
| 13 |
+

|
| 14 |
+
Note: This requires your server have a valid SSL certificate installed from a commonly trusted certificate authority.</description>
|
| 15 |
+
<notes>Deploying to Magento Connect</notes>
|
| 16 |
+
<authors><author><name>Frans</name><user>auto-converted</user><email>fhenskens@yahoo.com</email></author></authors>
|
| 17 |
+
<date>2011-05-04</date>
|
| 18 |
+
<time>06:29:12</time>
|
| 19 |
+
<contents><target name="magelocal"><dir name="PayWay"><dir name="Net"><dir name="Helper"><file name="Data.php" hash="713283cbc45ea65b764fef0d956d7377"/></dir><dir name="Model"><file name="Net.php" hash="4aad59ecb752d54a44afe6aa3a905f72"/><file name="PaymentNotify.php" hash="0ce582d36dd2ec43db1bc75113083e63"/></dir><dir name="controllers"><file name="PaymentController.php" hash="de03cf4919d22af47a277c7710e892bd"/></dir><dir name="etc"><file name="config.xml" hash="519062de0cbab1bfd2a8dcd35644a128"/><file name="system.xml" hash="7aec3ec2933101aeb5389dc344ae4cbe"/></dir></dir></dir></target></contents>
|
| 20 |
+
<compatible/>
|
| 21 |
+
<dependencies/>
|
| 22 |
+
</package>
|
