Skip to content

Commit

Permalink
v3.7.4
Browse files Browse the repository at this point in the history
- IP address change (whitelist) for receiving notifications!!!
- The ability to choose whether a production account is migrated from Dotpay to Przelewy24 has been blocked
- The button in the administration panel for registering a sandbox account in Dotpay has been removed
  • Loading branch information
wpawel committed Jul 17, 2024
1 parent 9f8ca6a commit dbc7945
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 132 deletions.
17 changes: 6 additions & 11 deletions Dotpay/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,31 @@ class Dotpay_Payment extends WC_Payment_Gateway
// Dotpay IP addresses

const DOTPAY_IP_WHITE_LIST = array(
'195.150.9.37',
'91.216.191.181',
'91.216.191.182',
'91.216.191.183',
'91.216.191.184',
'91.216.191.185',
'20.215.81.124',
'5.252.202.254',
'5.252.202.255',
'195.150.9.37'
);



// Office Dotpay IP address
const OFFICE_IP = '77.79.195.34';

// Dotpay URL
const DOTPAY_URL = 'https://ssl.dotpay.pl/t2/';
const DOTPAY_URL = 'https://dproxy.przelewy24.pl/t2/';
// Dotpay Proxy in Przelewy24 URL
const DPROXY_URL = 'https://dproxy.przelewy24.pl/t2/';
// Dotpay URL TEST
const DOTPAY_URL_TEST = 'https://ssl.dotpay.pl/test_payment/';
// Dotpay Seller Api URL
const DOTPAY_SELLER_API_URL = 'https://ssl.dotpay.pl/s2/login/';
const DOTPAY_SELLER_API_URL = 'https://dproxy.przelewy24.pl/s2/login/';

// Dotpay Proxy in Przelewy24 Seller Api URL
const DPROXY_SELLER_API_URL = 'https://dproxy.przelewy24.pl/s2/login/';
// Dotpay Seller Api URL test
const DOTPAY_TEST_SELLER_API_URL = 'https://ssl.dotpay.pl/test_seller/';

// Module version
const MODULE_VERSION = '3.7.3';
const MODULE_VERSION = '3.7.4';


public static $ocChannel = '248';
Expand Down
8 changes: 4 additions & 4 deletions Gateway/Dotpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ public function init_form_fields() {
),

