Version Notes
Resolve Payment Flow Process
Now it will do Authorization-Capture Model
Download this release
Release Info
| Developer | faisal |
| Extension | worldpayzaq12wsx |
| Version | 1.1.4 |
| Comparing to | |
| See all releases | |
Code changes from version 1.1.3 to 1.1.4
- app/code/local/WorldPayTech/.DS_Store +0 -0
- app/code/local/WorldPayTech/WorldAch/Model/PaymentMethod.php +14 -12
- app/code/local/WorldPayTech/WorldAch/etc/config.xml +1 -1
- app/code/local/WorldPayTech/WorldPay/.DS_Store +0 -0
- app/code/local/WorldPayTech/WorldPay/Model/.DS_Store +0 -0
- app/code/local/WorldPayTech/WorldPay/Model/PaymentHelper.php +4 -1
- app/code/local/WorldPayTech/WorldPay/Model/PaymentMethod.php +52 -47
- app/code/local/WorldPayTech/WorldPay/etc/config.xml +1 -1
- app/code/local/WorldPayTech/WorldProfile/Model/PaymentMethod.php +18 -14
- app/code/local/WorldPayTech/WorldProfile/etc/config.xml +1 -1
- package.xml +6 -5
app/code/local/WorldPayTech/.DS_Store
CHANGED
|
Binary file
|
app/code/local/WorldPayTech/WorldAch/Model/PaymentMethod.php
CHANGED
|
@@ -40,7 +40,14 @@ class WorldPayTech_WorldAch_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 40 |
Mage::log("Payment Method assignData ");
|
| 41 |
return $this;
|
| 42 |
}
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
$order = $payment->getOrder();
|
| 45 |
try {
|
| 46 |
Mage::log('WorldAch Authorize!');
|
|
@@ -146,12 +153,7 @@ class WorldPayTech_WorldAch_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 146 |
return $this;
|
| 147 |
}
|
| 148 |
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
// this function is not in used /////
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
}
|
| 155 |
public function validate()
|
| 156 |
{
|
| 157 |
/*
|
|
@@ -178,7 +180,7 @@ class WorldPayTech_WorldAch_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 178 |
Mage::log('WorldPay Profile Refund!');
|
| 179 |
|
| 180 |
|
| 181 |
-
$temp_transaction_id=$payment->getLastTransId();
|
| 182 |
$dash_pos = strpos($temp_transaction_id, "-");
|
| 183 |
$transaction_id=substr($temp_transaction_id,0,$dash_pos);
|
| 184 |
if($transaction_id=="")
|
|
@@ -277,19 +279,19 @@ class WorldPayTech_WorldAch_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 277 |
return $this;
|
| 278 |
}
|
| 279 |
|
| 280 |
-
|
| 281 |
|
| 282 |
// void the order if canceled
|
|
|
|
| 283 |
Mage::log('Order: cancel!');
|
| 284 |
-
|
| 285 |
-
return $this;
|
| 286 |
}
|
| 287 |
|
| 288 |
public function void(Varien_Object $payment) {
|
| 289 |
|
| 290 |
|
| 291 |
Mage::log('Order: void!');
|
| 292 |
-
|
| 293 |
/* Whatever you call to void a payment in your gateway */
|
| 294 |
}
|
| 295 |
|
| 40 |
Mage::log("Payment Method assignData ");
|
| 41 |
return $this;
|
| 42 |
}
|
| 43 |
+
public function authorize(Varien_Object $payment, $amount) {
|
| 44 |
+
|
| 45 |
+
// this function is not in used /////
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
public function capture(Varien_Object $payment, $amount) {
|
| 51 |
$order = $payment->getOrder();
|
| 52 |
try {
|
| 53 |
Mage::log('WorldAch Authorize!');
|
| 153 |
return $this;
|
| 154 |
}
|
| 155 |
|
| 156 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
public function validate()
|
| 158 |
{
|
| 159 |
/*
|
| 180 |
Mage::log('WorldPay Profile Refund!');
|
| 181 |
|
| 182 |
|
| 183 |
+
$temp_transaction_id=$payment->getLastTransId()."-";
|
| 184 |
$dash_pos = strpos($temp_transaction_id, "-");
|
| 185 |
$transaction_id=substr($temp_transaction_id,0,$dash_pos);
|
| 186 |
if($transaction_id=="")
|
| 279 |
return $this;
|
| 280 |
}
|
| 281 |
|
| 282 |
+
public function cancel(Varien_Object $payment) {
|
| 283 |
|
| 284 |
// void the order if canceled
|
| 285 |
+
|
| 286 |
Mage::log('Order: cancel!');
|
| 287 |
+
Mage::throwException("Payment Could not be refund, Kindly use Refund Process Using CreditMemo");
|
|
|
|
| 288 |
}
|
| 289 |
|
| 290 |
public function void(Varien_Object $payment) {
|
| 291 |
|
| 292 |
|
| 293 |
Mage::log('Order: void!');
|
| 294 |
+
Mage::throwException("Payment Could not be refund, Kindly use Refund Process Using CreditMemo");
|
| 295 |
/* Whatever you call to void a payment in your gateway */
|
| 296 |
}
|
| 297 |
|
app/code/local/WorldPayTech/WorldAch/etc/config.xml
CHANGED
|
@@ -74,7 +74,7 @@
|
|
| 74 |
<title>WorldPay ACH</title>
|
| 75 |
|
| 76 |
<cctypes>AE,VI,MC,DI</cctypes>
|
| 77 |
-
<payment_action>
|
| 78 |
<allowspecific>0</allowspecific>
|
| 79 |
</worldach>
|
| 80 |
</payment>
|
| 74 |
<title>WorldPay ACH</title>
|
| 75 |
|
| 76 |
<cctypes>AE,VI,MC,DI</cctypes>
|
| 77 |
+
<payment_action>authorize_capture</payment_action>
|
| 78 |
<allowspecific>0</allowspecific>
|
| 79 |
</worldach>
|
| 80 |
</payment>
|
app/code/local/WorldPayTech/WorldPay/.DS_Store
CHANGED
|
Binary file
|
app/code/local/WorldPayTech/WorldPay/Model/.DS_Store
ADDED
|
Binary file
|
app/code/local/WorldPayTech/WorldPay/Model/PaymentHelper.php
CHANGED
|
@@ -22,6 +22,9 @@ class WorldPayTech_WorldPay_Model_PaymentHelper extends Mage_Paygate_Model_Autho
|
|
| 22 |
* public function can* for each flag respectively
|
| 23 |
*/
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
/**
|
| 26 |
* Is this payment method a gateway (online auth/charge) ?
|
| 27 |
*/
|
|
@@ -50,7 +53,7 @@ class WorldPayTech_WorldPay_Model_PaymentHelper extends Mage_Paygate_Model_Autho
|
|
| 50 |
/**
|
| 51 |
* Can void transactions online?
|
| 52 |
*/
|
| 53 |
-
protected $_canVoid =
|
| 54 |
|
| 55 |
/**
|
| 56 |
* Can use this payment method in administration panel?
|
| 22 |
* public function can* for each flag respectively
|
| 23 |
*/
|
| 24 |
|
| 25 |
+
protected $_canProcess = true;
|
| 26 |
+
|
| 27 |
+
|
| 28 |
/**
|
| 29 |
* Is this payment method a gateway (online auth/charge) ?
|
| 30 |
*/
|
| 53 |
/**
|
| 54 |
* Can void transactions online?
|
| 55 |
*/
|
| 56 |
+
protected $_canVoid = false;
|
| 57 |
|
| 58 |
/**
|
| 59 |
* Can use this payment method in administration panel?
|
app/code/local/WorldPayTech/WorldPay/Model/PaymentMethod.php
CHANGED
|
@@ -34,12 +34,21 @@ class WorldPayTech_WorldPay_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 34 |
*/
|
| 35 |
|
| 36 |
public function authorize(Varien_Object $payment, $amount) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
$order = $payment->getOrder();
|
| 38 |
try {
|
| 39 |
-
Mage::log('PrismPay CC
|
| 40 |
|
| 41 |
|
| 42 |
-
$is_applyForProfileAdd
|
| 43 |
|
| 44 |
|
| 45 |
|
|
@@ -73,15 +82,18 @@ class WorldPayTech_WorldPay_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 73 |
'currencycode' => $order->getBaseCurrencyCode(),
|
| 74 |
);
|
| 75 |
|
|
|
|
|
|
|
| 76 |
if($is_applyForProfileAdd=="1")
|
| 77 |
{
|
| 78 |
$fields["service"]=7;
|
| 79 |
-
|
| 80 |
-
}
|
|
|
|
| 81 |
{
|
| 82 |
$fields["service"]=2;
|
| 83 |
}
|
| 84 |
-
|
| 85 |
|
| 86 |
|
| 87 |
$fields_string = "<?xml version=\"1.0\"?><interface_driver><trans_catalog><transaction name=\"creditcard\"><inputs>";
|
|
@@ -113,13 +125,15 @@ class WorldPayTech_WorldPay_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 113 |
ob_end_clean();
|
| 114 |
error_log($contents);
|
| 115 |
|
| 116 |
-
|
| 117 |
$transactionId=$outputs->historyid;
|
| 118 |
if ($outputs->status == "Approved") {
|
|
|
|
|
|
|
| 119 |
$this->setStore($payment->getOrder()->getStoreId());
|
| 120 |
$payment->setStatus(self::STATUS_APPROVED);
|
| 121 |
$payment->setAmount($amount);
|
| 122 |
-
$payment->setLastTransId($
|
| 123 |
|
| 124 |
//save profile id of customer in to database
|
| 125 |
$transactionData=array(
|
|
@@ -138,49 +152,46 @@ class WorldPayTech_WorldPay_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 138 |
|
| 139 |
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
| 140 |
//get customer id
|
| 141 |
-
|
| 142 |
-
|
| 143 |
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
|
| 168 |
-
|
| 169 |
|
| 170 |
}
|
| 171 |
-
|
| 172 |
$payment->setTransactionId($transactionId);
|
| 173 |
$payment->setIsTransactionClosed(0);
|
| 174 |
$payment->setParentTransactionId($transactionId);
|
| 175 |
$payment->setTransactionAdditionalInfo(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, $transactionData);
|
| 176 |
|
| 177 |
-
|
| 178 |
-
|
| 179 |
|
| 180 |
} else {
|
| 181 |
$payment->setStatus(self::STATUS_ERROR);
|
| 182 |
$payment->setAmount($amount);
|
| 183 |
-
$payment->setLastTransId($
|
| 184 |
$this->setStore($payment->getOrder()->getStoreId());
|
| 185 |
if ($this->__debugMode == 1) {
|
| 186 |
Mage::throwException("XMl=" . $fields_string . "\n\nAccount=" . $this->__accountID . "\n\nSub Account=" . $this->__subAccountID . "\n\nTest Mode=" . $this->__testMode . "\n\nDebuge Mode=" . $this->__debugMode);
|
|
@@ -191,12 +202,6 @@ class WorldPayTech_WorldPay_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 191 |
return $this;
|
| 192 |
}
|
| 193 |
|
| 194 |
-
public function capture(Varien_Object $payment, $amount) {
|
| 195 |
-
|
| 196 |
-
// this function is not in used we charged customer credit card in authoriza function/////
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
}
|
| 200 |
|
| 201 |
/**
|
| 202 |
* Payment refund
|
|
@@ -214,7 +219,7 @@ class WorldPayTech_WorldPay_Model_PaymentMethod extends WorldPayTech_WorldPay_Mo
|
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
-
$temp_transaction_id=$payment->getLastTransId();
|
| 218 |
$dash_pos = strpos($temp_transaction_id, "-");
|
| 219 |
$transaction_id=substr($temp_transaction_id,0,$dash_pos);
|
| 220 |
if($transaction_id=="")
|
|
@@ -314,16 +319,16 @@ Mage::log('Data '.$fields_string);
|
|
| 314 |
public function cancel(Varien_Object $payment) {
|
| 315 |
|
| 316 |
// void the order if canceled
|
|
|
|
| 317 |
Mage::log('Order: cancel!');
|
| 318 |
-
|
| 319 |
-
return $this;
|
| 320 |
}
|
| 321 |
|
| 322 |
public function void(Varien_Object $payment) {
|
| 323 |
|
| 324 |
|
| 325 |
Mage::log('Order: void!');
|
| 326 |
-
|
| 327 |
/* Whatever you call to void a payment in your gateway */
|
| 328 |
}
|
| 329 |
|
| 34 |
*/
|
| 35 |
|
| 36 |
public function authorize(Varien_Object $payment, $amount) {
|
| 37 |
+
|
| 38 |
+
Mage::log('PrismPay CC Authorize!');
|
| 39 |
+
|
| 40 |
+
// this function is not in used we charged customer credit card in authoriza function/////
|
| 41 |
+
return $this;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
public function capture(Varien_Object $payment, $amount) {
|
| 45 |
+
|
| 46 |
$order = $payment->getOrder();
|
| 47 |
try {
|
| 48 |
+
Mage::log('PrismPay CC Capture!');
|
| 49 |
|
| 50 |
|
| 51 |
+
$is_applyForProfileAdd=@$_REQUEST["payment"]["add_profile"];
|
| 52 |
|
| 53 |
|
| 54 |
|
| 82 |
'currencycode' => $order->getBaseCurrencyCode(),
|
| 83 |
);
|
| 84 |
|
| 85 |
+
|
| 86 |
+
//doing authorization
|
| 87 |
if($is_applyForProfileAdd=="1")
|
| 88 |
{
|
| 89 |
$fields["service"]=7;
|
| 90 |
+
$fields["profileactiontype"]=2;
|
| 91 |
+
}
|
| 92 |
+
else
|
| 93 |
{
|
| 94 |
$fields["service"]=2;
|
| 95 |
}
|
| 96 |
+
|
| 97 |
|
| 98 |
|
| 99 |
$fields_string = "<?xml version=\"1.0\"?><interface_driver><trans_catalog><transaction name=\"creditcard\"><inputs>";
|
| 125 |
ob_end_clean();
|
| 126 |
error_log($contents);
|
| 127 |
|
| 128 |
+
//$orderId=$order->getId();
|
| 129 |
$transactionId=$outputs->historyid;
|
| 130 |
if ($outputs->status == "Approved") {
|
| 131 |
+
|
| 132 |
+
|
| 133 |
$this->setStore($payment->getOrder()->getStoreId());
|
| 134 |
$payment->setStatus(self::STATUS_APPROVED);
|
| 135 |
$payment->setAmount($amount);
|
| 136 |
+
$payment->setLastTransId($transactionId);
|
| 137 |
|
| 138 |
//save profile id of customer in to database
|
| 139 |
$transactionData=array(
|
| 152 |
|
| 153 |
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
| 154 |
//get customer id
|
| 155 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
| 156 |
+
$customer_id=$customerData->getId();
|
| 157 |
|
| 158 |
+
$connectionWrite = Mage::getSingleton('core/resource')->getConnection('core_write');
|
| 159 |
+
$connectionWrite->beginTransaction();
|
| 160 |
+
|
| 161 |
+
//create customer profile table if not created
|
| 162 |
+
$createQuery="CREATE TABLE IF NOT EXISTS 'customer_profile' (
|
| 163 |
+
'id' int(11) NOT NULL AUTO_INCREMENT,
|
| 164 |
+
'customer_id' varchar(50) NOT NULL,
|
| 165 |
+
'profile_id' varchar(50) NOT NULL,
|
| 166 |
+
'last_4_digit' varchar(20) NOT NULL,
|
| 167 |
+
PRIMARY KEY ('id')
|
| 168 |
+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
|
| 169 |
+
//$results = $connectionWrite->fetchAll($createQuery);
|
| 170 |
+
|
| 171 |
+
|
| 172 |
+
$data = array();
|
| 173 |
+
$data['profile_id']= $outputs->userprofileid;
|
| 174 |
+
$data['last_4_digit']=$outputs->last4digits;
|
| 175 |
+
$data['customer_id']=$customer_id;
|
| 176 |
+
$connectionWrite->insert('customer_profile', $data);
|
| 177 |
+
$connectionWrite->commit();
|
| 178 |
+
|
| 179 |
+
$transactionData['profile_id']= "".$outputs->userprofileid."";
|
| 180 |
+
$transactionData['last_4_digit']="".$outputs->last4digits."";
|
| 181 |
|
| 182 |
+
}
|
| 183 |
|
| 184 |
}
|
|
|
|
| 185 |
$payment->setTransactionId($transactionId);
|
| 186 |
$payment->setIsTransactionClosed(0);
|
| 187 |
$payment->setParentTransactionId($transactionId);
|
| 188 |
$payment->setTransactionAdditionalInfo(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, $transactionData);
|
| 189 |
|
|
|
|
|
|
|
| 190 |
|
| 191 |
} else {
|
| 192 |
$payment->setStatus(self::STATUS_ERROR);
|
| 193 |
$payment->setAmount($amount);
|
| 194 |
+
$payment->setLastTransId($transactionId);
|
| 195 |
$this->setStore($payment->getOrder()->getStoreId());
|
| 196 |
if ($this->__debugMode == 1) {
|
| 197 |
Mage::throwException("XMl=" . $fields_string . "\n\nAccount=" . $this->__accountID . "\n\nSub Account=" . $this->__subAccountID . "\n\nTest Mode=" . $this->__testMode . "\n\nDebuge Mode=" . $this->__debugMode);
|
| 202 |
return $this;
|
| 203 |
}
|
| 204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
|
| 206 |
/**
|
| 207 |
* Payment refund
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
+
$temp_transaction_id=$payment->getLastTransId()."-";
|
| 223 |
$dash_pos = strpos($temp_transaction_id, "-");
|
| 224 |
$transaction_id=substr($temp_transaction_id,0,$dash_pos);
|
| 225 |
if($transaction_id=="")
|
| 319 |
public function cancel(Varien_Object $payment) {
|
| 320 |
|
| 321 |
// void the order if canceled
|
| 322 |
+
|
| 323 |
Mage::log('Order: cancel!');
|
| 324 |
+
Mage::throwException("Payment Could not be refund, Kindly use Refund Process Using CreditMemo");
|
|
|
|
| 325 |
}
|
| 326 |
|
| 327 |
public function void(Varien_Object $payment) {
|
| 328 |
|
| 329 |
|
| 330 |
Mage::log('Order: void!');
|
| 331 |
+
Mage::throwException("Payment Could not be refund, Kindly use Refund Process Using CreditMemo");
|
| 332 |
/* Whatever you call to void a payment in your gateway */
|
| 333 |
}
|
| 334 |
|
app/code/local/WorldPayTech/WorldPay/etc/config.xml
CHANGED
|
@@ -68,7 +68,7 @@
|
|
| 68 |
<title>Credit Card (worldpay)</title>
|
| 69 |
|
| 70 |
<cctypes>AE,VI,MC,DI</cctypes>
|
| 71 |
-
<payment_action>
|
| 72 |
<allowspecific>0</allowspecific>
|
| 73 |
</worldpay>
|
| 74 |
</payment>
|
| 68 |
<title>Credit Card (worldpay)</title>
|
| 69 |
|
| 70 |
<cctypes>AE,VI,MC,DI</cctypes>
|
| 71 |
+
<payment_action>authorize_capture</payment_action>
|
| 72 |
<allowspecific>0</allowspecific>
|
| 73 |
</worldpay>
|
| 74 |
</payment>
|
app/code/local/WorldPayTech/WorldProfile/Model/PaymentMethod.php
CHANGED
|
@@ -24,10 +24,20 @@ class WorldPayTech_WorldProfile_Model_PaymentMethod extends WorldPayTech_WorldPa
|
|
| 24 |
* In this function i charge credit card and mark order as completed
|
| 25 |
*/
|
| 26 |
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
$order = $payment->getOrder();
|
| 29 |
try {
|
| 30 |
-
Mage::log('PrismProfile
|
| 31 |
|
| 32 |
$temp_profile_id=explode("-",$_REQUEST["payment"]["profile_id"]);
|
| 33 |
$profile_id=$temp_profile_id[0];
|
|
@@ -115,12 +125,7 @@ class WorldPayTech_WorldProfile_Model_PaymentMethod extends WorldPayTech_WorldPa
|
|
| 115 |
return $this;
|
| 116 |
}
|
| 117 |
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
// this function is not in used /////
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
}
|
| 124 |
public function validate()
|
| 125 |
{
|
| 126 |
/*
|
|
@@ -147,7 +152,7 @@ class WorldPayTech_WorldProfile_Model_PaymentMethod extends WorldPayTech_WorldPa
|
|
| 147 |
Mage::log('PrismPay Profile Refund!');
|
| 148 |
|
| 149 |
|
| 150 |
-
$temp_transaction_id=$payment->getLastTransId();
|
| 151 |
$dash_pos = strpos($temp_transaction_id, "-");
|
| 152 |
$transaction_id=substr($temp_transaction_id,0,$dash_pos);
|
| 153 |
if($transaction_id=="")
|
|
@@ -246,22 +251,21 @@ class WorldPayTech_WorldProfile_Model_PaymentMethod extends WorldPayTech_WorldPa
|
|
| 246 |
return $this;
|
| 247 |
}
|
| 248 |
|
| 249 |
-
|
| 250 |
|
| 251 |
// void the order if canceled
|
|
|
|
| 252 |
Mage::log('Order: cancel!');
|
| 253 |
-
|
| 254 |
-
return $this;
|
| 255 |
}
|
| 256 |
|
| 257 |
public function void(Varien_Object $payment) {
|
| 258 |
|
| 259 |
|
| 260 |
Mage::log('Order: void!');
|
| 261 |
-
|
| 262 |
/* Whatever you call to void a payment in your gateway */
|
| 263 |
}
|
| 264 |
-
|
| 265 |
}
|
| 266 |
|
| 267 |
?>
|
| 24 |
* In this function i charge credit card and mark order as completed
|
| 25 |
*/
|
| 26 |
|
| 27 |
+
|
| 28 |
+
public function authorize(Varien_Object $payment, $amount) {
|
| 29 |
+
|
| 30 |
+
// this function is not in used /////
|
| 31 |
+
|
| 32 |
+
Mage::log('PrismProfile Authorize!');
|
| 33 |
+
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
public function capture(Varien_Object $payment, $amount) {
|
| 38 |
$order = $payment->getOrder();
|
| 39 |
try {
|
| 40 |
+
Mage::log('PrismProfile Capture!');
|
| 41 |
|
| 42 |
$temp_profile_id=explode("-",$_REQUEST["payment"]["profile_id"]);
|
| 43 |
$profile_id=$temp_profile_id[0];
|
| 125 |
return $this;
|
| 126 |
}
|
| 127 |
|
| 128 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
public function validate()
|
| 130 |
{
|
| 131 |
/*
|
| 152 |
Mage::log('PrismPay Profile Refund!');
|
| 153 |
|
| 154 |
|
| 155 |
+
$temp_transaction_id=$payment->getLastTransId()."-";
|
| 156 |
$dash_pos = strpos($temp_transaction_id, "-");
|
| 157 |
$transaction_id=substr($temp_transaction_id,0,$dash_pos);
|
| 158 |
if($transaction_id=="")
|
| 251 |
return $this;
|
| 252 |
}
|
| 253 |
|
| 254 |
+
public function cancel(Varien_Object $payment) {
|
| 255 |
|
| 256 |
// void the order if canceled
|
| 257 |
+
|
| 258 |
Mage::log('Order: cancel!');
|
| 259 |
+
Mage::throwException("Payment Could not be refund, Kindly use Refund Process Using CreditMemo");
|
|
|
|
| 260 |
}
|
| 261 |
|
| 262 |
public function void(Varien_Object $payment) {
|
| 263 |
|
| 264 |
|
| 265 |
Mage::log('Order: void!');
|
| 266 |
+
Mage::throwException("Payment Could not be refund, Kindly use Refund Process Using CreditMemo");
|
| 267 |
/* Whatever you call to void a payment in your gateway */
|
| 268 |
}
|
|
|
|
| 269 |
}
|
| 270 |
|
| 271 |
?>
|
app/code/local/WorldPayTech/WorldProfile/etc/config.xml
CHANGED
|
@@ -74,7 +74,7 @@
|
|
| 74 |
<title>CreditCard Profile</title>
|
| 75 |
|
| 76 |
<cctypes>AE,VI,MC,DI</cctypes>
|
| 77 |
-
<payment_action>
|
| 78 |
<allowspecific>0</allowspecific>
|
| 79 |
</worldprofile>
|
| 80 |
</payment>
|
| 74 |
<title>CreditCard Profile</title>
|
| 75 |
|
| 76 |
<cctypes>AE,VI,MC,DI</cctypes>
|
| 77 |
+
<payment_action>authorize_capture</payment_action>
|
| 78 |
<allowspecific>0</allowspecific>
|
| 79 |
</worldprofile>
|
| 80 |
</payment>
|
package.xml
CHANGED
|
@@ -1,18 +1,19 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>worldpayzaq12wsx</name>
|
| 4 |
-
<version>1.1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>WorldPay License</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>WorldPay Payment GateWay</summary>
|
| 10 |
<description>WorldPay Payment GateWay</description>
|
| 11 |
-
<notes>Resolve
|
|
|
|
| 12 |
<authors><author><name>faisal</name><user>faisalshamsi</user><email>faisalsharifshamsi@gmail.com</email></author></authors>
|
| 13 |
-
<date>2015-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magelocal"><dir name="WorldPayTech"><dir name="WorldAch"><dir name="Block"><file name="Form.php" hash="09f36e1fcbca210c0c0d051ee8c2eb8e"/><file name="Info.php" hash="0467a5ce61e19094a681b56a381e6735"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="eb3746c14752eebd4fa182bee93b4cac"/></dir><dir name="Model"><file name="PaymentMethod.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>worldpayzaq12wsx</name>
|
| 4 |
+
<version>1.1.4</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>WorldPay License</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>WorldPay Payment GateWay</summary>
|
| 10 |
<description>WorldPay Payment GateWay</description>
|
| 11 |
+
<notes>Resolve Payment Flow Process
|
| 12 |
+
Now it will do Authorization-Capture Model</notes>
|
| 13 |
<authors><author><name>faisal</name><user>faisalshamsi</user><email>faisalsharifshamsi@gmail.com</email></author></authors>
|
| 14 |
+
<date>2015-03-05</date>
|
| 15 |
+
<time>11:08:01</time>
|
| 16 |
+
<contents><target name="magelocal"><dir name="WorldPayTech"><dir name="WorldAch"><dir name="Block"><file name="Form.php" hash="09f36e1fcbca210c0c0d051ee8c2eb8e"/><file name="Info.php" hash="0467a5ce61e19094a681b56a381e6735"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="eb3746c14752eebd4fa182bee93b4cac"/></dir><dir name="Model"><file name="PaymentMethod.php" hash="98eac4782d332daed9352a932b97eb29"/></dir><dir name="etc"><file name="config.xml" hash="1bf7adfc14a25a2ead433c698ed45d82"/><file name="system.xml" hash="6336987bf75a16b11abfa7e1fdceff49"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="af50a4425771801f820d6ded226aa813"/></dir><dir name="WorldPay"><dir name="Block"><file name="Form.php" hash="fc71b8e5de5b8631cc48d3cc1fab7627"/><file name="Info.php" hash="a87b42eb5945174255c73dcec93dcf5f"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Model"><file name="PaymentHelper.php" hash="e347f703ff49e75cd5022b86b52063fc"/><file name="PaymentMethod.php" hash="f5677eea945140d8d1ecd2cac90f320a"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="config.xml" hash="64723a9359b33f3339b09bf4ce0cd5f0"/><file name="system.xml" hash="03185d9e7014bd0bbc6f679e84d9522f"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="14d8d990d7a25af5bb3bc2967a882836"/></dir><dir name="WorldProfile"><dir name="Block"><file name="Form.php" hash="c3d4a47588b12616e76eef3ddcb3b988"/><file name="Info.php" hash="23ae669bcf08a4b254f76a1198653eec"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="e4343805ef9e19742bf82878e372b9d3"/></dir><dir name="Model"><file name="PaymentMethod.php" hash="ad25d769f2f5fc71aa77c74262cf77f9"/><file name=".DS_Store" hash="8e043d4c3cb0a1676b965f50edd66ecb"/></dir><dir name="etc"><file name="config.xml" hash="3786b9b081d6bbf4de296fafe19fa1c9"/><file name="system.xml" hash="14a64961d8f7bc661ad3510632f5ca54"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="8c54dd21ba871a6a760e901f3e4aa34c"/></dir><file name=".DS_Store" hash="507f613e3c8cfcad4ad9a11d9b255e5b"/></dir></target><target name="mageetc"><dir name="modules"><file name="WorldPayTech_WorldAch.xml" hash="d106ddc2bc8d4a551df766f383d7b891"/><file name="WorldPayTech_WorldPay.xml" hash="d1c22c594dcc5d6c857b48b32d7aa2be"/><file name="WorldPayTech_WorldProfile.xml" hash="ca4f2243b031273a329ce6af65138719"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="worldpay"><dir name="form"><file name="pp.phtml" hash="822a5fe4c95f73cc099d56db13505c90"/><file name="worldpayach.phtml" hash="283d8ce341d5fcf1c27d6fedc5390b75"/><file name="worldpaycc.phtml" hash="6374d7127b941da03269dde0c6646cdd"/><file name="worldpayprofile.phtml" hash="7660ec72770b79f5f1aa392103ee725f"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="9cba7016942d9d764cd61bbd0b715030"/></dir></dir></dir></dir></dir></target></contents>
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
|
| 19 |
</package>
|
