Skip to content

Commit 3e4fe58

Browse files
Merge pull request #64 from PaystackHQ/fix/ee-admin-order-create-crash
Fix/ee admin order create crash
2 parents f5f8b47 + 3c74d45 commit 3e4fe58

9 files changed

Lines changed: 18 additions & 14 deletions

File tree

Observer/ObserverBeforeSalesOrderPlace.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ public function __construct() {
1515

1616
public function execute(\Magento\Framework\Event\Observer $observer)
1717
{
18-
//Observer execution code...
1918
/** @var \Magento\Sales\Model\Order $order **/
2019
$order = $observer->getEvent()->getOrder();
21-
22-
if ($order) {
20+
21+
if ($order && $order->getPayment()
22+
&& $order->getPayment()->getMethod() === \Pstk\Paystack\Model\Payment\Paystack::CODE
23+
) {
2324
$order->setCanSendNewEmailFlag(false)
2425
->setCustomerNoteNotify(false);
2526
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Paystack payment gateway Magento2 extension
88

9-
**Version:** 3.0.2 (Paystack v2 Inline.js API)
9+
**Version:** 3.0.3 (Paystack v2 Inline.js API)
1010

1111
## Requirements
1212

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pstk/paystack-magento2-module",
33
"description": "Paystack Magento2 Module using \\Magento\\Payment\\Model\\Method\\AbstractMethod",
4-
"version": "3.0.2",
4+
"version": "3.0.3",
55
"require": {},
66
"type": "magento2-module",
77
"license": [

dev/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if [ ! -f /var/www/html/app/etc/env.php ]; then
2626
--backend-frontname=admin \
2727
--language=en_US \
2828
--currency=NGN \
29+
--allowed-currencies=NGN \
2930
--timezone=Africa/Lagos \
3031
--use-rewrites=1 \
3132
--cleanup-database

dev/setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ mage config:set payment/pstk_paystack/integration_type inline
7070

7171
echo ""
7272
echo "==> Setting store currency to NGN..."
73+
mage config:set currency/options/allow NGN,USD,ZAR
7374
mage config:set currency/options/base NGN
7475
mage config:set currency/options/default NGN
7576
mage config:set currency/options/allow NGN

etc/di.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,5 @@
44
<!-- API -->
55
<preference for="Pstk\Paystack\Api\PaymentManagementInterface" type="Pstk\Paystack\Model\PaymentManagement"/>
66

7-
<!-- CSP: register Paystack domains via PHP collector (backward-compatible across Magento versions) -->
8-
<type name="Magento\Csp\Model\CompositePolicyCollector">
9-
<arguments>
10-
<argument name="collectors" xsi:type="array">
11-
<item name="pstk-paystack-csp" xsi:type="object" sortOrder="10">Pstk\Paystack\Model\CspPolicyCollector</item>
12-
</argument>
13-
</arguments>
14-
</type>
157

168
</config>

etc/frontend/di.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,13 @@
1010
<type name="Magento\Framework\App\Request\CsrfValidator">
1111
<plugin name="csrf_validator_skip" type="Pstk\Paystack\Plugin\CsrfValidatorSkip" />
1212
</type>
13+
14+
<!-- CSP: register Paystack domains via PHP collector (frontend only - Paystack is not used in admin) -->
15+
<type name="Magento\Csp\Model\CompositePolicyCollector">
16+
<arguments>
17+
<argument name="collectors" xsi:type="array">
18+
<item name="pstk-paystack-csp" xsi:type="object">Pstk\Paystack\Model\CspPolicyCollector</item>
19+
</argument>
20+
</arguments>
21+
</type>
1322
</config>
File renamed without changes.

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Pstk_Paystack" setup_version="3.0.2">
3+
<module name="Pstk_Paystack" setup_version="3.0.3">
44
<sequence>
55
<module name="Magento_Sales"/>
66
<module name="Magento_Payment"/>

0 commit comments

Comments
 (0)