'dproxy_migrated' => array(
'title' => "<span style=\"margin: 10px;\">🧑‍💻 ".__('My account has already been migrated from dotpay to Przelewy24', 'dotpay-payment-gateway')."</span>",
'title' => "<span style=\"margin: 10px;\">🧑‍💻 ".__('My production account has already been migrated from Dotpay to Przelewy24', 'dotpay-payment-gateway')."</span>",
'label' => __('My new panel is at: <a href="https://panel.przelewy24.pl/" class="hide-if-no-js page-title-action" target="_blank" title="Przelewy24 Transaction Panel">https://panel.przelewy24.pl/</a>', 'dotpay-payment-gateway'),
'type' => 'checkbox',
'description' => "<em>".__('If your account has already been transferred to the new Przelewy24 panel, be sure to select this option. ', 'dotpay-payment-gateway')."<br>".__('Thanks to this, you will ensure trouble-free and fast payment service.', 'dotpay-payment-gateway')."<br>".__('The sandbox environment is not available in this option.', 'dotpay-payment-gateway')."</em>",
'type' => 'hidden',
'description' => "<em>".__('Your account has already been transferred to the new Przelewy24 panel.', 'dotpay-payment-gateway')."</em>",
'default' => 'no'
),
'id' => array(
Expand All @@ -182,7 +182,7 @@ public function init_form_fields() {

'test' => array(
'title' => "🧪 ".__('Testing environment', 'dotpay-payment-gateway'),
'label' => __('Only payment simulation - required Dotpay test account: <a href="https://www.dotpay.pl/developer/sandbox/en/?affilate_id=woocommerce" class="hide-if-no-js page-title-action" target="_blank" title="Dotpay test account registration">registration</a>', 'dotpay-payment-gateway'),
'label' => __('Only payment simulation - required Dotpay test account.', 'dotpay-payment-gateway'),
'type' => 'checkbox',
'default' => 'yes'
),
Expand Down
7 changes: 0 additions & 7 deletions Gateway/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -902,13 +902,6 @@ public function confirmPayment() {
}


if( ($clientIp == self::OFFICE_IP) && (strtoupper($_SERVER['REQUEST_METHOD']) == 'GET'))
{
$dotpay_office = true;

}else{
$dotpay_office = false;
}

if( strtoupper($_SERVER['REQUEST_METHOD']) == 'GET' && isset($_GET['dp_debug']) ){
$string_to_hash = 'h:'.$this->realHostName().',id:'.$this->getSellerId().',d:'.date('YmdHi').',p:'.$this->getSellerPin();
Expand Down
Binary file modified langs/dotpay-payment-gateway-en_US.mo
Binary file not shown.
103 changes: 52 additions & 51 deletions langs/dotpay-payment-gateway-en_US.po
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce Gateway Dotpay\n"
"POT-Creation-Date: 2023-06-07 13:20+0200\n"
"PO-Revision-Date: 2023-06-07 13:20+0200\n"
"POT-Creation-Date: 2024-07-17 09:26+0200\n"
"PO-Revision-Date: 2024-07-17 09:26+0200\n"
"Last-Translator: Dotpay <tech@dotpay.pl>\n"
"Language-Team: Dotpay <tech@dotpay.pl>\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.3.1\n"
"X-Generator: Poedit 3.4.4\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SourceCharset: UTF-8\n"
Expand All @@ -25,11 +25,11 @@ msgstr "Download blankiet"
msgid "Make a money transfer"
msgstr "Make a money transfer"

#: ../Dotpay/Payment.php:415
#: ../Dotpay/Payment.php:409
msgid "Shop - "
msgstr "Shop - "

#: ../Dotpay/Payment.php:567
#: ../Dotpay/Payment.php:561
msgid "Order ID: "
msgstr "Order ID: "

Expand Down Expand Up @@ -134,8 +134,10 @@ msgid "You can enable Przelewy24 (Dotpay) payments"
msgstr "You can enable Przelewy24 (Dotpay) payments"

#: ../Gateway/Dotpay.php:159
msgid "My account has already been migrated from dotpay to Przelewy24"
msgstr "My account has already been migrated from dotpay to Przelewy24"
msgid ""
"My production account has already been migrated from Dotpay to Przelewy24"
msgstr ""
"My production account has already been migrated from Dotpay to Przelewy24"

#: ../Gateway/Dotpay.php:160
msgid ""
Expand All @@ -148,20 +150,8 @@ msgstr ""
"Panel\">https://panel.przelewy24.pl/</a>"

#: ../Gateway/Dotpay.php:162
msgid ""
"If your account has already been transferred to the new Przelewy24 panel, be "
"sure to select this option. "
msgstr ""
"If your account has already been transferred to the new Przelewy24 panel, be "
"sure to select this option. "

#: ../Gateway/Dotpay.php:162
msgid "Thanks to this, you will ensure trouble-free and fast payment service."
msgstr "Thanks to this, you will ensure trouble-free and fast payment service."

#: ../Gateway/Dotpay.php:162
msgid "The sandbox environment is not available in this option."
msgstr "The sandbox environment is not available in this option."
msgid "Your account has already been transferred to the new Przelewy24 panel."
msgstr "Your account has already been transferred to the new Przelewy24 panel."

#: ../Gateway/Dotpay.php:166
msgid "Dotpay customer ID"
Expand Down Expand Up @@ -192,16 +182,8 @@ msgid "Testing environment"
msgstr "Testing environment"

#: ../Gateway/Dotpay.php:185
msgid ""
"Only payment simulation - required Dotpay test account: <a href=\"https://"
"www.dotpay.pl/developer/sandbox/en/?affilate_id=woocommerce\" class=\"hide-"
"if-no-js page-title-action\" target=\"_blank\" title=\"Dotpay test account "
"registration\">registration</a>"
msgstr ""
"Only payment simulation - required Dotpay test account: <a href=\"https://"
"www.dotpay.pl/developer/sandbox/en/?affilate_id=woocommerce\" class=\"hide-"
"if-no-js page-title-action\" target=\"_blank\" title=\"Dotpay test account "
"registration\">registration</a>"
msgid "Only payment simulation - required Dotpay test account."
msgstr "Only payment simulation - required Dotpay test account."

#: ../Gateway/Dotpay.php:190
msgid "My server does not use a proxy"
Expand Down Expand Up @@ -499,81 +481,81 @@ msgstr ""
msgid "Please accept all agreements"
msgstr "Please accept all agreements"

#: ../Gateway/Gateway.php:1060
#: ../Gateway/Gateway.php:1053
msgid "Przelewy24 (Dotpay) send notification"
msgstr "Przelewy24 (Dotpay) send notification"

#: ../Gateway/Gateway.php:1060
#: ../Gateway/Gateway.php:1053
msgid "transaction number:"
msgstr "transaction number:"

#: ../Gateway/Gateway.php:1060
#: ../Gateway/Gateway.php:1053
msgid "payment channel:"
msgstr "payment channel:"

#: ../Gateway/Gateway.php:1063
#: ../Gateway/Gateway.php:1056
msgid "paid : processing"
msgstr "paid : processing"

#: ../Gateway/Gateway.php:1063
#: ../Gateway/Gateway.php:1056
msgid "paid : completed (virtual product)"
msgstr "paid : completed (virtual product)"

#: ../Gateway/Gateway.php:1079
#: ../Gateway/Gateway.php:1072
msgid "positive notifications:"
msgstr "positive notifications:"

#: ../Gateway/Gateway.php:1084
#: ../Gateway/Gateway.php:1077
msgid "DOUBLE PAYMENT !"
msgstr "DOUBLE PAYMENT !"

#: ../Gateway/Gateway.php:1084
#: ../Gateway/Gateway.php:1077
msgid "for the order no:"
msgstr "for the order no:"

#: ../Gateway/Gateway.php:1084
#: ../Gateway/Gateway.php:1077
msgid "Przelewy24 (Dotpay) registered under numbers:"
msgstr "Przelewy24 (Dotpay) registered under numbers:"

#: ../Gateway/Gateway.php:1084
#: ../Gateway/Gateway.php:1077
msgid ""
"Check the posting for this order in your Przelewy24 panel - there is a risk "
"that the payer has paid more than 1 time for this order."
msgstr ""
"Check the posting for this order in your Przelewy24 panel - there is a risk "
"that the payer has paid more than 1 time for this order."

#: ../Gateway/Gateway.php:1098 ../Gateway/Gateway.php:1100
#: ../Gateway/Gateway.php:1101
#: ../Gateway/Gateway.php:1091 ../Gateway/Gateway.php:1093
#: ../Gateway/Gateway.php:1094
msgid "cancelled"
msgstr "cancelled"

#: ../Gateway/Gateway.php:1101 ../Gateway/Gateway.php:1115
#: ../Gateway/Gateway.php:1094 ../Gateway/Gateway.php:1108
msgid "A message for: "
msgstr "A message for: "

#: ../Gateway/Gateway.php:1101 ../Gateway/Gateway.php:1115
#: ../Gateway/Gateway.php:1094 ../Gateway/Gateway.php:1108
msgid "The order status has not been changed to"
msgstr "The order status has not been changed to"

#: ../Gateway/Gateway.php:1101 ../Gateway/Gateway.php:1115
#: ../Gateway/Gateway.php:1094 ../Gateway/Gateway.php:1108
msgid "because the order has previously been paid for (check previous notes)."
msgstr "because the order has previously been paid for (check previous notes)."

#: ../Gateway/Gateway.php:1101
#: ../Gateway/Gateway.php:1094
msgid "You can also check the accounting for this order in the Dotpay panel."
msgstr "You can also check the accounting for this order in the Dotpay panel."

#: ../Gateway/Gateway.php:1101 ../Gateway/Gateway.php:1115
#: ../Gateway/Gateway.php:1094 ../Gateway/Gateway.php:1108
msgid "So it's current status:"
msgstr "So it's current status:"

#: ../Gateway/Gateway.php:1112 ../Gateway/Gateway.php:1114
#: ../Gateway/Gateway.php:1115
#: ../Gateway/Gateway.php:1105 ../Gateway/Gateway.php:1107
#: ../Gateway/Gateway.php:1108
msgid "processing"
msgstr "processing"

#: ../Gateway/Gateway.php:1115
#: ../Gateway/Gateway.php:1108
msgid ""
"You can also check the accounting for this order in the Przelewy24 panel."
msgstr ""
Expand Down Expand Up @@ -985,6 +967,25 @@ msgstr ""
msgid "You're being redirected to the payment operator, please wait ..."
msgstr "You're being redirected to the payment operator, please wait ..."

#~ msgid ""
#~ "Thanks to this, you will ensure trouble-free and fast payment service."
#~ msgstr ""
#~ "Thanks to this, you will ensure trouble-free and fast payment service."

#~ msgid "The sandbox environment is not available in this option."
#~ msgstr "The sandbox environment is not available in this option."

#~ msgid ""
#~ "Only payment simulation - required Dotpay test account: <a href=\"https://"
#~ "www.dotpay.pl/developer/sandbox/en/?affilate_id=woocommerce\" "
#~ "class=\"hide-if-no-js page-title-action\" target=\"_blank\" "
#~ "title=\"Dotpay test account registration\">registration</a>"
#~ msgstr ""
#~ "Only payment simulation - required Dotpay test account: <a href=\"https://"
#~ "www.dotpay.pl/developer/sandbox/en/?affilate_id=woocommerce\" "
#~ "class=\"hide-if-no-js page-title-action\" target=\"_blank\" "
#~ "title=\"Dotpay test account registration\">registration</a>"

#~ msgid "Credit Cards (Dotpay)"
#~ msgstr "Credit Cards (Dotpay)"

Expand Down
Binary file modified langs/dotpay-payment-gateway-pl_PL.mo
Binary file not shown.
Loading

0 comments on commit dbc7945

Please sign in to comment.