diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Main.php b/DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Main.php similarity index 99% rename from DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Main.php rename to DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Main.php index 86b7956..fec18f8 100644 --- a/DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Main.php +++ b/DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Main.php @@ -82,7 +82,7 @@ public static function getMajorVersion() */ public static function getMinorVersion() { - return '10'; + return '11'; } /** diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Model/Payment/Processor/PagaMasTarde.php b/DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Model/Payment/Processor/PagaMasTarde.php similarity index 89% rename from DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Model/Payment/Processor/PagaMasTarde.php rename to DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Model/Payment/Processor/PagaMasTarde.php index 0fbe865..ab9f1d8 100644 --- a/DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Model/Payment/Processor/PagaMasTarde.php +++ b/DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/Model/Payment/Processor/PagaMasTarde.php @@ -99,7 +99,8 @@ public function processCallback(\XLite\Model\Payment\Transaction $transaction) $temp['data']['id'] ); - $signature_check_sha512 = hash('sha512', + $signature_check_sha512 = hash( + 'sha512', $this->secret_key . $temp['account_id'] . $temp['api_version'] . @@ -249,6 +250,33 @@ protected function getFormFields() $this->discount = 'false'; } + //extra user parameters + $sign_up_date = ''; + $toal_amount = 0; + $num_refunds = 0; + $amount_refunded = 0; + $total_orders = 0; + $profile = \XLite\Core\Auth::getInstance()->getProfile(); + if (trim($profile != '')) { + $sign_up_date = date('Y/m/d', $profile->getAdded()); + $cnd = new \XLite\Core\CommonCell(); + $cnd->profile = $profile; + $orders = \XLite\Core\Database::getRepo('XLite\Model\Order')->search($cnd); + foreach ($orders as $o) { + + if ($o->getPaymentStatusCode() == \XLite\Model\Order\Status\Payment::STATUS_PART_PAID || + $o->getPaymentStatusCode() == \XLite\Model\Order\Status\Payment::STATUS_PAID + ) { + $toal_amount += $o->getTotal(); + $total_orders++; + } elseif ($o->getPaymentStatusCode() == \XLite\Model\Order\Status\Payment::STATUS_REFUNDED) { + $num_refunds++; + $amount_refunded += $o->getTotal(); + } + } + } + + $string = $this->secret_key . $this->public_key . $trx_id @@ -286,7 +314,11 @@ protected function getFormFields() 'discount[full]' => $this->discount, 'order_id' => $trx_id, 'description' => $trx_id, - 'pay_method' => 'CC', + 'metadata[member_since]' => $sign_up_date, + 'metadata[num_orders]' => $total_orders, + 'metadata[amount_orders]' => $toal_amount, + 'metadata[num_full_refunds]' => $num_refunds, + 'metadata[amount_refunds]' => $amount_refunded ); $i=0; diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/View/Config.php b/DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/View/Config.php similarity index 100% rename from DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/View/Config.php rename to DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/View/Config.php diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/View/Payment.php b/DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/View/Payment.php similarity index 100% rename from DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/View/Payment.php rename to DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/View/Payment.php diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/icon.png b/DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/icon.png similarity index 100% rename from DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/icon.png rename to DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/icon.png diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/install.yaml b/DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/install.yaml similarity index 100% rename from DigitalOrigin-PagaMasTarde-v5_2_10/classes/XLite/Module/DigitalOrigin/PagaMasTarde/install.yaml rename to DigitalOrigin-PagaMasTarde-v5_2_11/classes/XLite/Module/DigitalOrigin/PagaMasTarde/install.yaml diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/checkout.tpl b/DigitalOrigin-PagaMasTarde-v5_2_11/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/checkout.tpl similarity index 100% rename from DigitalOrigin-PagaMasTarde-v5_2_10/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/checkout.tpl rename to DigitalOrigin-PagaMasTarde-v5_2_11/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/checkout.tpl diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/config.tpl b/DigitalOrigin-PagaMasTarde-v5_2_11/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/config.tpl similarity index 100% rename from DigitalOrigin-PagaMasTarde-v5_2_10/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/config.tpl rename to DigitalOrigin-PagaMasTarde-v5_2_11/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/config.tpl diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/method_icon.png b/DigitalOrigin-PagaMasTarde-v5_2_11/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/method_icon.png similarity index 100% rename from DigitalOrigin-PagaMasTarde-v5_2_10/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/method_icon.png rename to DigitalOrigin-PagaMasTarde-v5_2_11/skins/admin/en/modules/DigitalOrigin/PagaMasTarde/method_icon.png diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/skins/default/en/modules/DigitalOrigin/PagaMasTarde/checkout.tpl b/DigitalOrigin-PagaMasTarde-v5_2_11/skins/default/en/modules/DigitalOrigin/PagaMasTarde/checkout.tpl similarity index 100% rename from DigitalOrigin-PagaMasTarde-v5_2_10/skins/default/en/modules/DigitalOrigin/PagaMasTarde/checkout.tpl rename to DigitalOrigin-PagaMasTarde-v5_2_11/skins/default/en/modules/DigitalOrigin/PagaMasTarde/checkout.tpl diff --git a/DigitalOrigin-PagaMasTarde-v5_2_10/skins/default/en/modules/DigitalOrigin/PagaMasTarde/payment.tpl b/DigitalOrigin-PagaMasTarde-v5_2_11/skins/default/en/modules/DigitalOrigin/PagaMasTarde/payment.tpl similarity index 100% rename from DigitalOrigin-PagaMasTarde-v5_2_10/skins/default/en/modules/DigitalOrigin/PagaMasTarde/payment.tpl rename to DigitalOrigin-PagaMasTarde-v5_2_11/skins/default/en/modules/DigitalOrigin/PagaMasTarde/payment.tpl