Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from RBAtkins0n/master
Browse files Browse the repository at this point in the history
2019-10-25: v1.0.6 : Alternate invoicing approach.
  • Loading branch information
appinlet authored Oct 25, 2019
2 parents 263ef72 + de4eca7 commit bbbea96
Show file tree
Hide file tree
Showing 10 changed files with 421 additions and 400 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# PayWeb_Magento_1
## PayGate Magento plugin v1.0.5 for Magento v1.9.4.3
## PayGate Magento plugin v1.0.6 for Magento v1.9.4.3

This is the PayGate PayWeb3 plugin for Magento 1. Please feel free to contact the PayGate support team at support@paygate.co.za should you require any assistance.

## Installation
[![How To Setup PayGate PayWeb for Magento 1](https://www.appinlet.com/wp-content/uploads/2018/09/Magento-1-Integration.jpg)](https://www.youtube.com/watch?v=jv_mGpYW7yA "How To Setup PayGate PayWeb for Magento 1")

Please navigate to the [releases page](https://github.com/PayGate/PayWeb_Magento_1/releases), download the latest release (v1.0.5) and unzip. You will them be able to follow the integration guide PDF which is included in the zip.
Please navigate to the [releases page](https://github.com/PayGate/PayWeb_Magento_1/releases), download the latest release (v1.0.6) and unzip. You will them be able to follow the integration guide PDF which is included in the zip.

## Collaboration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function redirectAction()
'EMAIL' => $order->getCustomerEmail(),
'NOTIFY_URL' => $module->getNotifyUrl(),
'USER2' => $orderId,
'USER3' => 'magento-v' . Mage::getVersion() . ' - plugin-v1.0.5',
'USER3' => 'magento-v' . Mage::getVersion() . ' - plugin-v1.0.6',
);

$fields['CHECKSUM'] = md5( implode( '', $fields ) . $module->getSecretKey() );
Expand Down Expand Up @@ -214,19 +214,29 @@ public function successful( $orderId )
*/
$order = Mage::getModel( 'sales/order' )->loadByIncrementId( $orderId );

$order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT)->save();

$payment = $order->getPayment();
$payment->save();

/**
* @var $invoice Mage_Sales_Model_Order_Invoice
*/
$invoice = $order->prepareInvoice();
$invoice->setState( Mage_Sales_Model_Order_Invoice::STATE_PAID );
$invoice->register()->capture();
$order->addRelatedObject( $invoice );

$order->addStatusToHistory( Mage_Sales_Model_Order::STATE_PROCESSING, 'Redirect Response: The User Completed Payment with PayGate' );
$order->save();
Mage::getModel( 'core/resource_transaction' )
->addObject( $invoice )
->addObject( $invoice->getOrder() )
->save();

if ( $module->getSendInvoiceEmail() ? true : false ) {
$invoice->sendEmail();
$message = Mage::helper( 'paygate' )->__( 'Notified customer about invoice #%s.', $invoice->getIncrementId() );
$comment = $order->sendNewOrderEmail()->addStatusHistoryComment( $message )
->setIsCustomerNotified( true )
->save();
} else {
$comment = $order->save();
}
$this->clearCart();

Expand Down
4 changes: 2 additions & 2 deletions Redirect/app/code/local/PayGate/Pay/etc/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright (c) 2018 PayGate (Pty) Ltd
* Copyright (c) 2019 PayGate (Pty) Ltd
*
* Author: App Inlet (Pty) Ltd
*
Expand All @@ -11,7 +11,7 @@
<config>
<modules>
<PayGate_Pay>
<version>1.0.5</version>
<version>1.0.6</version>
</PayGate_Pay>
</modules>
<global>
Expand Down
2 changes: 1 addition & 1 deletion Redirect/app/code/local/PayGate/Pay/etc/system.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright (c) 2018 PayGate (Pty) Ltd
* Copyright (c) 2019 PayGate (Pty) Ltd
*
* Author: App Inlet (Pty) Ltd
*
Expand Down
2 changes: 1 addition & 1 deletion Redirect/app/etc/modules/PayGate_Pay.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<depends>
<Mage_Payment />
</depends>
<version>1.0.3</version>
<version>1.0.6</version>
</PayGate_Pay>
</modules>
</config>
3 changes: 2 additions & 1 deletion Redirect/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Date : Version: Description
2018-08-01: v1.0.3 : Support for 1.9.3 - Fix failed and cancelled order processes and general code cleanup
2018-08-30: v1.0.4 : iFrame version
2019-10-18: v1.0.5 : Fix duplicate order and invoice creation
Magento 1.9.4.x compatibility
Magento 1.9.4.x compatibility
2019-10-25: v1.0.6 : Alternate invoicing approach.
Loading

0 comments on commit bbbea96

Please sign in to comment.