Skip to content

Commit

Permalink
Merge pull request #1 from azambon/patch-3
Browse files Browse the repository at this point in the history
Remove pending_payment initial status
  • Loading branch information
azambon authored Dec 4, 2017
2 parents d315dae + 28adf66 commit 4905878
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Author:

Contributions:
- [Ermanno Baschiera](https://github.com/ebaschiera)
- [azambon](https://github.com/azambon)
- For a full list of contributors visit [Magento Module Satispay on GitHub](https://github.com/bitbull-team/magento-module-satispay/graphs/contributors)

## License
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Bitbull/Satispay",
"name": "bitbull/satispay",
"license": "OSL-3.0",
"type": "magento-module",
"description": "Magento module for Satispay Payment integration",
Expand Down
5 changes: 5 additions & 0 deletions src/app/code/community/Bitbull/Satispay/Helper/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public function update($order, $chargeId=null) {
->addObject($invoice->getOrder());

$transactionSave->save();

Mage::dispatchEvent('satispay_update_success', array('order' => $order, 'charge' => $charge));

} elseif(in_array($charge->status, array(Satispay_Core_Client::PAYMENT_STATUS_DECLINED, Satispay_Core_Client::PAYMENT_STATUS_FAILURE))) {
$helper->getLogger()->info('Charge in ' . $charge->status . ' status: cancelling order');
Expand All @@ -72,8 +74,11 @@ public function update($order, $chargeId=null) {
$order->addStatusHistoryComment('Charge in ' . $charge->status . ' status.');
$order->save();

Mage::dispatchEvent('satispay_update_failure', array('order' => $order, 'charge' => $charge));
} else {
$helper->getLogger()->info('No action taken for status ' . $charge->status);

Mage::dispatchEvent('satispay_update_other', array('order' => $order, 'charge' => $charge));
}
}
}
3 changes: 1 addition & 2 deletions src/app/code/community/Bitbull/Satispay/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Bitbull_Satispay>
<version>0.2.1</version>
<version>0.2.5</version>
</Bitbull_Satispay>
</modules>
<global>
Expand Down Expand Up @@ -72,7 +72,6 @@
<payment>
<satispay>
<title>Pay with Satispay</title>
<order_status>pending_payment</order_status>
<payment_action>sale</payment_action>
<model>satispay/payment</model>
<default_country_code>+39</default_country_code>
Expand Down
16 changes: 8 additions & 8 deletions src/app/code/community/Bitbull/Satispay/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
</active>
<title translate="label">
<label>Title</label>
<frontend_type>text</frontend_type>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
</title>
<instructions translate="label">
<label>Instructions</label>
<frontend_type>textarea</frontend_type>
<sort_order>3</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
</instructions>
<staging translate="label">
<label>Staging Mode</label>
Expand All @@ -43,15 +43,15 @@
<sort_order>4</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
</staging>
<security_token translate="label">
<label>Security Token</label>
<frontend_type>textarea</frontend_type>
<sort_order>5</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
</security_token>
<default_country_code translate="label">
<label>Default Country Code</label>
Expand All @@ -60,15 +60,15 @@
<sort_order>6</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
</default_country_code>
<sort_order translate="label">
<label>Sort Order</label>
<frontend_type>text</frontend_type>
<sort_order>7</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
<frontend_class>validate-number</frontend_class>
</sort_order>
<debug translate="label comment">
Expand All @@ -79,7 +79,7 @@
<sort_order>110</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
<depends><active>1</active></depends>
</debug>
</fields>
Expand Down

0 comments on commit 4905878

Please sign in to comment.