Version Notes
Pierwsze wydanie
Download this release
Release Info
Developer | inviPay.com |
Extension | Invipay_Ipcpaygate |
Version | 1.0.0.0 |
Comparing to | |
See all releases |
Version 1.0.0.0
- app/code/community/Invipay/.DS_Store +0 -0
- app/code/community/Invipay/Common/.DS_Store +0 -0
- app/code/community/Invipay/Common/Apiclient/.DS_Store +0 -0
- app/code/community/Invipay/Common/Apiclient/LiabilitiesApiClient.class.php +65 -0
- app/code/community/Invipay/Common/Apiclient/PaygateApiClient.class.php +51 -0
- app/code/community/Invipay/Common/Apiclient/ReportsApiClient.class.php +19 -0
- app/code/community/Invipay/Common/Apiclient/TestApiClient.class.php +29 -0
- app/code/community/Invipay/Common/Apiclient/TransactionsApiClient.class.php +50 -0
- app/code/community/Invipay/Common/Apiclient/dto/.DS_Store +0 -0
- app/code/community/Invipay/Common/Apiclient/dto/Address.class.php +23 -0
- app/code/community/Invipay/Common/Apiclient/dto/BankAccount.class.php +15 -0
- app/code/community/Invipay/Common/Apiclient/dto/BaseApiData.class.php +19 -0
- app/code/community/Invipay/Common/Apiclient/dto/BaseDocumentDetails.class.php +52 -0
- app/code/community/Invipay/Common/Apiclient/dto/Contractor.class.php +46 -0
- app/code/community/Invipay/Common/Apiclient/dto/DocumentAttachmentDownloadInfo.class.php +13 -0
- app/code/community/Invipay/Common/Apiclient/dto/FileData.class.php +107 -0
- app/code/community/Invipay/Common/Apiclient/dto/FileInfo.class.php +19 -0
- app/code/community/Invipay/Common/Apiclient/dto/ListFilter.class.php +23 -0
- app/code/community/Invipay/Common/Apiclient/dto/liabilitiesapiservice/CommissionInvoiceDetails.class.php +9 -0
- app/code/community/Invipay/Common/Apiclient/dto/liabilitiesapiservice/InterestInvoiceDetails.class.php +9 -0
- app/code/community/Invipay/Common/Apiclient/dto/liabilitiesapiservice/InterestNoteDetails.class.php +9 -0
- app/code/community/Invipay/Common/Apiclient/dto/liabilitiesapiservice/LiabilityDocumentDetails.class.php +21 -0
- app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/CallbackDataFormat.enum.php +9 -0
- app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/OrderToInvoiceData.class.php +19 -0
- app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentCreationData.class.php +63 -0
- app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentData.class.php +39 -0
- app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentManagementData.class.php +27 -0
- app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentRequestStatus.enum.php +12 -0
- app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentStartInfo.class.php +19 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportCommissionInvoiceItem.class.php +72 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportDocument.class.php +203 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportInterestInvoiceItem.class.php +54 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportInterestNoteItem.class.php +45 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportPaymentItem.class.php +81 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportPayoffItem.class.php +90 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportPurchaseItem.class.php +90 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportRSBItem.class.php +45 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportRSPSettlementItem.class.php +54 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportRSReversedSettlementItem.class.php +45 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportRSSettlementItem.class.php +45 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportResaleStatementItem.class.php +72 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportSaleItem.class.php +91 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportSettlementItem.class.php +45 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/DocumentItem.class.php +16 -0
- app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/ReportFilter.class.php +25 -0
- app/code/community/Invipay/Common/Apiclient/dto/testapiservice/EchoIn.class.php +15 -0
- app/code/community/Invipay/Common/Apiclient/dto/testapiservice/EchoOut.class.php +11 -0
- app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/BaseTransactionData.class.php +37 -0
- app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/InvoiceData.class.php +18 -0
- app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/OrderData.class.php +14 -0
- app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionDetails.class.php +27 -0
- app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionItemDetails.class.php +52 -0
- app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionSide.enum.php +9 -0
- app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionType.enum.php +9 -0
- app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionsFilter.class.php +30 -0
- app/code/community/Invipay/Common/Apiclient/exceptions/AccessFromIpDeniedException.class.php +13 -0
- app/code/community/Invipay/Common/Apiclient/exceptions/ApiOperationException.class.php +22 -0
- app/code/community/Invipay/Common/Apiclient/exceptions/AuthenticationException.class.php +13 -0
- app/code/community/Invipay/Common/Apiclient/exceptions/ObjectNotFoundException.class.php +13 -0
- app/code/community/Invipay/Common/Apiclient/exceptions/SignatureException.class.php +13 -0
- app/code/community/Invipay/Common/Apiclient/exceptions/TransactionContractorException.class.php +13 -0
- app/code/community/Invipay/Common/Apiclient/exceptions/ValidationException.class.php +13 -0
- app/code/community/Invipay/Common/Apiclient/lib/AbstractRestApiClient.class.php +299 -0
- app/code/community/Invipay/Ipcpaygate/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/Block/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/Block/Form/Checkout.php +26 -0
- app/code/community/Invipay/Ipcpaygate/Block/Info/Checkout.php +15 -0
- app/code/community/Invipay/Ipcpaygate/Block/Redirect.php +24 -0
- app/code/community/Invipay/Ipcpaygate/Block/Wait.php +24 -0
- app/code/community/Invipay/Ipcpaygate/Block/Widgets/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/Block/Widgets/Basketinfo.php +27 -0
- app/code/community/Invipay/Ipcpaygate/Block/Widgets/Floatingpanel.php +41 -0
- app/code/community/Invipay/Ipcpaygate/Block/Widgets/Footericon.php +27 -0
- app/code/community/Invipay/Ipcpaygate/Helper/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/Helper/Data.php +157 -0
- app/code/community/Invipay/Ipcpaygate/Model/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/Model/Orderstatusobserver.php +24 -0
- app/code/community/Invipay/Ipcpaygate/Model/Paymentmethod.php +73 -0
- app/code/community/Invipay/Ipcpaygate/Model/Resource/Setup.php +6 -0
- app/code/community/Invipay/Ipcpaygate/Model/System/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/Model/System/Config/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/Model/System/Config/Source/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/Model/System/Config/Source/Checkouttext.php +26 -0
- app/code/community/Invipay/Ipcpaygate/Model/System/Config/Source/Floatingpanel.php +24 -0
- app/code/community/Invipay/Ipcpaygate/Model/System/Config/Source/Widgets/Floatingpanel.php +24 -0
- app/code/community/Invipay/Ipcpaygate/controllers/PaymentController.php +129 -0
- app/code/community/Invipay/Ipcpaygate/etc/config.xml +96 -0
- app/code/community/Invipay/Ipcpaygate/etc/system.xml +171 -0
- app/code/community/Invipay/Ipcpaygate/sql/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/sql/ipcpaygate_setup/.DS_Store +0 -0
- app/code/community/Invipay/Ipcpaygate/sql/ipcpaygate_setup/mysql4-install-1.0.0.0.php +13 -0
- app/design/frontend/base/default/layout/ipcpaygate.xml +16 -0
- app/design/frontend/base/default/template/ipcpaygate/.DS_Store +0 -0
- app/design/frontend/base/default/template/ipcpaygate/form/checkout.phtml +33 -0
- app/design/frontend/base/default/template/ipcpaygate/form/checkout_info.phtml +4 -0
- app/design/frontend/base/default/template/ipcpaygate/form/checkout_label.phtml +2 -0
- app/design/frontend/base/default/template/ipcpaygate/redirect.phtml +10 -0
- app/design/frontend/base/default/template/ipcpaygate/wait.phtml +73 -0
- app/design/frontend/base/default/template/ipcpaygate/widgets/basketinfo.phtml +5 -0
- app/design/frontend/base/default/template/ipcpaygate/widgets/floatingpanel.phtml +5 -0
- app/design/frontend/base/default/template/ipcpaygate/widgets/footericon.phtml +5 -0
- app/design/frontend/base/default/template/ipcpaygate/widgets/head.phtml +1 -0
- app/etc/modules/Invipay_All.xml +13 -0
- package.xml +20 -0
app/code/community/Invipay/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Common/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Common/Apiclient/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Common/Apiclient/LiabilitiesApiClient.class.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/lib/AbstractRestApiClient.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/dto/ListFilter.class.php");
|
5 |
+
require_once(dirname(__FILE__) ."/dto/liabilitiesapiservice/CommissionInvoiceDetails.class.php");
|
6 |
+
require_once(dirname(__FILE__) ."/dto/liabilitiesapiservice/InterestInvoiceDetails.class.php");
|
7 |
+
require_once(dirname(__FILE__) ."/dto/liabilitiesapiservice/InterestNoteDetails.class.php");
|
8 |
+
|
9 |
+
class LiabilitiesApiClient extends AbstractRestApiClient
|
10 |
+
{
|
11 |
+
protected function getServiceAddress(){ return '/liabilities'; }
|
12 |
+
|
13 |
+
////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
public function getCommissionInvoice($id)
|
16 |
+
{
|
17 |
+
return $this->__call_ws_action('/ci/details', array('id' => $id), 'GET', 'CommissionInvoiceDetails');
|
18 |
+
}
|
19 |
+
|
20 |
+
public function listCommissionInvoices(ListFilter $filter)
|
21 |
+
{
|
22 |
+
return $this->__call_ws_action('/ci/list', $filter, 'POST', 'CommissionInvoiceDetails', true);
|
23 |
+
}
|
24 |
+
|
25 |
+
public function downloadCommissionInvoiceDocument($id)
|
26 |
+
{
|
27 |
+
return $this->__call_ws_action('/ci/document', array('id' => $id), 'GET', function($str){ return base64_decode($str); });
|
28 |
+
}
|
29 |
+
|
30 |
+
////////////////////////////////////////////////////////////////////////////
|
31 |
+
|
32 |
+
public function getInterestInvoice($id)
|
33 |
+
{
|
34 |
+
return $this->__call_ws_action('/ii/details', array('id' => $id), 'GET', 'InterestInvoiceDetails');
|
35 |
+
}
|
36 |
+
|
37 |
+
public function listInterestInvoices(ListFilter $filter)
|
38 |
+
{
|
39 |
+
return $this->__call_ws_action('/ii/list', $filter, 'POST', 'InterestInvoiceDetails', true);
|
40 |
+
}
|
41 |
+
|
42 |
+
public function downloadInterestInvoiceDocument($id)
|
43 |
+
{
|
44 |
+
return $this->__call_ws_action('/ii/document', array('id' => $id), 'GET', function($str){ return base64_decode($str); });
|
45 |
+
}
|
46 |
+
|
47 |
+
////////////////////////////////////////////////////////////////////////////
|
48 |
+
|
49 |
+
public function getInterestNote($id)
|
50 |
+
{
|
51 |
+
return $this->__call_ws_action('/in/details', array('id' => $id), 'GET', 'InterestNoteDetails');
|
52 |
+
}
|
53 |
+
|
54 |
+
public function listInterestNotes(ListFilter $filter)
|
55 |
+
{
|
56 |
+
return $this->__call_ws_action('/in/list', $filter, 'POST', 'InterestNoteDetails', true);
|
57 |
+
}
|
58 |
+
|
59 |
+
public function downloadInterestNoteDocument($id)
|
60 |
+
{
|
61 |
+
return $this->__call_ws_action('/in/document', array('id' => $id), 'GET', function($str){ return base64_decode($str); });
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/PaygateApiClient.class.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/lib/AbstractRestApiClient.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/dto/paygateapiservice/PaymentStartInfo.class.php");
|
5 |
+
require_once(dirname(__FILE__) ."/dto/paygateapiservice/PaymentData.class.php");
|
6 |
+
require_once(dirname(__FILE__) ."/dto/paygateapiservice/PaymentCreationData.class.php");
|
7 |
+
require_once(dirname(__FILE__) ."/dto/paygateapiservice/PaymentManagementData.class.php");
|
8 |
+
|
9 |
+
class PaygateApiClient extends AbstractRestApiClient
|
10 |
+
{
|
11 |
+
protected function getServiceAddress(){ return '/paygate'; }
|
12 |
+
|
13 |
+
////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
public function paymentStatusFromCallbackPost($callbackDataFormat)
|
16 |
+
{
|
17 |
+
return $this->paymentStatusFromCallback(file_get_contents('php://input'), $callbackDataFormat);
|
18 |
+
}
|
19 |
+
|
20 |
+
public function paymentStatusFromCallback($callbackData, $callbackDataFormat = CallbackDataFormat::JSON)
|
21 |
+
{
|
22 |
+
$output = null;
|
23 |
+
|
24 |
+
switch ($callbackDataFormat) {
|
25 |
+
case CallbackDataFormat::JSON: $output = $this->__mapArrayToObject(json_decode($callbackData, true), 'PaymentData', false); break;
|
26 |
+
case CallbackDataFormat::XML: $output = $this->__mapArrayToObject($this->__xmlToArray($callbackData), 'PaymentData', false); break;
|
27 |
+
default: break;
|
28 |
+
}
|
29 |
+
|
30 |
+
return $output;
|
31 |
+
}
|
32 |
+
|
33 |
+
////////////////////////////////////////////////////////////////////////////
|
34 |
+
|
35 |
+
public function createPayment(PaymentCreationData $paymentData)
|
36 |
+
{
|
37 |
+
return $this->__call_ws_action('/create', $paymentData, 'POST', 'PaymentStartInfo');
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getPayment($id)
|
41 |
+
{
|
42 |
+
return $this->__call_ws_action('/details', array('id' => $id), 'GET', 'PaymentData');
|
43 |
+
}
|
44 |
+
|
45 |
+
public function managePayment(PaymentManagementData $managementData)
|
46 |
+
{
|
47 |
+
return $this->__call_ws_action('/manage', $managementData, 'POST', 'PaymentData');
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/ReportsApiClient.class.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/lib/AbstractRestApiClient.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/dto/reportsapiservice/AccountantReportDocument.class.php");
|
5 |
+
require_once(dirname(__FILE__) ."/dto/reportsapiservice/ReportFilter.class.php");
|
6 |
+
|
7 |
+
class ReportsApiClient extends AbstractRestApiClient
|
8 |
+
{
|
9 |
+
protected function getServiceAddress(){ return '/reports'; }
|
10 |
+
|
11 |
+
////////////////////////////////////////////////////////////////////////////
|
12 |
+
|
13 |
+
public function getAccountantReport(ReportFilter $filter)
|
14 |
+
{
|
15 |
+
return $this->__call_ws_action('/accountant', $filter, 'POST', 'AccountantReportDocument');
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/TestApiClient.class.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/lib/AbstractRestApiClient.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/dto/testapiservice/EchoIn.class.php");
|
5 |
+
require_once(dirname(__FILE__) ."/dto/testapiservice/EchoOut.class.php");
|
6 |
+
|
7 |
+
class TestApiClient extends AbstractRestApiClient
|
8 |
+
{
|
9 |
+
protected function getServiceAddress(){ return '/test'; }
|
10 |
+
|
11 |
+
////////////////////////////////////////////////////////////////////////////
|
12 |
+
|
13 |
+
public function getDate()
|
14 |
+
{
|
15 |
+
return $this->__call_ws_action('/getDate', null, 'GET', null);
|
16 |
+
}
|
17 |
+
|
18 |
+
public function echoMessage(EchoIn $request)
|
19 |
+
{
|
20 |
+
return $this->__call_ws_action('/echoMessage', $request, 'POST', 'EchoOut');
|
21 |
+
}
|
22 |
+
|
23 |
+
public function whoAmI()
|
24 |
+
{
|
25 |
+
return $this->__call_ws_action('/whoAmI', null, 'GET', null);
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/TransactionsApiClient.class.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/lib/AbstractRestApiClient.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/dto/transactionapiservice/InvoiceData.class.php");
|
5 |
+
require_once(dirname(__FILE__) ."/dto/transactionapiservice/OrderData.class.php");
|
6 |
+
require_once(dirname(__FILE__) ."/dto/transactionapiservice/TransactionDetails.class.php");
|
7 |
+
require_once(dirname(__FILE__) ."/dto/transactionapiservice/TransactionItemDetails.class.php");
|
8 |
+
require_once(dirname(__FILE__) ."/dto/transactionapiservice/TransactionsFilter.class.php");
|
9 |
+
require_once(dirname(__FILE__) ."/dto/transactionapiservice/TransactionSide.enum.php");
|
10 |
+
require_once(dirname(__FILE__) ."/dto/transactionapiservice/TransactionType.enum.php");
|
11 |
+
require_once(dirname(__FILE__) ."/dto/FileInfo.class.php");
|
12 |
+
|
13 |
+
class TransactionsApiClient extends AbstractRestApiClient
|
14 |
+
{
|
15 |
+
protected function getServiceAddress(){ return '/transactions'; }
|
16 |
+
|
17 |
+
////////////////////////////////////////////////////////////////////////////
|
18 |
+
|
19 |
+
public function createInvoice(InvoiceData $data)
|
20 |
+
{
|
21 |
+
return $this->__call_ws_action('/createInvoice', $data, 'POST', 'TransactionDetails');
|
22 |
+
}
|
23 |
+
|
24 |
+
public function createOrder(OrderData $data)
|
25 |
+
{
|
26 |
+
return $this->__call_ws_action('/createOrder', $data, 'POST', 'TransactionDetails');
|
27 |
+
}
|
28 |
+
|
29 |
+
public function getTransaction($id)
|
30 |
+
{
|
31 |
+
return $this->__call_ws_action('/details', array('id' => $id), 'GET', 'TransactionDetails');
|
32 |
+
}
|
33 |
+
|
34 |
+
public function listTransactions(TransactionsFilter $filter)
|
35 |
+
{
|
36 |
+
return $this->__call_ws_action('/list', $filter, 'POST', 'TransactionDetails', true);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getDocumentInfo($id)
|
40 |
+
{
|
41 |
+
return $this->__call_ws_action('/document_info', array('id' => $id), 'GET', 'FileInfo');
|
42 |
+
}
|
43 |
+
|
44 |
+
public function downloadDocument($id)
|
45 |
+
{
|
46 |
+
return $this->__call_ws_action('/document', array('id' => $id), 'GET', function($str){ return base64_decode($str); });
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Common/Apiclient/dto/Address.class.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Address
|
4 |
+
{
|
5 |
+
protected $street;
|
6 |
+
protected $city;
|
7 |
+
protected $postCode;
|
8 |
+
protected $countryCode = "PL";
|
9 |
+
|
10 |
+
public function getStreet(){ return $this->street; }
|
11 |
+
public function setStreet($street){ $this->street = $street; }
|
12 |
+
|
13 |
+
public function getCity(){ return $this->city; }
|
14 |
+
public function setCity($city){$this->city = $city; }
|
15 |
+
|
16 |
+
public function getPostCode(){ return $this->postCode; }
|
17 |
+
public function setPostCode($postCode){ $this->postCode = $postCode; }
|
18 |
+
|
19 |
+
public function getCountryCode(){ return $this->countryCode; }
|
20 |
+
public function setCountryCode($countryCode){ $this->countryCode = $countryCode; }
|
21 |
+
}
|
22 |
+
|
23 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/BankAccount.class.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class BankAccount
|
4 |
+
{
|
5 |
+
protected $bankName;
|
6 |
+
protected $number;
|
7 |
+
|
8 |
+
public function getBankName(){ return $this->bankName; }
|
9 |
+
public function setBankName($bankName){ $this->bankName = $bankName; }
|
10 |
+
|
11 |
+
public function getNumber(){ return $this->number; }
|
12 |
+
public function setNumber($number){ $this->number = $number; }
|
13 |
+
}
|
14 |
+
|
15 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/BaseApiData.class.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class BaseApiData
|
4 |
+
{
|
5 |
+
protected $createdAt;
|
6 |
+
protected $modifiedAt;
|
7 |
+
protected $entityVersion;
|
8 |
+
|
9 |
+
public function getCreatedAt(){ return $this->createdAt; }
|
10 |
+
public function setCreatedAt($createdAt){ $this->createdAt = $createdAt; }
|
11 |
+
|
12 |
+
public function getModifiedAt(){ return $this->modifiedAt; }
|
13 |
+
public function setModifiedAt($modifiedAt){ $this->modifiedAt = $modifiedAt; }
|
14 |
+
|
15 |
+
public function getEntityVersion(){ return $this->entityVersion; }
|
16 |
+
public function setEntityVersion($entityVersion){ $this->entityVersion = $entityVersion; }
|
17 |
+
}
|
18 |
+
|
19 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/BaseDocumentDetails.class.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/BaseApiData.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/Contractor.class.php");
|
5 |
+
require_once(dirname(__FILE__) ."/DocumentAttachmentDownloadInfo.class.php");
|
6 |
+
|
7 |
+
abstract class BaseDocumentDetails extends BaseApiData
|
8 |
+
{
|
9 |
+
protected $id;
|
10 |
+
protected $documentNumber;
|
11 |
+
protected $contractor;
|
12 |
+
protected $totalGross;
|
13 |
+
protected $totalNet;
|
14 |
+
protected $totalTax;
|
15 |
+
protected $currency;
|
16 |
+
protected $issueDate;
|
17 |
+
protected $dueDate;
|
18 |
+
protected $attachment;
|
19 |
+
|
20 |
+
public function getId(){ return $this->id; }
|
21 |
+
public function setId($id){ $this->id = $id; }
|
22 |
+
|
23 |
+
public function getDocumentNumber(){ return $this->documentNumber; }
|
24 |
+
public function setDocumentNumber($documentNumber){ $this->documentNumber = $documentNumber; }
|
25 |
+
|
26 |
+
public function getContractor(){ return $this->contractor; }
|
27 |
+
|
28 |
+
public function setContractor(Contractor $contractor){ $this->contractor = $contractor; }
|
29 |
+
|
30 |
+
public function getTotalGross(){ return $this->totalGross; }
|
31 |
+
public function setTotalGross($totalGross){ $this->totalGross = $totalGross; }
|
32 |
+
|
33 |
+
public function getTotalNet(){ return $this->totalNet; }
|
34 |
+
public function setTotalNet($totalNet){ $this->totalNet = $totalNet; }
|
35 |
+
|
36 |
+
public function getTotalTax(){ return $this->totalTax; }
|
37 |
+
public function setTotalTax($totalTax){ $this->totalTax = $totalTax; }
|
38 |
+
|
39 |
+
public function getCurrency(){ return $this->currency; }
|
40 |
+
public function setCurrency($currency){ $this->currency = $currency; }
|
41 |
+
|
42 |
+
public function getIssueDate(){ return $this->issueDate; }
|
43 |
+
public function setIssueDate($issueDate){ $this->issueDate = $issueDate; }
|
44 |
+
|
45 |
+
public function getDueDate(){ return $this->dueDate; }
|
46 |
+
public function setDueDate($dueDate){ $this->dueDate = $dueDate; }
|
47 |
+
|
48 |
+
public function getAttachment(){ return $this->attachment; }
|
49 |
+
public function setAttachment(DocumentAttachmentDownloadInfo $attachment){ $this->attachment = $attachment; }
|
50 |
+
}
|
51 |
+
|
52 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/Contractor.class.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/Address.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/BankAccount.class.php");
|
5 |
+
|
6 |
+
class Contractor
|
7 |
+
{
|
8 |
+
protected $name;
|
9 |
+
protected $taxPayerNumber;
|
10 |
+
protected $companyGovId;
|
11 |
+
protected $email;
|
12 |
+
protected $fax;
|
13 |
+
protected $phone;
|
14 |
+
protected $WWW;
|
15 |
+
protected $account;
|
16 |
+
protected $address;
|
17 |
+
|
18 |
+
public function getName(){ return $this->name; }
|
19 |
+
public function setName($name){ $this->name = $name; }
|
20 |
+
|
21 |
+
public function getTaxPayerNumber(){ return $this->taxPayerNumber; }
|
22 |
+
public function setTaxPayerNumber($taxPayerNumber){ $this->taxPayerNumber = $taxPayerNumber; }
|
23 |
+
|
24 |
+
public function getCompanyGovId(){ return $this->companyGovId; }
|
25 |
+
public function setCompanyGovId($companyGovId){ $this->companyGovId = $companyGovId; }
|
26 |
+
|
27 |
+
public function getEmail(){ return $this->email; }
|
28 |
+
public function setEmail($email){ $this->email = $email; }
|
29 |
+
|
30 |
+
public function getFax(){ return $this->fax; }
|
31 |
+
public function setFax($fax){ $this->fax = $fax; }
|
32 |
+
|
33 |
+
public function getPhone(){ return $this->phone; }
|
34 |
+
public function setPhone($phone){ $this->phone = $phone; }
|
35 |
+
|
36 |
+
public function getWWW(){ return $this->WWW; }
|
37 |
+
public function setWWW($WWW){ $this->WWW = $WWW; }
|
38 |
+
|
39 |
+
public function getAccount(){ return $this->account; }
|
40 |
+
public function setAccount(BankAccount $account){ $this->account = $account; }
|
41 |
+
|
42 |
+
public function getAddress(){ return $this->address; }
|
43 |
+
public function setAddress(Address $address){ $this->address = $address; }
|
44 |
+
}
|
45 |
+
|
46 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/DocumentAttachmentDownloadInfo.class.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/FileInfo.class.php");
|
4 |
+
|
5 |
+
class DocumentAttachmentDownloadInfo extends FileInfo
|
6 |
+
{
|
7 |
+
protected $id;
|
8 |
+
|
9 |
+
public function getId(){ return $this->id; }
|
10 |
+
public function setId($id){ $this->id = $id; }
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/FileData.class.php
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FileData
|
4 |
+
{
|
5 |
+
protected $name;
|
6 |
+
protected $mimeType;
|
7 |
+
protected $content;
|
8 |
+
|
9 |
+
public function getName(){ return $this->name; }
|
10 |
+
public function setName($name){ $this->name = $name; }
|
11 |
+
|
12 |
+
public function getMimeType(){ return $this->mimeType; }
|
13 |
+
public function setMimeType($mimeType){ $this->mimeType = $mimeType; }
|
14 |
+
|
15 |
+
public function getContent(){ return $this->content; }
|
16 |
+
public function setContent($content){ $this->content = $content; }
|
17 |
+
|
18 |
+
public function setContentFromBin($data){ $this->content = base64_encode($data); }
|
19 |
+
|
20 |
+
public function setContentFromFile($path)
|
21 |
+
{
|
22 |
+
$this->setContentFromBin(file_get_contents($path));
|
23 |
+
}
|
24 |
+
|
25 |
+
public function setFromFile($path)
|
26 |
+
{
|
27 |
+
$this->setContentFromFile($path);
|
28 |
+
$this->setName(pathinfo($path, PATHINFO_BASENAME));
|
29 |
+
$this->setMimeType($this->detectMimeType($this->getName()));
|
30 |
+
}
|
31 |
+
|
32 |
+
protected function detectMimeType($filename)
|
33 |
+
{
|
34 |
+
$mime_types = array(
|
35 |
+
|
36 |
+
'txt' => 'text/plain',
|
37 |
+
'htm' => 'text/html',
|
38 |
+
'html' => 'text/html',
|
39 |
+
'php' => 'text/html',
|
40 |
+
'css' => 'text/css',
|
41 |
+
'js' => 'application/javascript',
|
42 |
+
'json' => 'application/json',
|
43 |
+
'xml' => 'application/xml',
|
44 |
+
'swf' => 'application/x-shockwave-flash',
|
45 |
+
'flv' => 'video/x-flv',
|
46 |
+
|
47 |
+
// images
|
48 |
+
'png' => 'image/png',
|
49 |
+
'jpe' => 'image/jpeg',
|
50 |
+
'jpeg' => 'image/jpeg',
|
51 |
+
'jpg' => 'image/jpeg',
|
52 |
+
'gif' => 'image/gif',
|
53 |
+
'bmp' => 'image/bmp',
|
54 |
+
'ico' => 'image/vnd.microsoft.icon',
|
55 |
+
'tiff' => 'image/tiff',
|
56 |
+
'tif' => 'image/tiff',
|
57 |
+
'svg' => 'image/svg+xml',
|
58 |
+
'svgz' => 'image/svg+xml',
|
59 |
+
|
60 |
+
// archives
|
61 |
+
'zip' => 'application/zip',
|
62 |
+
'rar' => 'application/x-rar-compressed',
|
63 |
+
'exe' => 'application/x-msdownload',
|
64 |
+
'msi' => 'application/x-msdownload',
|
65 |
+
'cab' => 'application/vnd.ms-cab-compressed',
|
66 |
+
|
67 |
+
// audio/video
|
68 |
+
'mp3' => 'audio/mpeg',
|
69 |
+
'qt' => 'video/quicktime',
|
70 |
+
'mov' => 'video/quicktime',
|
71 |
+
|
72 |
+
// adobe
|
73 |
+
'pdf' => 'application/pdf',
|
74 |
+
'psd' => 'image/vnd.adobe.photoshop',
|
75 |
+
'ai' => 'application/postscript',
|
76 |
+
'eps' => 'application/postscript',
|
77 |
+
'ps' => 'application/postscript',
|
78 |
+
|
79 |
+
// ms office
|
80 |
+
'doc' => 'application/msword',
|
81 |
+
'rtf' => 'application/rtf',
|
82 |
+
'xls' => 'application/vnd.ms-excel',
|
83 |
+
'ppt' => 'application/vnd.ms-powerpoint',
|
84 |
+
|
85 |
+
// open office
|
86 |
+
'odt' => 'application/vnd.oasis.opendocument.text',
|
87 |
+
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
|
88 |
+
);
|
89 |
+
|
90 |
+
$ext = pathinfo($filename, PATHINFO_EXTENSION);
|
91 |
+
|
92 |
+
if (array_key_exists($ext, $mime_types)) {
|
93 |
+
return $mime_types[$ext];
|
94 |
+
}
|
95 |
+
elseif (function_exists('finfo_open')) {
|
96 |
+
$finfo = finfo_open(FILEINFO_MIME);
|
97 |
+
$mimetype = finfo_file($finfo, $filename);
|
98 |
+
finfo_close($finfo);
|
99 |
+
return $mimetype;
|
100 |
+
}
|
101 |
+
else {
|
102 |
+
return 'application/octet-stream';
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/FileInfo.class.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FileInfo
|
4 |
+
{
|
5 |
+
protected $name;
|
6 |
+
protected $mimeType;
|
7 |
+
protected $size;
|
8 |
+
|
9 |
+
public function getName(){ return $this->name; }
|
10 |
+
public function setName($name){ $this->name = $name; }
|
11 |
+
|
12 |
+
public function getMimeType(){ return $this->mimeType; }
|
13 |
+
public function setMimeType($mimeType){ $this->mimeType = $mimeType; }
|
14 |
+
|
15 |
+
public function getSize(){ return $this->size; }
|
16 |
+
public function setSize($size){ $this->size = $size; }
|
17 |
+
}
|
18 |
+
|
19 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/ListFilter.class.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ListFilter
|
4 |
+
{
|
5 |
+
protected $modifiedAfter;
|
6 |
+
protected $modifiedBefore;
|
7 |
+
protected $limit;
|
8 |
+
protected $from;
|
9 |
+
|
10 |
+
public function getModifiedAfter(){ return $this->modifiedAfter; }
|
11 |
+
public function setModifiedAfter($modifiedAfter){ $this->modifiedAfter = $modifiedAfter; }
|
12 |
+
|
13 |
+
public function getModifiedBefore(){ return $this->modifiedBefore; }
|
14 |
+
public function setModifiedBefore($modifiedBefore){ $this->modifiedBefore; }
|
15 |
+
|
16 |
+
public function getLimit(){ return $this->limit; }
|
17 |
+
public function setLimit($limit){ $this->limit = $limit; }
|
18 |
+
|
19 |
+
public function getFrom(){ return $this->from; }
|
20 |
+
public function setFrom($from){ $this->from = $from; }
|
21 |
+
}
|
22 |
+
|
23 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/liabilitiesapiservice/CommissionInvoiceDetails.class.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/LiabilityDocumentDetails.class.php");
|
4 |
+
|
5 |
+
class CommissionInvoiceDetails extends LiabilityDocumentDetails
|
6 |
+
{
|
7 |
+
}
|
8 |
+
|
9 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/liabilitiesapiservice/InterestInvoiceDetails.class.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/LiabilityDocumentDetails.class.php");
|
4 |
+
|
5 |
+
class InterestInvoiceDetails extends LiabilityDocumentDetails
|
6 |
+
{
|
7 |
+
}
|
8 |
+
|
9 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/liabilitiesapiservice/InterestNoteDetails.class.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/LiabilityDocumentDetails.class.php");
|
4 |
+
|
5 |
+
class InterestNoteDetails extends LiabilityDocumentDetails
|
6 |
+
{
|
7 |
+
}
|
8 |
+
|
9 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/liabilitiesapiservice/LiabilityDocumentDetails.class.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) . "/../BaseDocumentDetails.class.php");
|
4 |
+
|
5 |
+
abstract class LiabilityDocumentDetails extends BaseDocumentDetails
|
6 |
+
{
|
7 |
+
protected $unsettledGross;
|
8 |
+
protected $unsettledNet;
|
9 |
+
protected $unsettledTax;
|
10 |
+
|
11 |
+
public function getUnsettledGross(){ return $this->unsettledGross; }
|
12 |
+
public function setUnsettledGross($unsettledGross){ $this->unsettledGross = $unsettledGross; }
|
13 |
+
|
14 |
+
public function getUnsettledNet(){ return $this->unsettledNet; }
|
15 |
+
public function setUnsettledNet($unsettledNet){ $this->unsettledNet = $unsettledNet; }
|
16 |
+
|
17 |
+
public function getUnsettledTax(){ return $this->unsettledTax; }
|
18 |
+
public function setUnsettledTax($unsettledTax){ $this->unsettledTax = $unsettledTax; }
|
19 |
+
}
|
20 |
+
|
21 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/CallbackDataFormat.enum.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class CallbackDataFormat
|
4 |
+
{
|
5 |
+
const JSON = "JSON";
|
6 |
+
const XML = "XML";
|
7 |
+
}
|
8 |
+
|
9 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/OrderToInvoiceData.class.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class OrderToInvoiceData
|
4 |
+
{
|
5 |
+
protected $invoiceDocumentNumber;
|
6 |
+
protected $issueDate;
|
7 |
+
protected $dueDate;
|
8 |
+
|
9 |
+
public function getInvoiceDocumentNumber() { return $this->invoiceDocumentNumber; }
|
10 |
+
public function setInvoiceDocumentNumber($invoiceDocumentNumber) { $this->invoiceDocumentNumber = $invoiceDocumentNumber; }
|
11 |
+
|
12 |
+
public function getIssueDate() { return $this->issueDate; }
|
13 |
+
public function setIssueDate($issueDate) { $this->issueDate = $issueDate; }
|
14 |
+
|
15 |
+
public function getDueDate() { return $this->dueDate; }
|
16 |
+
public function setDueDate($dueDate) { $this->dueDate = $dueDate; }
|
17 |
+
}
|
18 |
+
|
19 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentCreationData.class.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/CallbackDataFormat.enum.php");
|
4 |
+
require_once(dirname(__FILE__) ."/../Contractor.class.php");
|
5 |
+
|
6 |
+
class PaymentCreationData
|
7 |
+
{
|
8 |
+
protected $returnUrl;
|
9 |
+
protected $statusUrl;
|
10 |
+
protected $statusDataFormat = CallbackDataFormat::JSON;
|
11 |
+
protected $documentNumber;
|
12 |
+
protected $issueDate;
|
13 |
+
protected $dueDate;
|
14 |
+
protected $priceGross;
|
15 |
+
protected $currency = "PLN";
|
16 |
+
protected $buyerGovId;
|
17 |
+
protected $buyerEmail;
|
18 |
+
protected $note;
|
19 |
+
protected $noRisk = null;
|
20 |
+
protected $isInvoice = false;
|
21 |
+
|
22 |
+
public function getReturnUrl(){ return $this->returnUrl; }
|
23 |
+
|
24 |
+
public function setReturnUrl($returnUrl){ $this->returnUrl = $returnUrl; }
|
25 |
+
|
26 |
+
public function getStatusUrl(){ return $this->statusUrl; }
|
27 |
+
public function setStatusUrl($statusUrl){ $this->statusUrl = $statusUrl; }
|
28 |
+
|
29 |
+
public function getStatusDataFormat(){ return $this->statusDataFormat; }
|
30 |
+
public function setStatusDataFormat($statusDataFormat){$this->statusDataFormat = $statusDataFormat; }
|
31 |
+
|
32 |
+
public function getDocumentNumber(){ return $this->documentNumber; }
|
33 |
+
public function setDocumentNumber($documentNumber){ $this->documentNumber = $documentNumber; }
|
34 |
+
|
35 |
+
public function getDueDate(){ return $this->dueDate; }
|
36 |
+
public function setDueDate($dueDate){ $this->dueDate = $dueDate; }
|
37 |
+
|
38 |
+
public function getIssueDate(){ return $this->issueDate; }
|
39 |
+
public function setIssueDate($issueDate){ $this->issueDate = $issueDate; }
|
40 |
+
|
41 |
+
public function getPriceGross(){ return $this->priceGross; }
|
42 |
+
public function setPriceGross($priceGross){ $this->priceGross = $priceGross; }
|
43 |
+
|
44 |
+
public function getCurrency(){ return $this->currency; }
|
45 |
+
public function setCurrency($currency){ $this->currency = $currency; }
|
46 |
+
|
47 |
+
public function getBuyerGovId(){ return $this->buyerGovId; }
|
48 |
+
public function setBuyerGovId($buyerGovId){ $this->buyerGovId = $buyerGovId; }
|
49 |
+
|
50 |
+
public function getBuyerEmail(){ return $this->buyerEmail; }
|
51 |
+
public function setBuyerEmail($buyerEmail){ $this->buyerEmail = $buyerEmail; }
|
52 |
+
|
53 |
+
public function getNote(){ return $this->note; }
|
54 |
+
public function setNote($note){ $this->note = $note; }
|
55 |
+
|
56 |
+
public function getNoRisk(){ return $this->noRisk; }
|
57 |
+
public function setNoRisk($noRisk){ $this->noRisk = $noRisk; }
|
58 |
+
|
59 |
+
public function getIsInvoice(){ return $this->isInvoice; }
|
60 |
+
public function setIsInvoice($isInvoice){ $this->isInvoice = $isInvoice; }
|
61 |
+
}
|
62 |
+
|
63 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentData.class.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/PaymentRequestStatus.enum.php");
|
4 |
+
require_once(dirname(__FILE__) ."/../Contractor.class.php");
|
5 |
+
|
6 |
+
class PaymentData
|
7 |
+
{
|
8 |
+
|
9 |
+
protected $paymentId;
|
10 |
+
protected $transactionId;
|
11 |
+
protected $buyer;
|
12 |
+
protected $created;
|
13 |
+
protected $timeoutDate;
|
14 |
+
protected $status;
|
15 |
+
protected $note;
|
16 |
+
|
17 |
+
public function getPaymentId(){ return $this->paymentId; }
|
18 |
+
public function setPaymentId($paymentId){ $this->paymentId = $paymentId; }
|
19 |
+
|
20 |
+
public function getTransactionId(){ return $this->transactionId; }
|
21 |
+
public function setTransactionId($transactionId){ $this->transactionId = $transactionId; }
|
22 |
+
|
23 |
+
public function getBuyer(){ return $this->buyer; }
|
24 |
+
public function setBuyer(Contractor $buyer){ $this->buyer = $buyer; }
|
25 |
+
|
26 |
+
public function getCreated(){ return $this->created; }
|
27 |
+
public function setCreated($created){ $this->created = $created; }
|
28 |
+
|
29 |
+
public function getTimeoutDate(){ return $this->timeoutDate; }
|
30 |
+
public function setTimeoutDate($timeoutDate){ $this->timeoutDate = $timeoutDate; }
|
31 |
+
|
32 |
+
public function getStatus(){ return $this->status; }
|
33 |
+
public function setStatus($status){ $this->status = $status; }
|
34 |
+
|
35 |
+
public function getNote(){ return $this->note; }
|
36 |
+
public function setNote($note){ $this->note = $note; }
|
37 |
+
}
|
38 |
+
|
39 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentManagementData.class.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../FileData.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/OrderToInvoiceData.class.php");
|
5 |
+
|
6 |
+
class PaymentManagementData
|
7 |
+
{
|
8 |
+
protected $paymentId;
|
9 |
+
protected $conversionData;
|
10 |
+
protected $document;
|
11 |
+
protected $doConfirmDelivery;
|
12 |
+
|
13 |
+
public function getPaymentId() { return $this->paymentId; }
|
14 |
+
public function setPaymentId($paymentId) { $this->paymentId = $paymentId; }
|
15 |
+
|
16 |
+
public function getConversionData() { return $this->conversionData; }
|
17 |
+
public function setConversionData(OrderToInvoiceData $conversionData) { $this->conversionData = $conversionData; }
|
18 |
+
|
19 |
+
public function getDocument() { return $this->document; }
|
20 |
+
public function setDocument(FileData $document) { $this->document = $document; }
|
21 |
+
|
22 |
+
public function getDoConfirmDelivery() { return $this->doConfirmDelivery; }
|
23 |
+
public function setDoConfirmDelivery($doConfirmDelivery) { $this->doConfirmDelivery = $doConfirmDelivery; }
|
24 |
+
|
25 |
+
}
|
26 |
+
|
27 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentRequestStatus.enum.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class PaymentRequestStatus
|
4 |
+
{
|
5 |
+
const STARTED = "STARTED";
|
6 |
+
const REGISTRATION_PROBLEM = "REGISTRATION_PROBLEM";
|
7 |
+
const OUT_OF_LIMIT = "OUT_OF_LIMIT";
|
8 |
+
const COMPLETED = "COMPLETED";
|
9 |
+
const TIMEDOUT = "TIMEDOUT";
|
10 |
+
}
|
11 |
+
|
12 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/paygateapiservice/PaymentStartInfo.class.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PaymentStartInfo
|
4 |
+
{
|
5 |
+
protected $paymentId;
|
6 |
+
protected $redirectUrl;
|
7 |
+
protected $timeoutDate;
|
8 |
+
|
9 |
+
public function getPaymentId(){ return $this->paymentId; }
|
10 |
+
public function setPaymentId($paymentId){ $this->paymentId = $paymentId; }
|
11 |
+
|
12 |
+
public function getRedirectUrl(){ return $this->redirectUrl; }
|
13 |
+
public function setRedirectUrl($redirectUrl){ $this->redirectUrl = $redirectUrl; }
|
14 |
+
|
15 |
+
public function getTimeoutDate(){ return $this->timeoutDate; }
|
16 |
+
public function setTimeoutDate($timeoutDate){ $this->timeoutDate = $timeoutDate; }
|
17 |
+
}
|
18 |
+
|
19 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportCommissionInvoiceItem.class.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportCommissionInvoiceItem extends DocumentItem
|
6 |
+
{
|
7 |
+
private $issueDate;
|
8 |
+
private $documentId;
|
9 |
+
private $value;
|
10 |
+
private $netValue;
|
11 |
+
private $commissionValue;
|
12 |
+
private $commissionNetValue;
|
13 |
+
private $commissionType;
|
14 |
+
|
15 |
+
public function getIssueDate(){
|
16 |
+
return $this->issueDate;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function setIssueDate($issueDate){
|
20 |
+
$this->issueDate = $issueDate;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getDocumentId(){
|
24 |
+
return $this->documentId;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function setDocumentId($documentId){
|
28 |
+
$this->documentId = $documentId;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getValue(){
|
32 |
+
return $this->value;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function setValue($value){
|
36 |
+
$this->value = $value;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getNetValue(){
|
40 |
+
return $this->netValue;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function setNetValue($netValue){
|
44 |
+
$this->netValue = $netValue;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getCommissionValue(){
|
48 |
+
return $this->commissionValue;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function setCommissionValue($commissionValue){
|
52 |
+
$this->commissionValue = $commissionValue;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function getCommissionNetValue(){
|
56 |
+
return $this->commissionNetValue;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function setCommissionNetValue($commissionNetValue){
|
60 |
+
$this->commissionNetValue = $commissionNetValue;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function getCommissionType(){
|
64 |
+
return $this->commissionType;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function setCommissionType($commissionType){
|
68 |
+
$this->commissionType = $commissionType;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportDocument.class.php
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/AccountantReportSaleItem.class.php");
|
5 |
+
require_once(dirname(__FILE__) ."/AccountantReportPurchaseItem.class.php");
|
6 |
+
require_once(dirname(__FILE__) ."/AccountantReportSettlementItem.class.php");
|
7 |
+
require_once(dirname(__FILE__) ."/AccountantReportCommissionInvoiceItem.class.php");
|
8 |
+
require_once(dirname(__FILE__) ."/AccountantReportInterestInvoiceItem.class.php");
|
9 |
+
require_once(dirname(__FILE__) ."/AccountantReportInterestNoteItem.class.php");
|
10 |
+
require_once(dirname(__FILE__) ."/AccountantReportPaymentItem.class.php");
|
11 |
+
require_once(dirname(__FILE__) ."/AccountantReportPayoffItem.class.php");
|
12 |
+
require_once(dirname(__FILE__) ."/AccountantReportResaleStatementItem.class.php");
|
13 |
+
require_once(dirname(__FILE__) ."/AccountantReportRSReversedSettlementItem.class.php");
|
14 |
+
require_once(dirname(__FILE__) ."/AccountantReportRSSettlementItem.class.php");
|
15 |
+
require_once(dirname(__FILE__) ."/AccountantReportRSPSettlementItem.class.php");
|
16 |
+
require_once(dirname(__FILE__) ."/AccountantReportRSBItem.class.php");
|
17 |
+
|
18 |
+
class AccountantReportDocument
|
19 |
+
{
|
20 |
+
protected $id;
|
21 |
+
protected $createdAt;
|
22 |
+
protected $clientName;
|
23 |
+
protected $clientNIP;
|
24 |
+
protected $collectedFrom;
|
25 |
+
protected $collectedTo;
|
26 |
+
|
27 |
+
protected $sales = array();
|
28 |
+
protected $purchases = array();
|
29 |
+
protected $settlements = array();
|
30 |
+
protected $commissionInvoices = array();
|
31 |
+
protected $interestInvoices = array();
|
32 |
+
protected $interestNotes = array();
|
33 |
+
protected $payments = array();
|
34 |
+
protected $overpayments = array();
|
35 |
+
protected $payoffs = array();
|
36 |
+
protected $resaleStatements = array();
|
37 |
+
protected $rsReversedSettlements = array();
|
38 |
+
protected $rsSettlements = array();
|
39 |
+
protected $rspSettlements = array();
|
40 |
+
protected $rsbs = array();
|
41 |
+
|
42 |
+
public function getId(){
|
43 |
+
return $this->id;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function setId($id){
|
47 |
+
$this->id = $id;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getCreatedAt(){
|
51 |
+
return $this->createdAt;
|
52 |
+
}
|
53 |
+
|
54 |
+
public function setCreatedAt($createdAt){
|
55 |
+
$this->createdAt = $createdAt;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getClientName(){
|
59 |
+
return $this->clientName;
|
60 |
+
}
|
61 |
+
|
62 |
+
public function setClientName($clientName){
|
63 |
+
$this->clientName = $clientName;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function getClientNIP(){
|
67 |
+
return $this->clientNIP;
|
68 |
+
}
|
69 |
+
|
70 |
+
public function setClientNIP($clientNIP){
|
71 |
+
$this->clientNIP = $clientNIP;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function getCollectedFrom(){
|
75 |
+
return $this->collectedFrom;
|
76 |
+
}
|
77 |
+
|
78 |
+
public function setCollectedFrom($collectedFrom){
|
79 |
+
$this->collectedFrom = $collectedFrom;
|
80 |
+
}
|
81 |
+
|
82 |
+
public function getCollectedTo(){
|
83 |
+
return $this->collectedTo;
|
84 |
+
}
|
85 |
+
|
86 |
+
public function setCollectedTo($collectedTo){
|
87 |
+
$this->collectedTo = $collectedTo;
|
88 |
+
}
|
89 |
+
|
90 |
+
public function getSales(){
|
91 |
+
return $this->sales;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function setSales(array $sales, AccountantReportSaleItem $itemTypeHint = null){
|
95 |
+
$this->sales = $sales;
|
96 |
+
}
|
97 |
+
|
98 |
+
public function getPurchases(){
|
99 |
+
return $this->purchases;
|
100 |
+
}
|
101 |
+
|
102 |
+
public function setPurchases(array $purchases, AccountantReportPurchaseItem $itemTypeHint = null){
|
103 |
+
$this->purchases = $purchases;
|
104 |
+
}
|
105 |
+
|
106 |
+
public function getSettlements(){
|
107 |
+
return $this->settlements;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function setSettlements(array $settlements, AccountantReportSettlementItem $itemTypeHint = null){
|
111 |
+
$this->settlements = $settlements;
|
112 |
+
}
|
113 |
+
|
114 |
+
public function getCommissionInvoices(){
|
115 |
+
return $this->commissionInvoices;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function setCommissionInvoices(array $commissionInvoices, AccountantReportCommissionInvoiceItem $itemTypeHint = null){
|
119 |
+
$this->commissionInvoices = $commissionInvoices;
|
120 |
+
}
|
121 |
+
|
122 |
+
public function getInterestInvoices(){
|
123 |
+
return $this->interestInvoices;
|
124 |
+
}
|
125 |
+
|
126 |
+
public function setInterestInvoices(array $interestInvoices, AccountantReportInterestInvoiceItem $itemTypeHint = null){
|
127 |
+
$this->interestInvoices = $interestInvoices;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function getInterestNotes(){
|
131 |
+
return $this->interestNotes;
|
132 |
+
}
|
133 |
+
|
134 |
+
public function setInterestNotes(array $interestNotes, AccountantReportInterestNoteItem $itemTypeHint = null){
|
135 |
+
$this->interestNotes = $interestNotes;
|
136 |
+
}
|
137 |
+
|
138 |
+
public function getPayments(){
|
139 |
+
return $this->payments;
|
140 |
+
}
|
141 |
+
|
142 |
+
public function setPayments(array $payments, AccountantReportPaymentItem $itemTypeHint = null){
|
143 |
+
$this->payments = $payments;
|
144 |
+
}
|
145 |
+
|
146 |
+
public function getOverpayments(){
|
147 |
+
return $this->overpayments;
|
148 |
+
}
|
149 |
+
|
150 |
+
public function setOverpayments(array $overpayments, AccountantReportPaymentItem $itemTypeHint = null){
|
151 |
+
$this->overpayments = $overpayments;
|
152 |
+
}
|
153 |
+
|
154 |
+
public function getPayoffs(){
|
155 |
+
return $this->payoffs;
|
156 |
+
}
|
157 |
+
|
158 |
+
public function setPayoffs(array $payoffs, AccountantReportPayoffItem $itemTypeHint = null){
|
159 |
+
$this->payoffs = $payoffs;
|
160 |
+
}
|
161 |
+
|
162 |
+
public function getResaleStatements(){
|
163 |
+
return $this->resaleStatements;
|
164 |
+
}
|
165 |
+
|
166 |
+
public function setResaleStatements(array $resaleStatements, AccountantReportResaleStatementItem $itemTypeHint = null){
|
167 |
+
$this->resaleStatements = $resaleStatements;
|
168 |
+
}
|
169 |
+
|
170 |
+
public function getRsReversedSettlements(){
|
171 |
+
return $this->rsReversedSettlements;
|
172 |
+
}
|
173 |
+
|
174 |
+
public function setRsReversedSettlements(array $rsReversedSettlements, AccountantReportRSReversedSettlementItem $itemTypeHint = null){
|
175 |
+
$this->rsReversedSettlements = $rsReversedSettlements;
|
176 |
+
}
|
177 |
+
|
178 |
+
public function getRsSettlements(){
|
179 |
+
return $this->rsSettlements;
|
180 |
+
}
|
181 |
+
|
182 |
+
public function setRsSettlements(array $rsSettlements, AccountantReportRSSettlementItem $itemTypeHint = null){
|
183 |
+
$this->rsSettlements = $rsSettlements;
|
184 |
+
}
|
185 |
+
|
186 |
+
public function getRspSettlements(){
|
187 |
+
return $this->rspSettlements;
|
188 |
+
}
|
189 |
+
|
190 |
+
public function setRspSettlements(array $rspSettlements, AccountantReportRSPSettlementItem $itemTypeHint = null){
|
191 |
+
$this->rspSettlements = $rspSettlements;
|
192 |
+
}
|
193 |
+
|
194 |
+
public function getRsbs(){
|
195 |
+
return $this->rsbs;
|
196 |
+
}
|
197 |
+
|
198 |
+
public function setRsbs(array $rsbs, AccountantReportRSBItem $itemTypeHint = null){
|
199 |
+
$this->rsbs = $rsbs;
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportInterestInvoiceItem.class.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportInterestInvoiceItem extends DocumentItem
|
6 |
+
{
|
7 |
+
private $issueDate;
|
8 |
+
private $documentId;
|
9 |
+
private $rsDocumentId;
|
10 |
+
private $value;
|
11 |
+
private $netValue;
|
12 |
+
|
13 |
+
public function getIssueDate(){
|
14 |
+
return $this->issueDate;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function setIssueDate($issueDate){
|
18 |
+
$this->issueDate = $issueDate;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getDocumentId(){
|
22 |
+
return $this->documentId;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function setDocumentId($documentId){
|
26 |
+
$this->documentId = $documentId;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function getRsDocumentId(){
|
30 |
+
return $this->rsDocumentId;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function setRsDocumentId($rsDocumentId){
|
34 |
+
$this->rsDocumentId = $rsDocumentId;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getValue(){
|
38 |
+
return $this->value;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function setValue($value){
|
42 |
+
$this->value = $value;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function getNetValue(){
|
46 |
+
return $this->netValue;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function setNetValue($netValue){
|
50 |
+
$this->netValue = $netValue;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportInterestNoteItem.class.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportInterestNoteItem extends DocumentItem
|
6 |
+
{
|
7 |
+
private $issueDate;
|
8 |
+
private $documentId;
|
9 |
+
private $sourceId;
|
10 |
+
private $value;
|
11 |
+
|
12 |
+
public function getIssueDate(){
|
13 |
+
return $this->issueDate;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function setIssueDate($issueDate){
|
17 |
+
$this->issueDate = $issueDate;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getDocumentId(){
|
21 |
+
return $this->documentId;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function setDocumentId($documentId){
|
25 |
+
$this->documentId = $documentId;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getSourceId(){
|
29 |
+
return $this->sourceId;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function setSourceId($sourceId){
|
33 |
+
$this->sourceId = $sourceId;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getValue(){
|
37 |
+
return $this->value;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function setValue($value){
|
41 |
+
$this->value = $value;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportPaymentItem.class.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportPaymentItem extends DocumentItem
|
6 |
+
{
|
7 |
+
private $paymentDate;
|
8 |
+
private $value;
|
9 |
+
private $documentId;
|
10 |
+
private $confirmationDocumentId;
|
11 |
+
private $settlementValue;
|
12 |
+
private $settlementDate;
|
13 |
+
private $targetKind;
|
14 |
+
private $targetDocumentId;
|
15 |
+
|
16 |
+
public function getPaymentDate(){
|
17 |
+
return $this->paymentDate;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function setPaymentDate($paymentDate){
|
21 |
+
$this->paymentDate = $paymentDate;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function getValue(){
|
25 |
+
return $this->value;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function setValue($value){
|
29 |
+
$this->value = $value;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function getDocumentId(){
|
33 |
+
return $this->documentId;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function setDocumentId($documentId){
|
37 |
+
$this->documentId = $documentId;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getConfirmationDocumentId(){
|
41 |
+
return $this->confirmationDocumentId;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function setConfirmationDocumentId($confirmationDocumentId){
|
45 |
+
$this->confirmationDocumentId = $confirmationDocumentId;
|
46 |
+
}
|
47 |
+
|
48 |
+
public function getSettlementValue(){
|
49 |
+
return $this->settlementValue;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function setSettlementValue($settlementValue){
|
53 |
+
$this->settlementValue = $settlementValue;
|
54 |
+
}
|
55 |
+
|
56 |
+
public function getSettlementDate(){
|
57 |
+
return $this->settlementDate;
|
58 |
+
}
|
59 |
+
|
60 |
+
public function setSettlementDate($settlementDate){
|
61 |
+
$this->settlementDate = $settlementDate;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function getTargetKind(){
|
65 |
+
return $this->targetKind;
|
66 |
+
}
|
67 |
+
|
68 |
+
public function setTargetKind($targetKind){
|
69 |
+
$this->targetKind = $targetKind;
|
70 |
+
}
|
71 |
+
|
72 |
+
public function getTargetDocumentId(){
|
73 |
+
return $this->targetDocumentId;
|
74 |
+
}
|
75 |
+
|
76 |
+
public function setTargetDocumentId($targetDocumentId){
|
77 |
+
$this->targetDocumentId = $targetDocumentId;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportPayoffItem.class.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportPayoffItem extends DocumentItem
|
6 |
+
{
|
7 |
+
private $payoffDate;
|
8 |
+
private $saleDocumentId;
|
9 |
+
private $value;
|
10 |
+
private $confirmationDocumentId;
|
11 |
+
private $payoffValue;
|
12 |
+
private $commissionInvoiceDocumentId;
|
13 |
+
private $commissionType;
|
14 |
+
private $settlementValue;
|
15 |
+
private $settlementNetValue;
|
16 |
+
|
17 |
+
public function getPayoffDate(){
|
18 |
+
return $this->payoffDate;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function setPayoffDate($payoffDate){
|
22 |
+
$this->payoffDate = $payoffDate;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getSaleDocumentId(){
|
26 |
+
return $this->saleDocumentId;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function setSaleDocumentId($saleDocumentId){
|
30 |
+
$this->saleDocumentId = $saleDocumentId;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getValue(){
|
34 |
+
return $this->value;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function setValue($value){
|
38 |
+
$this->value = $value;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getConfirmationDocumentId(){
|
42 |
+
return $this->confirmationDocumentId;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function setConfirmationDocumentId($confirmationDocumentId){
|
46 |
+
$this->confirmationDocumentId = $confirmationDocumentId;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function getPayoffValue(){
|
50 |
+
return $this->payoffValue;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function setPayoffValue($payoffValue){
|
54 |
+
$this->payoffValue = $payoffValue;
|
55 |
+
}
|
56 |
+
|
57 |
+
public function getCommissionInvoiceDocumentId(){
|
58 |
+
return $this->commissionInvoiceDocumentId;
|
59 |
+
}
|
60 |
+
|
61 |
+
public function setCommissionInvoiceDocumentId($commissionInvoiceDocumentId){
|
62 |
+
$this->commissionInvoiceDocumentId = $commissionInvoiceDocumentId;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getCommissionType(){
|
66 |
+
return $this->commissionType;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function setCommissionType($commissionType){
|
70 |
+
$this->commissionType = $commissionType;
|
71 |
+
}
|
72 |
+
|
73 |
+
public function getSettlementValue(){
|
74 |
+
return $this->settlementValue;
|
75 |
+
}
|
76 |
+
|
77 |
+
public function setSettlementValue($settlementValue){
|
78 |
+
$this->settlementValue = $settlementValue;
|
79 |
+
}
|
80 |
+
|
81 |
+
public function getSettlementNetValue(){
|
82 |
+
return $this->settlementNetValue;
|
83 |
+
}
|
84 |
+
|
85 |
+
public function setSettlementNetValue($settlementNetValue){
|
86 |
+
$this->settlementNetValue = $settlementNetValue;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportPurchaseItem.class.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportPurchaseItem extends DocumentItem
|
6 |
+
{
|
7 |
+
private $contractorNIP;
|
8 |
+
private $documentId;
|
9 |
+
private $createDate;
|
10 |
+
private $issueDate;
|
11 |
+
private $dueDate;
|
12 |
+
private $value;
|
13 |
+
private $currency;
|
14 |
+
private $convertedValue;
|
15 |
+
private $convertedCurrency;
|
16 |
+
|
17 |
+
public function getContractorNIP(){
|
18 |
+
return $this->contractorNIP;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function setContractorNIP($contractorNIP){
|
22 |
+
$this->contractorNIP = $contractorNIP;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getDocumentId(){
|
26 |
+
return $this->documentId;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function setDocumentId($documentId){
|
30 |
+
$this->documentId = $documentId;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getCreateDate(){
|
34 |
+
return $this->createDate;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function setCreateDate($createDate){
|
38 |
+
$this->createDate = $createDate;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getIssueDate(){
|
42 |
+
return $this->issueDate;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function setIssueDate($issueDate){
|
46 |
+
$this->issueDate = $issueDate;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function getDueDate(){
|
50 |
+
return $this->dueDate;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function setDueDate($dueDate){
|
54 |
+
$this->dueDate = $dueDate;
|
55 |
+
}
|
56 |
+
|
57 |
+
public function getValue(){
|
58 |
+
return $this->value;
|
59 |
+
}
|
60 |
+
|
61 |
+
public function setValue($value){
|
62 |
+
$this->value = $value;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getCurrency(){
|
66 |
+
return $this->currency;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function setCurrency($currency){
|
70 |
+
$this->currency = $currency;
|
71 |
+
}
|
72 |
+
|
73 |
+
public function getConvertedValue(){
|
74 |
+
return $this->convertedValue;
|
75 |
+
}
|
76 |
+
|
77 |
+
public function setConvertedValue($convertedValue){
|
78 |
+
$this->convertedValue = $convertedValue;
|
79 |
+
}
|
80 |
+
|
81 |
+
public function getConvertedCurrency(){
|
82 |
+
return $this->convertedCurrency;
|
83 |
+
}
|
84 |
+
|
85 |
+
public function setConvertedCurrency($convertedCurrency){
|
86 |
+
$this->convertedCurrency = $convertedCurrency;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportRSBItem.class.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportRSBItem extends DocumentItem
|
6 |
+
{
|
7 |
+
protected $issueDate;
|
8 |
+
protected $rsbDocumentId;
|
9 |
+
protected $purchaseDocumentId;
|
10 |
+
protected $purchaseUnsettledValue;
|
11 |
+
|
12 |
+
public function getIssueDate(){
|
13 |
+
return $this->issueDate;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function setIssueDate($issueDate){
|
17 |
+
$this->issueDate = $issueDate;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getRsbDocumentId(){
|
21 |
+
return $this->rsbDocumentId;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function setRsbDocumentId($rsbDocumentId){
|
25 |
+
$this->rsbDocumentId = $rsbDocumentId;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getPurchaseDocumentId(){
|
29 |
+
return $this->purchaseDocumentId;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function setPurchaseDocumentId($purchaseDocumentId){
|
33 |
+
$this->purchaseDocumentId = $purchaseDocumentId;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getPurchaseUnsettledValue(){
|
37 |
+
return $this->purchaseUnsettledValue;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function setPurchaseUnsettledValue($purchaseUnsettledValue){
|
41 |
+
$this->purchaseUnsettledValue = $purchaseUnsettledValue;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportRSPSettlementItem.class.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportRSPSettlementItem extends DocumentItem
|
6 |
+
{
|
7 |
+
protected $issueDate;
|
8 |
+
protected $rspDocumentId;
|
9 |
+
protected $targetKind;
|
10 |
+
protected $targetDocumentId;
|
11 |
+
protected $settlementValue;
|
12 |
+
|
13 |
+
public function getIssueDate(){
|
14 |
+
return $this->issueDate;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function setIssueDate($issueDate){
|
18 |
+
$this->issueDate = $issueDate;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getRspDocumentId(){
|
22 |
+
return $this->rspDocumentId;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function setRspDocumentId($rspDocumentId){
|
26 |
+
$this->rspDocumentId = $rspDocumentId;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function getTargetKind(){
|
30 |
+
return $this->targetKind;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function setTargetKind($targetKind){
|
34 |
+
$this->targetKind = $targetKind;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getTargetDocumentId(){
|
38 |
+
return $this->targetDocumentId;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function setTargetDocumentId($targetDocumentId){
|
42 |
+
$this->targetDocumentId = $targetDocumentId;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function getSettlementValue(){
|
46 |
+
return $this->settlementValue;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function setSettlementValue($settlementValue){
|
50 |
+
$this->settlementValue = $settlementValue;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportRSReversedSettlementItem.class.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportRSReversedSettlementItem extends DocumentItem
|
6 |
+
{
|
7 |
+
private $issueDate;
|
8 |
+
private $saleDocumentId;
|
9 |
+
private $purchaseDocumentId;
|
10 |
+
private $value;
|
11 |
+
|
12 |
+
public function getIssueDate(){
|
13 |
+
return $this->issueDate;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function setIssueDate($issueDate){
|
17 |
+
$this->issueDate = $issueDate;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getSaleDocumentId(){
|
21 |
+
return $this->saleDocumentId;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function setSaleDocumentId($saleDocumentId){
|
25 |
+
$this->saleDocumentId = $saleDocumentId;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getPurchaseDocumentId(){
|
29 |
+
return $this->purchaseDocumentId;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function setPurchaseDocumentId($purchaseDocumentId){
|
33 |
+
$this->purchaseDocumentId = $purchaseDocumentId;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getValue(){
|
37 |
+
return $this->value;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function setValue($value){
|
41 |
+
$this->value = $value;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportRSSettlementItem.class.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportRSSettlementItem extends DocumentItem
|
6 |
+
{
|
7 |
+
protected $operationDate;
|
8 |
+
protected $rsDocumentId;
|
9 |
+
protected $saleDocumentId;
|
10 |
+
protected $value;
|
11 |
+
|
12 |
+
public function getOperationDate(){
|
13 |
+
return $this->operationDate;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function setOperationDate($operationDate){
|
17 |
+
$this->operationDate = $operationDate;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getRsDocumentId(){
|
21 |
+
return $this->rsDocumentId;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function setRsDocumentId($rsDocumentId){
|
25 |
+
$this->rsDocumentId = $rsDocumentId;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getSaleDocumentId(){
|
29 |
+
return $this->saleDocumentId;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function setSaleDocumentId($saleDocumentId){
|
33 |
+
$this->saleDocumentId = $saleDocumentId;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getValue(){
|
37 |
+
return $this->value;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function setValue($value){
|
41 |
+
$this->value = $value;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportResaleStatementItem.class.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportResaleStatementItem extends DocumentItem
|
6 |
+
{
|
7 |
+
private $issueDate;
|
8 |
+
private $documentId;
|
9 |
+
private $value;
|
10 |
+
private $sourceDocumentId;
|
11 |
+
private $sourceValue;
|
12 |
+
private $originalDocumentId;
|
13 |
+
private $contractorNIP;
|
14 |
+
|
15 |
+
public function getIssueDate(){
|
16 |
+
return $this->issueDate;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function setIssueDate($issueDate){
|
20 |
+
$this->issueDate = $issueDate;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getDocumentId(){
|
24 |
+
return $this->documentId;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function setDocumentId($documentId){
|
28 |
+
$this->documentId = $documentId;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getValue(){
|
32 |
+
return $this->value;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function setValue($value){
|
36 |
+
$this->value = $value;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getSourceDocumentId(){
|
40 |
+
return $this->sourceDocumentId;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function setSourceDocumentId($sourceDocumentId){
|
44 |
+
$this->sourceDocumentId = $sourceDocumentId;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getSourceValue(){
|
48 |
+
return $this->sourceValue;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function setSourceValue($sourceValue){
|
52 |
+
$this->sourceValue = $sourceValue;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function getOriginalDocumentId(){
|
56 |
+
return $this->originalDocumentId;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function setOriginalDocumentId($originalDocumentId){
|
60 |
+
$this->originalDocumentId = $originalDocumentId;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function getContractorNIP(){
|
64 |
+
return $this->contractorNIP;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function setContractorNIP($contractorNIP){
|
68 |
+
$this->contractorNIP = $contractorNIP;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportSaleItem.class.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportSaleItem extends DocumentItem
|
6 |
+
{
|
7 |
+
|
8 |
+
private $contractorNIP;
|
9 |
+
private $documentId;
|
10 |
+
private $createDate;
|
11 |
+
private $issueDate;
|
12 |
+
private $dueDate;
|
13 |
+
private $value;
|
14 |
+
private $currency;
|
15 |
+
private $convertedValue;
|
16 |
+
private $convertedCurrency;
|
17 |
+
|
18 |
+
public function getContractorNIP(){
|
19 |
+
return $this->contractorNIP;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function setContractorNIP($contractorNIP){
|
23 |
+
$this->contractorNIP = $contractorNIP;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getDocumentId(){
|
27 |
+
return $this->documentId;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function setDocumentId($documentId){
|
31 |
+
$this->documentId = $documentId;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getCreateDate(){
|
35 |
+
return $this->createDate;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function setCreateDate($createDate){
|
39 |
+
$this->createDate = $createDate;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getIssueDate(){
|
43 |
+
return $this->issueDate;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function setIssueDate($issueDate){
|
47 |
+
$this->issueDate = $issueDate;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getDueDate(){
|
51 |
+
return $this->dueDate;
|
52 |
+
}
|
53 |
+
|
54 |
+
public function setDueDate($dueDate){
|
55 |
+
$this->dueDate = $dueDate;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getValue(){
|
59 |
+
return $this->value;
|
60 |
+
}
|
61 |
+
|
62 |
+
public function setValue($value){
|
63 |
+
$this->value = $value;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function getCurrency(){
|
67 |
+
return $this->currency;
|
68 |
+
}
|
69 |
+
|
70 |
+
public function setCurrency($currency){
|
71 |
+
$this->currency = $currency;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function getConvertedValue(){
|
75 |
+
return $this->convertedValue;
|
76 |
+
}
|
77 |
+
|
78 |
+
public function setConvertedValue($convertedValue){
|
79 |
+
$this->convertedValue = $convertedValue;
|
80 |
+
}
|
81 |
+
|
82 |
+
public function getConvertedCurrency(){
|
83 |
+
return $this->convertedCurrency;
|
84 |
+
}
|
85 |
+
|
86 |
+
public function setConvertedCurrency($convertedCurrency){
|
87 |
+
$this->convertedCurrency = $convertedCurrency;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/AccountantReportSettlementItem.class.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/DocumentItem.class.php");
|
4 |
+
|
5 |
+
class AccountantReportSettlementItem extends DocumentItem
|
6 |
+
{
|
7 |
+
private $operationDate;
|
8 |
+
private $saleDocumentId;
|
9 |
+
private $purchaseDocumentId;
|
10 |
+
private $value;
|
11 |
+
|
12 |
+
public function getOperationDate(){
|
13 |
+
return $this->operationDate;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function setOperationDate($operationDate){
|
17 |
+
$this->operationDate = $operationDate;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getSaleDocumentId(){
|
21 |
+
return $this->saleDocumentId;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function setSaleDocumentId($saleDocumentId){
|
25 |
+
$this->saleDocumentId = $saleDocumentId;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getPurchaseDocumentId(){
|
29 |
+
return $this->purchaseDocumentId;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function setPurchaseDocumentId($purchaseDocumentId){
|
33 |
+
$this->purchaseDocumentId = $purchaseDocumentId;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getValue(){
|
37 |
+
return $this->value;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function setValue($value){
|
41 |
+
$this->value = $value;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/DocumentItem.class.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class DocumentItem
|
4 |
+
{
|
5 |
+
private $id;
|
6 |
+
|
7 |
+
public function getId(){
|
8 |
+
return $this->id;
|
9 |
+
}
|
10 |
+
|
11 |
+
public function setId($id){
|
12 |
+
$this->id = $id;
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/reportsapiservice/ReportFilter.class.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ReportFilter
|
4 |
+
{
|
5 |
+
protected $fromDate;
|
6 |
+
protected $toDate;
|
7 |
+
|
8 |
+
public function getFromDate(){
|
9 |
+
return $this->fromDate;
|
10 |
+
}
|
11 |
+
|
12 |
+
public function setFromDate($fromDate){
|
13 |
+
$this->fromDate = $fromDate;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function getToDate(){
|
17 |
+
return $this->toDate;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function setToDate($toDate){
|
21 |
+
$this->toDate = $toDate;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/testapiservice/EchoIn.class.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class EchoIn
|
4 |
+
{
|
5 |
+
protected $message;
|
6 |
+
protected $reverse;
|
7 |
+
|
8 |
+
public function getMessage(){ return $this->message; }
|
9 |
+
public function setMessage($message){ $this->message = $message; }
|
10 |
+
|
11 |
+
public function getReverse(){ return $this->reverse; }
|
12 |
+
public function setReverse($reverse){ $this->reverse = $reverse; }
|
13 |
+
}
|
14 |
+
|
15 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/testapiservice/EchoOut.class.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class EchoOut
|
4 |
+
{
|
5 |
+
protected $echo;
|
6 |
+
|
7 |
+
public function getEcho(){ return $this->echo; }
|
8 |
+
public function setEcho($echo){ $this->echo = $echo; }
|
9 |
+
}
|
10 |
+
|
11 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/BaseTransactionData.class.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../Contractor.class.php");
|
4 |
+
|
5 |
+
abstract class BaseTransactionData
|
6 |
+
{
|
7 |
+
protected $documentNumber;
|
8 |
+
protected $issueDate;
|
9 |
+
protected $priceGross;
|
10 |
+
protected $currency = "PLN";
|
11 |
+
protected $contractor;
|
12 |
+
protected $note;
|
13 |
+
protected $noRisk = null;
|
14 |
+
|
15 |
+
public function getDocumentNumber(){ return $this->documentNumber; }
|
16 |
+
public function setDocumentNumber($documentNumber){ $this->documentNumber = $documentNumber; }
|
17 |
+
|
18 |
+
public function getIssueDate(){ return $this->issueDate; }
|
19 |
+
public function setIssueDate($issueDate){ $this->issueDate = $issueDate; }
|
20 |
+
|
21 |
+
public function getPriceGross(){ return $this->priceGross; }
|
22 |
+
public function setPriceGross($priceGross){ $this->priceGross = $priceGross; }
|
23 |
+
|
24 |
+
public function getCurrency(){ return $this->currency; }
|
25 |
+
public function setCurrency($currency){ $this->currency = $currency; }
|
26 |
+
|
27 |
+
public function getContractor(){ return $this->contractor; }
|
28 |
+
public function setContractor(Contractor $contractor){ $this->contractor = $contractor; }
|
29 |
+
|
30 |
+
public function getNote(){ return $this->note; }
|
31 |
+
public function setNote($note){ $this->note = $note; }
|
32 |
+
|
33 |
+
public function getNoRisk(){ return $this->noRisk; }
|
34 |
+
public function setNoRisk($noRisk){ $this->noRisk = $noRisk; }
|
35 |
+
}
|
36 |
+
|
37 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/InvoiceData.class.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/BaseTransactionData.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/../FileData.class.php");
|
5 |
+
|
6 |
+
class InvoiceData extends BaseTransactionData
|
7 |
+
{
|
8 |
+
protected $dueDate;
|
9 |
+
protected $document;
|
10 |
+
|
11 |
+
public function getDueDate(){ return $this->dueDate; }
|
12 |
+
public function setDueDate($dueDate){ $this->dueDate = $dueDate; }
|
13 |
+
|
14 |
+
public function getDocument(){ return $this->document; }
|
15 |
+
public function setDocument(FileData $document){ $this->document = $document; }
|
16 |
+
}
|
17 |
+
|
18 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/OrderData.class.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/BaseTransactionData.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/../FileData.class.php");
|
5 |
+
|
6 |
+
class OrderData extends BaseTransactionData
|
7 |
+
{
|
8 |
+
protected $document;
|
9 |
+
|
10 |
+
public function getDocument(){ return $this->document; }
|
11 |
+
public function setDocument(FileData $document){ $this->document = $document; }
|
12 |
+
}
|
13 |
+
|
14 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionDetails.class.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../BaseDocumentDetails.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/TransactionType.enum.php");
|
5 |
+
require_once(dirname(__FILE__) ."/TransactionItemDetails.class.php");
|
6 |
+
|
7 |
+
class TransactionDetails extends BaseDocumentDetails
|
8 |
+
{
|
9 |
+
protected $note;
|
10 |
+
protected $noRisk;
|
11 |
+
protected $type;
|
12 |
+
protected $items = array();
|
13 |
+
|
14 |
+
public function getNote($note){ return $this->note; }
|
15 |
+
public function setNote($note){ $this->note = $note; }
|
16 |
+
|
17 |
+
public function getNoRisk(){ return $this->noRisk; }
|
18 |
+
public function setNoRisk($noRisk){ $this->noRisk = $noRisk; }
|
19 |
+
|
20 |
+
public function getType(){ return $this->type; }
|
21 |
+
public function setType($type){ $this->type = $type; }
|
22 |
+
|
23 |
+
public function getItems(){ return $this->items; }
|
24 |
+
public function setItems(array $items, TransactionItemDetails $itemTypeHint = null){ $this->items = $items; }
|
25 |
+
}
|
26 |
+
|
27 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionItemDetails.class.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class TransactionItemDetails
|
4 |
+
{
|
5 |
+
protected $id;
|
6 |
+
protected $name;
|
7 |
+
protected $description;
|
8 |
+
protected $code;
|
9 |
+
protected $priceGross;
|
10 |
+
protected $priceNet;
|
11 |
+
protected $priceTax;
|
12 |
+
protected $quantity;
|
13 |
+
protected $quantityUnit;
|
14 |
+
protected $totalPriceGross;
|
15 |
+
protected $totalPriceNet;
|
16 |
+
protected $totalPriceTax;
|
17 |
+
|
18 |
+
public function getId(){ return $this->id; }
|
19 |
+
public function setId($id){ $this->id = $id; }
|
20 |
+
|
21 |
+
public function getName(){ return $this->name; }
|
22 |
+
public function setName($name){ $this->name = $name; }
|
23 |
+
|
24 |
+
public function getDescription(){ return $this->description; }
|
25 |
+
public function setDescription($description){ $this->description = $description; }
|
26 |
+
|
27 |
+
public function getCode(){ return $this->code; }
|
28 |
+
public function setCode($code){ $this->code = $code; }
|
29 |
+
|
30 |
+
public function getPriceGross(){ return $this->priceGross; }
|
31 |
+
public function setPriceGross($priceGross){ $this->priceGross; }
|
32 |
+
|
33 |
+
public function getPriceNet(){ return $this->priceNet; }
|
34 |
+
public function setPriceNet($priceNet){ $this->priceNet = $priceNet; }
|
35 |
+
|
36 |
+
public function getPriceTax(){ return $this->priceTax; }
|
37 |
+
public function setPriceTax($priceTax){ $this->priceTax; }
|
38 |
+
|
39 |
+
public function getQuantity(){ return $this->quantity; }
|
40 |
+
public function setQuantity($quantity){ $this->quantity = $quantity; }
|
41 |
+
|
42 |
+
public function getQuantityUnit(){ return $this->quantityUnit; }
|
43 |
+
public function setQuantityUnit($quantityUnit){ $this->quantityUnit = $quantityUnit; }
|
44 |
+
|
45 |
+
public function getTotalPriceGross(){ return $this->totalPriceGross; }
|
46 |
+
public function setTotalPriceGross($totalPriceGross){ $this->totalPriceGross = $totalPriceGross; }
|
47 |
+
|
48 |
+
public function getTotalPriceTax(){ return $this->totalPriceTax; }
|
49 |
+
public function setTotalPriceTax($totalPriceTax){ $this->totalPriceTax = $totalPriceTax; }
|
50 |
+
}
|
51 |
+
|
52 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionSide.enum.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class TransactionSide
|
4 |
+
{
|
5 |
+
const PURCHASE = "PURCHASE";
|
6 |
+
const SALE = "SALE";
|
7 |
+
}
|
8 |
+
|
9 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionType.enum.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class TransactionType
|
4 |
+
{
|
5 |
+
const INVOICE = "INVOICE";
|
6 |
+
const ORDER = "ORDER";
|
7 |
+
}
|
8 |
+
|
9 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/dto/transactionapiservice/TransactionsFilter.class.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/TransactionType.enum.php");
|
4 |
+
require_once(dirname(__FILE__) ."/TransactionSide.enum.php");
|
5 |
+
|
6 |
+
class TransactionsFilter
|
7 |
+
{
|
8 |
+
protected $type = TransactionType::INVOICE;
|
9 |
+
protected $side = TransactionSide::PURCHASE;
|
10 |
+
protected $noRiskState = null;
|
11 |
+
protected $contractorTaxPayerNumber = null;
|
12 |
+
protected $contractorCompanyGovId = null;
|
13 |
+
|
14 |
+
public function getType() { return $this->type; }
|
15 |
+
public function setType(TransactionType $type){ $this->type = $type; }
|
16 |
+
|
17 |
+
public function getSide() { return $this->side; }
|
18 |
+
public function setSide($side){ $this->side = $side; }
|
19 |
+
|
20 |
+
public function getNoRiskState(){ return $this->noRiskState; }
|
21 |
+
public function setNoRiskState($noRiskState){ $this->noRiskState = $noRiskState; }
|
22 |
+
|
23 |
+
public function getContractorTaxPayerNumber(){ return $this->contractorTaxPayerNumber; }
|
24 |
+
public function setContractorTaxPayerNumber($contractorTaxPayerNumber){ $this->contractorTaxPayerNumber = $contractorTaxPayerNumber; }
|
25 |
+
|
26 |
+
public function getContractorCompanyGovId(){ return $this->contractorCompanyGovId; }
|
27 |
+
public function setContractorCompanyGovId($contractorCompanyGovId){ $this->contractorCompanyGovId = $contractorCompanyGovId; }
|
28 |
+
}
|
29 |
+
|
30 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/exceptions/AccessFromIpDeniedException.class.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../exceptions/ApiOperationException.class.php");
|
4 |
+
|
5 |
+
class AccessFromIpDeniedException extends ApiOperationException
|
6 |
+
{
|
7 |
+
public function __construct($message = null, $data = array())
|
8 |
+
{
|
9 |
+
parent::__construct('AccessFromIpDeniedException', $message, $data);
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/exceptions/ApiOperationException.class.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ApiOperationException extends Exception
|
4 |
+
{
|
5 |
+
protected $type;
|
6 |
+
protected $data;
|
7 |
+
|
8 |
+
public function __construct($type = null, $message = null, $data = null)
|
9 |
+
{
|
10 |
+
$this->setType($type);
|
11 |
+
$this->setData($data);
|
12 |
+
parent::__construct($message);
|
13 |
+
}
|
14 |
+
|
15 |
+
public function getType(){ return $this->type; }
|
16 |
+
public function setType($type){ $this->type = $type; }
|
17 |
+
|
18 |
+
public function getData(){ return $this->data; }
|
19 |
+
public function setData($data){ $this->data = $data; }
|
20 |
+
}
|
21 |
+
|
22 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/exceptions/AuthenticationException.class.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../exceptions/ApiOperationException.class.php");
|
4 |
+
|
5 |
+
class AuthenticationException extends ApiOperationException
|
6 |
+
{
|
7 |
+
public function __construct($message = null, $data = array())
|
8 |
+
{
|
9 |
+
parent::__construct('AuthenticationException', $message, $data);
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/exceptions/ObjectNotFoundException.class.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../exceptions/ApiOperationException.class.php");
|
4 |
+
|
5 |
+
class ObjectNotFoundException extends ApiOperationException
|
6 |
+
{
|
7 |
+
public function __construct($message = null, $data = array())
|
8 |
+
{
|
9 |
+
parent::__construct('ObjectNotFoundException', $message, $data);
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/exceptions/SignatureException.class.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../exceptions/ApiOperationException.class.php");
|
4 |
+
|
5 |
+
class SignatureException extends ApiOperationException
|
6 |
+
{
|
7 |
+
public function __construct($message = null, $data = array())
|
8 |
+
{
|
9 |
+
parent::__construct('SignatureException', $message, $data);
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/exceptions/TransactionContractorException.class.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../exceptions/ApiOperationException.class.php");
|
4 |
+
|
5 |
+
class TransactionContractorException extends ApiOperationException
|
6 |
+
{
|
7 |
+
public function __construct($message = null, $data = array())
|
8 |
+
{
|
9 |
+
parent::__construct('TransactionContractorException', $message, $data);
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/exceptions/ValidationException.class.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../exceptions/ApiOperationException.class.php");
|
4 |
+
|
5 |
+
class ValidationException extends ApiOperationException
|
6 |
+
{
|
7 |
+
public function __construct($message = null, $data = array())
|
8 |
+
{
|
9 |
+
parent::__construct('ValidationException', $message, $data);
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
app/code/community/Invipay/Common/Apiclient/lib/AbstractRestApiClient.class.php
ADDED
@@ -0,0 +1,299 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../exceptions/ApiOperationException.class.php");
|
4 |
+
require_once(dirname(__FILE__) ."/../exceptions/AccessFromIpDeniedException.class.php");
|
5 |
+
require_once(dirname(__FILE__) ."/../exceptions/AuthenticationException.class.php");
|
6 |
+
require_once(dirname(__FILE__) ."/../exceptions/SignatureException.class.php");
|
7 |
+
require_once(dirname(__FILE__) ."/../exceptions/ValidationException.class.php");
|
8 |
+
require_once(dirname(__FILE__) ."/../exceptions/TransactionContractorException.class.php");
|
9 |
+
require_once(dirname(__FILE__) ."/../exceptions/ObjectNotFoundException.class.php");
|
10 |
+
|
11 |
+
abstract class AbstractRestApiClient
|
12 |
+
{
|
13 |
+
const HEADER_APIKEY_KEY = "X-InviPay-ApiKey";
|
14 |
+
const HEADER_SIGNATURE_KEY = "X-InviPay-Signature";
|
15 |
+
const SIGNING_ALGORHITM_NAME = "sha256";
|
16 |
+
|
17 |
+
protected $baseUrl;
|
18 |
+
protected $apiKey;
|
19 |
+
protected $signatureKey;
|
20 |
+
|
21 |
+
private $knownExceptions = array('AccessFromIpDeniedException', 'AuthenticationException', 'SignatureException', 'ValidationException', 'TransactionContractorException', 'ObjectNotFoundException');
|
22 |
+
|
23 |
+
abstract protected function getServiceAddress();
|
24 |
+
|
25 |
+
public function __construct($baseUrl, $apiKey, $signatureKey)
|
26 |
+
{
|
27 |
+
$this->baseUrl = $baseUrl;
|
28 |
+
$this->apiKey = $apiKey;
|
29 |
+
$this->signatureKey = $signatureKey;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function __call_ws_action($actionPath, $arguments, $httpMethod, $outputType, $outputIsArray = false)
|
33 |
+
{
|
34 |
+
$ch = curl_init();
|
35 |
+
|
36 |
+
$methodAddress = $this->baseUrl.$this->getServiceAddress().$actionPath;
|
37 |
+
|
38 |
+
$headers = array(
|
39 |
+
"Content-type: application/json;charset=\"utf-8\"",
|
40 |
+
"Accept: application/json,application/octet-stream",
|
41 |
+
"Cache-Control: no-cache",
|
42 |
+
"Pragma: no-cache",
|
43 |
+
AbstractRestApiClient::HEADER_APIKEY_KEY . ": " . $this->apiKey,
|
44 |
+
);
|
45 |
+
|
46 |
+
$queryString = '';
|
47 |
+
|
48 |
+
if ($httpMethod == 'GET')
|
49 |
+
{
|
50 |
+
curl_setopt($ch, CURLOPT_HTTPGET, true);
|
51 |
+
$this->__appendToQueryString($queryString, $arguments !== null ? http_build_query($arguments) : null);
|
52 |
+
}
|
53 |
+
else if ($httpMethod == 'POST')
|
54 |
+
{
|
55 |
+
curl_setopt($ch, CURLOPT_POST, true);
|
56 |
+
|
57 |
+
if ($arguments != null)
|
58 |
+
{
|
59 |
+
$postBody = json_encode($this->__toArray($arguments), JSON_UNESCAPED_UNICODE);
|
60 |
+
$bodyHash = $this->__calculateBodyHash($postBody);
|
61 |
+
array_push($headers, AbstractRestApiClient::HEADER_SIGNATURE_KEY . ": " . $bodyHash);
|
62 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $postBody);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
else
|
66 |
+
{
|
67 |
+
return null;
|
68 |
+
}
|
69 |
+
|
70 |
+
$methodAddress .= $queryString;
|
71 |
+
|
72 |
+
curl_setopt($ch, CURLOPT_URL, $methodAddress);
|
73 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
74 |
+
curl_setopt($ch, CURLOPT_HEADER, true);
|
75 |
+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
76 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
77 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
78 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
79 |
+
|
80 |
+
$response = curl_exec($ch);
|
81 |
+
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
82 |
+
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
|
83 |
+
curl_close($ch);
|
84 |
+
|
85 |
+
$header = trim(substr($response, 0, $header_size));
|
86 |
+
$body = trim(substr($response, $header_size));
|
87 |
+
|
88 |
+
//$this->__checkResponseHash($header, $body);
|
89 |
+
|
90 |
+
$output = $this->__createResponseObject($status, $body, $outputType, $outputIsArray);
|
91 |
+
|
92 |
+
if (is_subclass_of($output, 'ApiOperationException') == false) {
|
93 |
+
$this->__checkResponseHash($header, $body);
|
94 |
+
}
|
95 |
+
|
96 |
+
return $output;
|
97 |
+
}
|
98 |
+
|
99 |
+
protected function __checkResponseHash($header, $body)
|
100 |
+
{
|
101 |
+
if ($body === null){ return; }
|
102 |
+
|
103 |
+
$signature = null;
|
104 |
+
$calculatedSignature = null;
|
105 |
+
|
106 |
+
if ($header !== null)
|
107 |
+
{
|
108 |
+
foreach (explode("\n", $header) as $line)
|
109 |
+
{
|
110 |
+
$line = trim($line);
|
111 |
+
$lineArray = explode(':', $line);
|
112 |
+
if (count($lineArray) == 2)
|
113 |
+
{
|
114 |
+
$key = trim($lineArray[0]);
|
115 |
+
$value = trim($lineArray[1]);
|
116 |
+
|
117 |
+
if ($key === AbstractRestApiClient::HEADER_SIGNATURE_KEY)
|
118 |
+
{
|
119 |
+
$signature = $value;
|
120 |
+
break;
|
121 |
+
}
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
if ($signature !== null)
|
127 |
+
{
|
128 |
+
$calculatedSignature = $this->__calculateBodyHash($body);
|
129 |
+
if ($signature == $calculatedSignature)
|
130 |
+
{
|
131 |
+
return;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
throw new SignatureException("Wrong response signature! Response data was either manipulated between server and client or server you've contacted isn't InviPay server!", array('received_signature' => $signature, 'proper_signature' => $calculatedSignature, 'message_body' => $body));
|
136 |
+
}
|
137 |
+
|
138 |
+
protected function __calculateBodyHash($body)
|
139 |
+
{
|
140 |
+
$output = hash(AbstractRestApiClient::SIGNING_ALGORHITM_NAME, $body.$this->signatureKey);
|
141 |
+
return $output;
|
142 |
+
}
|
143 |
+
|
144 |
+
protected function __appendToQueryString(&$queryString, $newData)
|
145 |
+
{
|
146 |
+
if ($newData !== null)
|
147 |
+
{
|
148 |
+
if ($queryString === null || $queryString == ''){ $queryString = '?'; }
|
149 |
+
$queryString .= $queryString == '?' ? $newData : '&'.$newData;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
protected function __createResponseObject($status, $response, $outputType, $outputIsArray)
|
154 |
+
{
|
155 |
+
if ($status == '200')
|
156 |
+
{
|
157 |
+
$data = json_decode($response, true);
|
158 |
+
return $data === null ? $response : $this->__mapArrayToObject($data, $outputType, $outputIsArray);
|
159 |
+
}
|
160 |
+
else if ($status == '204'){ return null; }
|
161 |
+
else
|
162 |
+
{
|
163 |
+
$data = json_decode($response, true);
|
164 |
+
if ($data !== null && is_array($data) && array_key_exists('error', $data) && $data['error'] == true)
|
165 |
+
{
|
166 |
+
$errorType = $data['type'];
|
167 |
+
$errorMessage = array_key_exists('message', $data) ? $data['message'] : null;
|
168 |
+
$errorData = array_key_exists('data', $data) ? $data['data'] : null;
|
169 |
+
|
170 |
+
if (in_array($errorType, $this->knownExceptions))
|
171 |
+
{
|
172 |
+
throw new $errorType($errorMessage, $errorData);
|
173 |
+
}
|
174 |
+
else
|
175 |
+
{
|
176 |
+
throw new ApiOperationException($errorType, $errorMessage, $errorData);
|
177 |
+
|
178 |
+
}
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
throw new ApiOperationException(null, "Unknown API error, HTTP status: " . $status, $response);
|
183 |
+
}
|
184 |
+
|
185 |
+
protected function __mapArrayToObject($response, $outputType, $outputIsArray)
|
186 |
+
{
|
187 |
+
if ($outputType === null){ return $response; }
|
188 |
+
else if (is_callable($outputType)){ return $outputType($response); }
|
189 |
+
else if (is_string($outputType) && is_array($response))
|
190 |
+
{
|
191 |
+
//var_dump($response);
|
192 |
+
|
193 |
+
if (!$outputIsArray){ $response = array($response); }
|
194 |
+
|
195 |
+
$rclass = new ReflectionClass($outputType);
|
196 |
+
$output = array();
|
197 |
+
|
198 |
+
foreach ($response as $item)
|
199 |
+
{
|
200 |
+
$mapped = new $outputType();
|
201 |
+
|
202 |
+
foreach ($item as $property => $value)
|
203 |
+
{
|
204 |
+
try
|
205 |
+
{
|
206 |
+
$rmethodName = 'set'.ucfirst($property);
|
207 |
+
$rmethod = $rclass->getMethod($rmethodName);
|
208 |
+
|
209 |
+
if ($rmethod !== null && $rmethod->isPublic())
|
210 |
+
{
|
211 |
+
$rparams = $rmethod->getParameters();
|
212 |
+
$rparamsCount = count($rparams);
|
213 |
+
if ($rparams !== null && $rparamsCount > 0)
|
214 |
+
{
|
215 |
+
$rparamValue = $value;
|
216 |
+
|
217 |
+
if ($rparams[0] != null)
|
218 |
+
{
|
219 |
+
if ($rparams[0]->isArray())
|
220 |
+
{
|
221 |
+
if ($rparamsCount > 1)
|
222 |
+
{
|
223 |
+
$rparamValue = $this->__mapArrayToObject($rparamValue, $rparams[1]->getClass()->name, true);
|
224 |
+
}
|
225 |
+
else
|
226 |
+
{
|
227 |
+
continue;
|
228 |
+
}
|
229 |
+
}
|
230 |
+
else if ($rparams[0]->getClass() !== null)
|
231 |
+
{
|
232 |
+
$rparamValue = $this->__mapArrayToObject($rparamValue, $rparams[0]->getClass()->name, false);
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
$mapped->$rmethodName($rparamValue);
|
237 |
+
}
|
238 |
+
}
|
239 |
+
}
|
240 |
+
catch (Exception $ex)
|
241 |
+
{
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
$output[] = $mapped;
|
246 |
+
}
|
247 |
+
|
248 |
+
return $outputIsArray ? $output : $output[0];
|
249 |
+
}
|
250 |
+
|
251 |
+
return $response;
|
252 |
+
}
|
253 |
+
|
254 |
+
protected function __xmlToArray($xmlString)
|
255 |
+
{
|
256 |
+
$xml = simplexml_load_string($xmlString, "SimpleXMLElement", LIBXML_NOCDATA);
|
257 |
+
$json = json_encode($xml);
|
258 |
+
$array = json_decode($json, true);
|
259 |
+
|
260 |
+
return $array;
|
261 |
+
}
|
262 |
+
|
263 |
+
protected function __toArray($object)
|
264 |
+
{
|
265 |
+
$output = array();
|
266 |
+
|
267 |
+
$rclass = new ReflectionClass($object);
|
268 |
+
|
269 |
+
foreach ($rclass->getMethods(ReflectionMethod::IS_PUBLIC) as $rmethod)
|
270 |
+
{
|
271 |
+
if ($rmethod !== null)
|
272 |
+
{
|
273 |
+
$propertyName = $rmethod->name;
|
274 |
+
if (strrpos($propertyName, 'get', -strlen($propertyName)) !== FALSE)
|
275 |
+
{
|
276 |
+
$propertyNameKey = substr($propertyName, 3);
|
277 |
+
$propertyNameKey = $this->__countLowerCaseChars($propertyNameKey) == 0 ? $propertyNameKey : lcfirst($propertyNameKey);
|
278 |
+
$propertyValue = $object->$propertyName();
|
279 |
+
|
280 |
+
if (is_object($propertyValue))
|
281 |
+
{
|
282 |
+
$propertyValue = $this->__toArray($propertyValue);
|
283 |
+
}
|
284 |
+
|
285 |
+
$output[$propertyNameKey] = $propertyValue;
|
286 |
+
}
|
287 |
+
}
|
288 |
+
}
|
289 |
+
|
290 |
+
return $output;
|
291 |
+
}
|
292 |
+
|
293 |
+
protected function __countLowerCaseChars($input)
|
294 |
+
{
|
295 |
+
$match = array();
|
296 |
+
preg_match_all('/[a-z]/', $input, $match);
|
297 |
+
return count($match[0]);
|
298 |
+
}
|
299 |
+
}
|
app/code/community/Invipay/Ipcpaygate/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/Block/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/Block/Form/Checkout.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Block_Form_CheckoutLabel extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->setTemplate('ipcpaygate/form/checkout_label.phtml');
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getLabelTitle()
|
11 |
+
{
|
12 |
+
return Mage::getStoreConfig('payment/ipcpaygate/title');
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
class Invipay_Ipcpaygate_Block_Form_Checkout extends Mage_Payment_Block_Form
|
17 |
+
{
|
18 |
+
|
19 |
+
protected function _construct()
|
20 |
+
{
|
21 |
+
$label = new Invipay_Ipcpaygate_Block_Form_CheckoutLabel();
|
22 |
+
$this->setTemplate('ipcpaygate/form/checkout.phtml');
|
23 |
+
$this->setMethodTitle('');
|
24 |
+
$this->setMethodLabelAfterHtml($label->toHtml());
|
25 |
+
}
|
26 |
+
}
|
app/code/community/Invipay/Ipcpaygate/Block/Info/Checkout.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Block_Info_Checkout extends Mage_Payment_Block_Info
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->setTemplate('ipcpaygate/form/checkout_info.phtml');
|
9 |
+
}
|
10 |
+
|
11 |
+
public function getLabelTitle()
|
12 |
+
{
|
13 |
+
return Mage::getStoreConfig('payment/ipcpaygate/title');
|
14 |
+
}
|
15 |
+
}
|
app/code/community/Invipay/Ipcpaygate/Block/Redirect.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Block_Redirect extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
protected $redirectUrl;
|
6 |
+
|
7 |
+
public function _construct()
|
8 |
+
{
|
9 |
+
parent::_construct();
|
10 |
+
$this->setTemplate('ipcpaygate/redirect.phtml');
|
11 |
+
}
|
12 |
+
|
13 |
+
public function setRedirectUrl($url)
|
14 |
+
{
|
15 |
+
$this->redirectUrl = $url;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function getRedirectUrl()
|
19 |
+
{
|
20 |
+
return $this->redirectUrl;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Block/Wait.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Block_Wait extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
protected $orderId;
|
6 |
+
|
7 |
+
public function _construct()
|
8 |
+
{
|
9 |
+
parent::_construct();
|
10 |
+
$this->setTemplate('ipcpaygate/wait.phtml');
|
11 |
+
}
|
12 |
+
|
13 |
+
public function setOrderId($oid)
|
14 |
+
{
|
15 |
+
$this->orderId = $oid;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function getOrderId()
|
19 |
+
{
|
20 |
+
return $this->orderId;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Block/Widgets/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/Block/Widgets/Basketinfo.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Block_Widgets_Basketinfo extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
protected $enabled = true;
|
6 |
+
protected $dueDateDays = 14;
|
7 |
+
|
8 |
+
public function _construct()
|
9 |
+
{
|
10 |
+
parent::_construct();
|
11 |
+
$this->enabled = intval(Mage::getStoreConfig('payment/ipcpaygate/invipay_widgets_basketinfo')) && Mage::getStoreConfig('payment/ipcpaygate/active');
|
12 |
+
$this->dueDateDays = Mage::getStoreConfig('payment/ipcpaygate/invipay_base_duedate');
|
13 |
+
$this->setTemplate('ipcpaygate/widgets/basketinfo.phtml');
|
14 |
+
}
|
15 |
+
|
16 |
+
public function getEnabled()
|
17 |
+
{
|
18 |
+
return $this->enabled;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getDueDateDays()
|
22 |
+
{
|
23 |
+
return $this->dueDateDays;
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Block/Widgets/Floatingpanel.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Block_Widgets_Floatingpanel extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
protected $enabled = true;
|
6 |
+
protected $style = 'right';
|
7 |
+
protected $dueDateDays = 14;
|
8 |
+
protected $minOrderTotal = 200;
|
9 |
+
|
10 |
+
public function _construct()
|
11 |
+
{
|
12 |
+
parent::_construct();
|
13 |
+
$this->style = Mage::getStoreConfig('payment/ipcpaygate/invipay_widgets_floatingpanel');
|
14 |
+
$this->enabled = $this->style !== 'none' && Mage::getStoreConfig('payment/ipcpaygate/active');
|
15 |
+
$this->dueDateDays = intval(Mage::getStoreConfig('payment/ipcpaygate/invipay_base_duedate'));
|
16 |
+
$this->minOrderTotal = Mage::getStoreConfig('payment/ipcpaygate/min_order_total');
|
17 |
+
$this->setTemplate('ipcpaygate/widgets/floatingpanel.phtml');
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getEnabled()
|
21 |
+
{
|
22 |
+
return $this->enabled;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getStyle()
|
26 |
+
{
|
27 |
+
return $this->style;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getDueDateDays()
|
31 |
+
{
|
32 |
+
return $this->dueDateDays;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getMinOrderTotal()
|
36 |
+
{
|
37 |
+
return $this->minOrderTotal;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Block/Widgets/Footericon.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Block_Widgets_Footericon extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
protected $enabled = true;
|
6 |
+
protected $text = 'Wybierz zakup na fakturę z inviPay.com';
|
7 |
+
|
8 |
+
public function _construct()
|
9 |
+
{
|
10 |
+
parent::_construct();
|
11 |
+
$this->enabled = intval(Mage::getStoreConfig('payment/ipcpaygate/invipay_widgets_footericon')) && intval(Mage::getStoreConfig('payment/ipcpaygate/active'));
|
12 |
+
$this->text = Mage::getStoreConfig('payment/ipcpaygate/title');
|
13 |
+
$this->setTemplate('ipcpaygate/widgets/footericon.phtml');
|
14 |
+
}
|
15 |
+
|
16 |
+
public function getEnabled()
|
17 |
+
{
|
18 |
+
return $this->enabled;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getText()
|
22 |
+
{
|
23 |
+
return $this->text;
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Helper/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/Helper/Data.php
ADDED
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(__FILE__) ."/../../Common/Apiclient/PaygateApiClient.class.php");
|
4 |
+
|
5 |
+
class Invipay_Ipcpaygate_Helper_Data extends Mage_Core_Helper_Abstract
|
6 |
+
{
|
7 |
+
const API_GATEWAY_URL = 'https://api.invipay.com/api/rest';
|
8 |
+
const API_GATEWAY_URL_DEMO = 'http://demo.invipay.com/services/api/rest';
|
9 |
+
|
10 |
+
public function getLastSessionOrder()
|
11 |
+
{
|
12 |
+
$order = new Mage_Sales_Model_Order();
|
13 |
+
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
14 |
+
return $order->load($orderId);
|
15 |
+
}
|
16 |
+
|
17 |
+
public function changeOrderStateById($orderId, $state, $comment = '')
|
18 |
+
{
|
19 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
20 |
+
$this->changeOrderState($order, $state, $comment);
|
21 |
+
}
|
22 |
+
|
23 |
+
public function changeOrderStateByInvipayPaymentId($paymentId, $state, $comment = '', $inviPayStatus = PaymentRequestStatus::STARTED)
|
24 |
+
{
|
25 |
+
$order = $this->getOrderByInvipayPaymentId($paymentId);
|
26 |
+
$order->setInvipayStatus($inviPayStatus);
|
27 |
+
$order->setInvipayDeliveryConfirmed(false);
|
28 |
+
$order->setInvipayCompleted(false);
|
29 |
+
$this->changeOrderState($order, $state, $comment);
|
30 |
+
}
|
31 |
+
|
32 |
+
public function changeOrderState($order, $state, $comment = '')
|
33 |
+
{
|
34 |
+
$order->setState($state, true, $comment);
|
35 |
+
$order->save();
|
36 |
+
}
|
37 |
+
|
38 |
+
public function isDemoMode()
|
39 |
+
{
|
40 |
+
return intval(Mage::getStoreConfig('payment/ipcpaygate/invipay_demo_mode')) ? true : false;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getApiClient()
|
44 |
+
{
|
45 |
+
$url = $this->isDemoMode() ? self::API_GATEWAY_URL_DEMO : self::API_GATEWAY_URL;
|
46 |
+
$apiKey = Mage::getStoreConfig('payment/ipcpaygate/api_key');
|
47 |
+
$signatureKey = Mage::getStoreConfig('payment/ipcpaygate/signature_key');
|
48 |
+
|
49 |
+
$client = new PaygateApiClient($url, trim($apiKey), trim($signatureKey));
|
50 |
+
return $client;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function getOrderBySecureId($secureId)
|
54 |
+
{
|
55 |
+
return Mage::getModel('sales/order')
|
56 |
+
->getCollection()
|
57 |
+
->addFieldToFilter('protect_code', $secureId)
|
58 |
+
->getFirstItem();
|
59 |
+
}
|
60 |
+
|
61 |
+
public function getOrderByInvipayPaymentId($paymentId)
|
62 |
+
{
|
63 |
+
return Mage::getModel('sales/order')
|
64 |
+
->getCollection()
|
65 |
+
->addFieldToFilter('invipay_payment_id', $paymentId)
|
66 |
+
->getFirstItem();
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getNipFromQuote($quote)
|
70 |
+
{
|
71 |
+
$addressNip = null;
|
72 |
+
$quoteNip = $quote->getData()['customer_taxvat'];
|
73 |
+
$billingAddress = $quote->getBillingAddress();
|
74 |
+
|
75 |
+
if ($billingAddress !== null) {
|
76 |
+
$addressNip = $billingAddress->getData()['vat_id'];
|
77 |
+
}
|
78 |
+
|
79 |
+
$output = !empty($addressNip) ? $addressNip : $quoteNip;
|
80 |
+
return preg_replace('/[^0-9]*/', '', $output);
|
81 |
+
}
|
82 |
+
|
83 |
+
public function getNipFromOrder($order)
|
84 |
+
{
|
85 |
+
$addressNip = null;
|
86 |
+
$orderNip = $order->getData()['customer_taxvat'];
|
87 |
+
$billingAddress = $order->getBillingAddress();
|
88 |
+
|
89 |
+
if ($billingAddress !== null) {
|
90 |
+
$addressNip = trim($billingAddress->getData()['vat_id']);
|
91 |
+
}
|
92 |
+
|
93 |
+
$output = !empty($addressNip) ? $addressNip : $orderNip;;
|
94 |
+
|
95 |
+
$output = preg_replace('/[^0-9]*/', '', $output);
|
96 |
+
return $output;
|
97 |
+
}
|
98 |
+
|
99 |
+
public function getOrderPaymentStatusById($orderId)
|
100 |
+
{
|
101 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
102 |
+
return $order !== null ? $order->getData()['invipay_status'] : null;
|
103 |
+
}
|
104 |
+
|
105 |
+
public function confirmDeliveryAndSendInvoice($order)
|
106 |
+
{
|
107 |
+
$invoices = array();
|
108 |
+
$invoiceNumbers = array();
|
109 |
+
|
110 |
+
if ($order->hasInvoices())
|
111 |
+
{
|
112 |
+
foreach ($order->getInvoiceCollection() as $invoiceItem)
|
113 |
+
{
|
114 |
+
$invoices[] = $invoiceItem;
|
115 |
+
$invoiceNumbers[] = $invoiceItem->getIncrementId();
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
$pdf = Mage::getModel('sales/order_pdf_invoice')->getPdf($invoices);
|
120 |
+
$pdfData = $pdf->render();
|
121 |
+
|
122 |
+
$documentNumber = join(', ', $invoiceNumbers);
|
123 |
+
$issueDate = strtotime($order->getCreatedAt()) * 1000;
|
124 |
+
$dueDateDays = intval(Mage::getStoreConfig('payment/ipcpaygate/invipay_base_duedate'));
|
125 |
+
$dueDate = $issueDate + ($dueDateDays * 60 * 60 * 24 * 1000);
|
126 |
+
|
127 |
+
$client = $this->getApiClient();
|
128 |
+
|
129 |
+
$request = new PaymentManagementData();
|
130 |
+
$request->setPaymentId($order->getInvipayPaymentId());
|
131 |
+
$request->setDoConfirmDelivery(true);
|
132 |
+
|
133 |
+
{
|
134 |
+
$conversionData = new OrderToInvoiceData();
|
135 |
+
$conversionData->setInvoiceDocumentNumber($documentNumber);
|
136 |
+
$conversionData->setIssueDate($issueDate);
|
137 |
+
$conversionData->setDueDate($dueDate);
|
138 |
+
|
139 |
+
$request->setConversionData($conversionData);
|
140 |
+
}
|
141 |
+
|
142 |
+
{
|
143 |
+
$document = new FileData();
|
144 |
+
$document->setName('Zamowienie_nr_' . $order->getEntityId() . '.pdf');
|
145 |
+
$document->setMimeType('application/pdf');
|
146 |
+
$document->setContentFromBin($pdfData);
|
147 |
+
$request->setDocument($document);
|
148 |
+
}
|
149 |
+
|
150 |
+
$result = $client->managePayment($request);
|
151 |
+
$order->setInvipayDeliveryConfirmed(true);
|
152 |
+
$order->setInvipayCompleted(true);
|
153 |
+
$order->save();
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Model/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/Model/Orderstatusobserver.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Model_Orderstatusobserver
|
4 |
+
{
|
5 |
+
public function orderSaved(Varien_Event_Observer $observer)
|
6 |
+
{
|
7 |
+
$order = $observer->getEvent()->getOrder();
|
8 |
+
$data = $order->getData();
|
9 |
+
|
10 |
+
$id = $data['entity_id'];
|
11 |
+
$state = $data['state'];
|
12 |
+
$status = $data['status'];
|
13 |
+
$invipayStatus = $data['invipay_status'];
|
14 |
+
$invipayPaymentId = $data['invipay_payment_id'];
|
15 |
+
$invipayCompleted = $data['invipay_completed'];
|
16 |
+
|
17 |
+
if ($state == 'complete' && $status == 'complete' && $invipayStatus == 'COMPLETED' && $invipayCompleted == false)
|
18 |
+
{
|
19 |
+
Mage::helper('ipcpaygate')->confirmDeliveryAndSendInvoice($order);
|
20 |
+
}
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Model/Paymentmethod.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Model_Paymentmethod extends Mage_Payment_Model_Method_Abstract
|
4 |
+
{
|
5 |
+
protected $_code = 'ipcpaygate';
|
6 |
+
protected $_formBlockType = 'ipcpaygate/form_checkout';
|
7 |
+
protected $_infoBlockType = 'ipcpaygate/info_checkout';
|
8 |
+
|
9 |
+
public function canUseCheckout()
|
10 |
+
{
|
11 |
+
return true;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function validate()
|
15 |
+
{
|
16 |
+
parent::validate();
|
17 |
+
|
18 |
+
$info = $this->getInfoInstance();
|
19 |
+
|
20 |
+
if ($info !== null)
|
21 |
+
{
|
22 |
+
$quote = $info->getQuote();
|
23 |
+
|
24 |
+
if ($quote !== null)
|
25 |
+
{
|
26 |
+
$taxvat = Mage::helper('ipcpaygate')->getNipFromQuote($quote);
|
27 |
+
|
28 |
+
if ($taxvat === null || trim($taxvat) == '')
|
29 |
+
{
|
30 |
+
Mage::throwException('Brak numeru NIP, dla tego zamówienia, wybrana metoda płatności dostępna jest tylko dla firm.');
|
31 |
+
}
|
32 |
+
|
33 |
+
if (!$this->validateNip($taxvat))
|
34 |
+
{
|
35 |
+
Mage::throwException('Podany, dla tego zamówienia, numer NIP (' . $taxvat . ') jest błędny, wybrana metoda płatności wymaga poprawnego numeru NIP klienta.');
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
public function getOrderPlaceRedirectUrl()
|
45 |
+
{
|
46 |
+
return Mage::getUrl('ipcpaygate/payment/redirect', array());
|
47 |
+
}
|
48 |
+
|
49 |
+
protected function validateNip($nip)
|
50 |
+
{
|
51 |
+
$nip = preg_replace('/[^0-9]*/', '', $nip);
|
52 |
+
$nsize = strlen($nip);
|
53 |
+
if ($nsize != 10) {
|
54 |
+
return false;
|
55 |
+
}
|
56 |
+
|
57 |
+
$weights = array(6, 5, 7, 2, 3, 4, 5, 6, 7);
|
58 |
+
$j = 0;
|
59 |
+
$sum = 0;
|
60 |
+
$control = 0;
|
61 |
+
|
62 |
+
$csum = intval(substr($nip, $nsize - 1));
|
63 |
+
|
64 |
+
for ($i = 0; $i < $nsize - 1; $i++) {
|
65 |
+
$c = $nip[$i];
|
66 |
+
$j = intval($c);
|
67 |
+
$sum += $j * $weights[$i];
|
68 |
+
}
|
69 |
+
|
70 |
+
$control = $sum % 11;
|
71 |
+
return ($control == $csum);
|
72 |
+
}
|
73 |
+
}
|
app/code/community/Invipay/Ipcpaygate/Model/Resource/Setup.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup {
|
4 |
+
}
|
5 |
+
|
6 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Model/System/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/Model/System/Config/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/Model/System/Config/Source/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/Model/System/Config/Source/Checkouttext.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Model_System_Config_Source_Checkouttext
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
return array(
|
8 |
+
array('value' => 'standard', 'label' => 'Standardowy'),
|
9 |
+
array('value' => 'short', 'label' => 'Krótki'),
|
10 |
+
array('value' => 'medium', 'label' => 'Średni'),
|
11 |
+
array('value' => 'long', 'label' => 'Długi'),
|
12 |
+
);
|
13 |
+
}
|
14 |
+
|
15 |
+
public function toArray()
|
16 |
+
{
|
17 |
+
return array(
|
18 |
+
'standard' => 'Standardowy',
|
19 |
+
'short' => 'Krótki',
|
20 |
+
'medium' => 'Średni',
|
21 |
+
'long' => 'Długi',
|
22 |
+
);
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Model/System/Config/Source/Floatingpanel.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Model_System_Config_Source_Checkouttext
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
return array(
|
8 |
+
array('value' => 'none', 'label' => 'Wyłączony'),
|
9 |
+
array('value' => 'right', 'label' => 'Z prawej strony'),
|
10 |
+
array('value' => 'left', 'label' => 'Z lewej strony'),
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
+
public function toArray()
|
15 |
+
{
|
16 |
+
return array(
|
17 |
+
'none' => 'Wyłączony',
|
18 |
+
'right' => 'Z prawej strony',
|
19 |
+
'left' => 'Z lewej strony',
|
20 |
+
);
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/Model/System/Config/Source/Widgets/Floatingpanel.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_Model_System_Config_Source_Widgets_Floatingpanel
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
return array(
|
8 |
+
array('value' => 'none', 'label' => 'Wyłączony'),
|
9 |
+
array('value' => 'right', 'label' => 'Z prawej strony'),
|
10 |
+
array('value' => 'left', 'label' => 'Z lewej strony'),
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
+
public function toArray()
|
15 |
+
{
|
16 |
+
return array(
|
17 |
+
'none' => 'Wyłączony',
|
18 |
+
'right' => 'Z prawej strony',
|
19 |
+
'left' => 'Z lewej strony',
|
20 |
+
);
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
?>
|
app/code/community/Invipay/Ipcpaygate/controllers/PaymentController.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Invipay_Ipcpaygate_PaymentController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
const ORDER_STATUS_PAYMENT_COMPLETED = 'new';
|
6 |
+
const ORDER_STATUS_PAYMENT_OUT_OF_LIMIT = 'pending_payment';
|
7 |
+
const ORDER_STATUS_PAYMENT_TIMEOUT = 'pending_payment';
|
8 |
+
const ORDER_STATUS_PAYMENT_OTHER = 'pending_payment';
|
9 |
+
|
10 |
+
public function statusAction()
|
11 |
+
{
|
12 |
+
$client = Mage::helper('ipcpaygate')->getApiClient();
|
13 |
+
$paymentData = $client->paymentStatusFromCallbackPost(CallbackDataFormat::JSON);
|
14 |
+
|
15 |
+
if ($paymentData != null)
|
16 |
+
{
|
17 |
+
$inviPayPaymentId = $paymentData->getPaymentId();
|
18 |
+
$inviPayStatus = $paymentData->getStatus();
|
19 |
+
|
20 |
+
$newOrderStatus = null;
|
21 |
+
$newOrderComment = '';
|
22 |
+
|
23 |
+
if ($inviPayStatus == PaymentRequestStatus::COMPLETED)
|
24 |
+
{
|
25 |
+
$newOrderComment = 'Płatność potwierdzona w inviPay.com.';
|
26 |
+
$newOrderStatus = self::ORDER_STATUS_PAYMENT_COMPLETED;
|
27 |
+
}
|
28 |
+
else if ($inviPayStatus == PaymentRequestStatus::OUT_OF_LIMIT)
|
29 |
+
{
|
30 |
+
$newOrderComment = 'Klient wyczerpał swój limit w inviPay.com.';
|
31 |
+
$newOrderStatus = self::ORDER_STATUS_PAYMENT_OUT_OF_LIMIT;
|
32 |
+
}
|
33 |
+
else if ($inviPayStatus == PaymentRequestStatus::TIMEDOUT)
|
34 |
+
{
|
35 |
+
$newOrderComment = 'Klient porzucił płatność przez inviPay.com.';
|
36 |
+
$newOrderStatus = self::ORDER_STATUS_PAYMENT_TIMEOUT;
|
37 |
+
}
|
38 |
+
else
|
39 |
+
{
|
40 |
+
$newOrderComment = 'Nieznany status płatności.';
|
41 |
+
$newOrderStatus = self::ORDER_STATUS_PAYMENT_OTHER;
|
42 |
+
}
|
43 |
+
|
44 |
+
if ($newOrderStatus !== null)
|
45 |
+
{
|
46 |
+
$newOrderComment .= ' Numer płatności w inviPay.com: ' . $inviPayPaymentId;
|
47 |
+
Mage::helper('ipcpaygate')->changeOrderStateByInvipayPaymentId($inviPayPaymentId, $newOrderStatus, $newOrderComment, $inviPayStatus);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
public function redirectAction()
|
53 |
+
{
|
54 |
+
$order = Mage::helper('ipcpaygate')->getLastSessionOrder();
|
55 |
+
$data = $order->getData();
|
56 |
+
$orderId = $data['entity_id'];
|
57 |
+
|
58 |
+
Mage::helper('ipcpaygate')->changeOrderState($order, 'pending_payment', true, 'Rozpoczęto proces płatności w inviPay.com.');
|
59 |
+
|
60 |
+
$client = Mage::helper('ipcpaygate')->getApiClient();
|
61 |
+
|
62 |
+
$request = new PaymentCreationData();
|
63 |
+
$request->setReturnUrl(Mage::getUrl('ipcpaygate/payment/return', array('order' => $orderId)));
|
64 |
+
$request->setStatusUrl(Mage::getUrl('ipcpaygate/payment/status', array()));
|
65 |
+
$request->setStatusDataFormat(CallbackDataFormat::JSON);
|
66 |
+
$request->setDocumentNumber($data['increment_id']);
|
67 |
+
$request->setIssueDate(strtotime($data['created_at']) * 1000);
|
68 |
+
$request->setPriceGross($data['grand_total']);
|
69 |
+
$request->setCurrency($data['base_currency_code']);
|
70 |
+
$request->setIsInvoice(false);
|
71 |
+
$request->setBuyerGovId(Mage::helper('ipcpaygate')->getNipFromOrder($order));
|
72 |
+
$request->setBuyerEmail($data['customer_email']);
|
73 |
+
|
74 |
+
// Any exception will be logged by Magento, so no try-catch here
|
75 |
+
|
76 |
+
$result = $client->createPayment($request);
|
77 |
+
$paymentId = $result->getPaymentId();
|
78 |
+
$redirectUrl = $result->getRedirectUrl();
|
79 |
+
$order->setInvipayPaymentId($paymentId);
|
80 |
+
$order->setInvipayCompleted(false);
|
81 |
+
$order->setInvipayDeliveryConfirmed(false);
|
82 |
+
$order->save();
|
83 |
+
|
84 |
+
$this->loadLayout();
|
85 |
+
$block = $this->getLayout()->createBlock('Invipay_Ipcpaygate_Block_Redirect','ipcpaygate');
|
86 |
+
$block->setRedirectUrl($redirectUrl);
|
87 |
+
$this->getLayout()->getBlock('content')->append($block);
|
88 |
+
$this->renderLayout();
|
89 |
+
}
|
90 |
+
|
91 |
+
public function getCurrentRedirectUrl()
|
92 |
+
{
|
93 |
+
return $this->currentRedirectUrl;
|
94 |
+
}
|
95 |
+
|
96 |
+
public function returnAction()
|
97 |
+
{
|
98 |
+
$orderId = $this->getRequest()->getParam('order');
|
99 |
+
$this->loadLayout();
|
100 |
+
$block = $this->getLayout()->createBlock('Invipay_Ipcpaygate_Block_Wait','ipcpaygate');
|
101 |
+
$block->setOrderId($orderId);
|
102 |
+
$this->getLayout()->getBlock('content')->append($block);
|
103 |
+
$this->renderLayout();
|
104 |
+
}
|
105 |
+
|
106 |
+
public function checkAction()
|
107 |
+
{
|
108 |
+
$orderId = $this->getRequest()->getParam('order');
|
109 |
+
$state = Mage::helper('ipcpaygate')->getOrderPaymentStatusById($orderId);
|
110 |
+
$output = array('redirect' => false, 'redirect_url' => null, 'current_state' => $state);
|
111 |
+
|
112 |
+
if ($state == PaymentRequestStatus::COMPLETED)
|
113 |
+
{
|
114 |
+
Mage::getSingleton('checkout/session')->unsQuoteId();
|
115 |
+
$output['redirect'] = true;
|
116 |
+
$output['redirect_url'] = Mage::getUrl('checkout/onepage/success', array('_secure'=> false));
|
117 |
+
}
|
118 |
+
else if ($state == PaymentRequestStatus::OUT_OF_LIMIT || $state == PaymentRequestStatus::TIMEDOUT)
|
119 |
+
{
|
120 |
+
$output['redirect'] = true;
|
121 |
+
$output['redirect_url'] = Mage::getUrl('checkout/onepage/failure', array('_secure'=> false));
|
122 |
+
}
|
123 |
+
|
124 |
+
$this->getResponse()->setHeader('Content-type', 'application/json');
|
125 |
+
$this->getResponse()->setBody(json_encode($output));
|
126 |
+
|
127 |
+
return null;
|
128 |
+
}
|
129 |
+
}
|
app/code/community/Invipay/Ipcpaygate/etc/config.xml
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Invipay_Ipcpaygate>
|
5 |
+
<version>1.0.0.0</version>
|
6 |
+
</Invipay_Ipcpaygate>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
<events>
|
11 |
+
<sales_order_save_after>
|
12 |
+
<observers>
|
13 |
+
<ipcpaygate>
|
14 |
+
<type>model</type>
|
15 |
+
<class>ipcpaygate/orderstatusobserver</class>
|
16 |
+
<method>orderSaved</method>
|
17 |
+
</ipcpaygate>
|
18 |
+
</observers>
|
19 |
+
</sales_order_save_after>
|
20 |
+
</events>
|
21 |
+
|
22 |
+
<fieldsets>
|
23 |
+
<sales_convert_quote_payment>
|
24 |
+
<invipay_payment_id>
|
25 |
+
<to_order_payment>*</to_order_payment>
|
26 |
+
</invipay_payment_id>
|
27 |
+
</sales_convert_quote_payment>
|
28 |
+
</fieldsets>
|
29 |
+
|
30 |
+
<helpers>
|
31 |
+
<ipcpaygate>
|
32 |
+
<class>Invipay_Ipcpaygate_Helper</class>
|
33 |
+
</ipcpaygate>
|
34 |
+
</helpers>
|
35 |
+
|
36 |
+
<blocks>
|
37 |
+
<ipcpaygate>
|
38 |
+
<class>Invipay_Ipcpaygate_Block</class>
|
39 |
+
</ipcpaygate>
|
40 |
+
</blocks>
|
41 |
+
|
42 |
+
<models>
|
43 |
+
<ipcpaygate>
|
44 |
+
<class>Invipay_Ipcpaygate_Model</class>
|
45 |
+
</ipcpaygate>
|
46 |
+
</models>
|
47 |
+
|
48 |
+
<resources>
|
49 |
+
<ipcpaygate_setup>
|
50 |
+
<setup>
|
51 |
+
<module>Invipay_Ipcpaygate</module>
|
52 |
+
<class>Invipay_Ipcpaygate_Model_Resource_Setup</class>
|
53 |
+
</setup>
|
54 |
+
</ipcpaygate_setup>
|
55 |
+
</resources>
|
56 |
+
</global>
|
57 |
+
|
58 |
+
<default>
|
59 |
+
<payment>
|
60 |
+
<ipcpaygate>
|
61 |
+
<active>1</active>
|
62 |
+
<model>ipcpaygate/paymentmethod</model>
|
63 |
+
<title>Zakupy na fakturę z 21-dniowym terminem płatności (tylko dla zakupów na firmę)</title>
|
64 |
+
<allowspecific>0</allowspecific>
|
65 |
+
<payment_action>sale</payment_action>
|
66 |
+
<min_order_total>200.00</min_order_total>
|
67 |
+
<invipay_base_duedate>14</invipay_base_duedate>
|
68 |
+
<invipay_promo_checkout_text>standard</invipay_promo_checkout_text>
|
69 |
+
<invipay_widgets_floatingpanel>right</invipay_widgets_floatingpanel>
|
70 |
+
<invipay_widgets_basketinfo>1</invipay_widgets_basketinfo>
|
71 |
+
<invipay_widgets_footericon>1</invipay_widgets_footericon>
|
72 |
+
<invipay_demo_mode>0</invipay_demo_mode>
|
73 |
+
</ipcpaygate>
|
74 |
+
</payment>
|
75 |
+
</default>
|
76 |
+
|
77 |
+
<frontend>
|
78 |
+
<layout>
|
79 |
+
<updates>
|
80 |
+
<ipcpaygate>
|
81 |
+
<file>ipcpaygate.xml</file>
|
82 |
+
</ipcpaygate>
|
83 |
+
</updates>
|
84 |
+
</layout>
|
85 |
+
|
86 |
+
<routers>
|
87 |
+
<ipcpaygate>
|
88 |
+
<use>standard</use>
|
89 |
+
<args>
|
90 |
+
<module>Invipay_Ipcpaygate</module>
|
91 |
+
<frontName>ipcpaygate</frontName>
|
92 |
+
</args>
|
93 |
+
</ipcpaygate>
|
94 |
+
</routers>
|
95 |
+
</frontend>
|
96 |
+
</config>
|
app/code/community/Invipay/Ipcpaygate/etc/system.xml
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<ipcpaygate translate="label" module="ipcpaygate">
|
7 |
+
<label>inviPay.com</label>
|
8 |
+
<sort_order>1000</sort_order>
|
9 |
+
<show_in_default>1</show_in_default>
|
10 |
+
<show_in_website>1</show_in_website>
|
11 |
+
<show_in_store>0</show_in_store>
|
12 |
+
<fields>
|
13 |
+
|
14 |
+
<block_info>
|
15 |
+
<label><p style="font-size: 20px;">Ważne. Do zamówień opłaconych za pomocą inviPay.com, fakturę należy wystawić dopiero PO ODBIORZE zamówienia przez klienta!</p></label>
|
16 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
17 |
+
<sort_order>0</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
</block_info>
|
21 |
+
|
22 |
+
<heading_paygate_properties translate="label">
|
23 |
+
<label>Konto sklepu w inviPay.com</label>
|
24 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
25 |
+
<sort_order>0</sort_order>
|
26 |
+
<show_in_default>1</show_in_default>
|
27 |
+
<show_in_website>1</show_in_website>
|
28 |
+
</heading_paygate_properties>
|
29 |
+
|
30 |
+
<api_key translate="label">
|
31 |
+
<label>Publiczny klucz API inviPay.com</label>
|
32 |
+
<frontend_type>text</frontend_type>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>0</show_in_store>
|
36 |
+
<sort_order>1</sort_order>
|
37 |
+
</api_key>
|
38 |
+
|
39 |
+
<signature_key translate="label">
|
40 |
+
<label>Prywatny klucz API inviPay.com</label>
|
41 |
+
<frontend_type>password</frontend_type>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>0</show_in_store>
|
45 |
+
<sort_order>2</sort_order>
|
46 |
+
</signature_key>
|
47 |
+
|
48 |
+
<invipay_base_duedate translate="label">
|
49 |
+
<label>Termin płatności faktur (dni)</label>
|
50 |
+
<frontend_type>text</frontend_type>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>1</show_in_website>
|
53 |
+
<show_in_store>0</show_in_store>
|
54 |
+
<sort_order>3</sort_order>
|
55 |
+
</invipay_base_duedate>
|
56 |
+
|
57 |
+
<invipay_demo_mode translate="label">
|
58 |
+
<label>Tryb demo (demo.invipay.com)</label>
|
59 |
+
<frontend_type>select</frontend_type>
|
60 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>1</show_in_website>
|
63 |
+
<show_in_store>0</show_in_store>
|
64 |
+
<sort_order>4</sort_order>
|
65 |
+
</invipay_demo_mode>
|
66 |
+
|
67 |
+
<heading_invipay_promo translate="label">
|
68 |
+
<label>Materiały promocyjne inviPay.com</label>
|
69 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
70 |
+
<sort_order>5</sort_order>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<show_in_website>1</show_in_website>
|
73 |
+
</heading_invipay_promo>
|
74 |
+
|
75 |
+
<invipay_promo_checkout_text translate="label">
|
76 |
+
<label>Komunikat podczas wyboru metody płatności</label>
|
77 |
+
<frontend_type>select</frontend_type>
|
78 |
+
<source_model>ipcpaygate/system_config_source_checkouttext</source_model>
|
79 |
+
<show_in_default>1</show_in_default>
|
80 |
+
<show_in_website>1</show_in_website>
|
81 |
+
<show_in_store>0</show_in_store>
|
82 |
+
<sort_order>6</sort_order>
|
83 |
+
</invipay_promo_checkout_text>
|
84 |
+
|
85 |
+
<invipay_widgets_floatingpanel translate="label">
|
86 |
+
<label>Panel pływający</label>
|
87 |
+
<frontend_type>select</frontend_type>
|
88 |
+
<source_model>ipcpaygate/system_config_source_widgets_floatingpanel</source_model>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>0</show_in_store>
|
92 |
+
<sort_order>7</sort_order>
|
93 |
+
</invipay_widgets_floatingpanel>
|
94 |
+
|
95 |
+
<invipay_widgets_basketinfo translate="label">
|
96 |
+
<label>Informacja w koszyku</label>
|
97 |
+
<frontend_type>select</frontend_type>
|
98 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
99 |
+
<show_in_default>1</show_in_default>
|
100 |
+
<show_in_website>1</show_in_website>
|
101 |
+
<show_in_store>0</show_in_store>
|
102 |
+
<sort_order>8</sort_order>
|
103 |
+
</invipay_widgets_basketinfo>
|
104 |
+
|
105 |
+
<invipay_widgets_footericon translate="label">
|
106 |
+
<label>Ikonka w stopce strony</label>
|
107 |
+
<frontend_type>select</frontend_type>
|
108 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
109 |
+
<show_in_default>1</show_in_default>
|
110 |
+
<show_in_website>1</show_in_website>
|
111 |
+
<show_in_store>0</show_in_store>
|
112 |
+
<sort_order>9</sort_order>
|
113 |
+
</invipay_widgets_footericon>
|
114 |
+
|
115 |
+
<heading_magento_properties translate="label">
|
116 |
+
<label>Ustawienia Magento</label>
|
117 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
118 |
+
<sort_order>10</sort_order>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
</heading_magento_properties>
|
122 |
+
|
123 |
+
<title translate="label">
|
124 |
+
<label>Opis metody płatności</label>
|
125 |
+
<frontend_type>text</frontend_type>
|
126 |
+
<show_in_default>1</show_in_default>
|
127 |
+
<show_in_website>1</show_in_website>
|
128 |
+
<show_in_store>0</show_in_store>
|
129 |
+
<sort_order>11</sort_order>
|
130 |
+
</title>
|
131 |
+
<active translate="label">
|
132 |
+
<label>Metoda aktywna</label>
|
133 |
+
<frontend_type>select</frontend_type>
|
134 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
135 |
+
<show_in_default>1</show_in_default>
|
136 |
+
<show_in_website>1</show_in_website>
|
137 |
+
<show_in_store>0</show_in_store>
|
138 |
+
<sort_order>12</sort_order>
|
139 |
+
</active>
|
140 |
+
<allowspecific translate="label">
|
141 |
+
<label>Aktywna dla krajów</label>
|
142 |
+
<frontend_type>allowspecific</frontend_type>
|
143 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
144 |
+
<show_in_default>1</show_in_default>
|
145 |
+
<show_in_website>1</show_in_website>
|
146 |
+
<show_in_store>1</show_in_store>
|
147 |
+
<sort_order>13</sort_order>
|
148 |
+
</allowspecific>
|
149 |
+
<specificcountry translate="label">
|
150 |
+
<label></label>
|
151 |
+
<frontend_type>multiselect</frontend_type>
|
152 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
153 |
+
<show_in_default>1</show_in_default>
|
154 |
+
<show_in_website>1</show_in_website>
|
155 |
+
<show_in_store>1</show_in_store>
|
156 |
+
<sort_order>14</sort_order>
|
157 |
+
</specificcountry>
|
158 |
+
<min_order_total translate="label">
|
159 |
+
<label>Minimalna wartość zamówienia</label>
|
160 |
+
<frontend_type>text</frontend_type>
|
161 |
+
<show_in_default>1</show_in_default>
|
162 |
+
<show_in_website>1</show_in_website>
|
163 |
+
<show_in_store>1</show_in_store>
|
164 |
+
<sort_order>15</sort_order>
|
165 |
+
</min_order_total>
|
166 |
+
</fields>
|
167 |
+
</ipcpaygate>
|
168 |
+
</groups>
|
169 |
+
</payment>
|
170 |
+
</sections>
|
171 |
+
</config>
|
app/code/community/Invipay/Ipcpaygate/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/sql/ipcpaygate_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Invipay/Ipcpaygate/sql/ipcpaygate_setup/mysql4-install-1.0.0.0.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->run("
|
6 |
+
ALTER TABLE `{$installer->getTable('sales/order')}` ADD COLUMN `invipay_payment_id` VARCHAR(255) NULL DEFAULT NULL;
|
7 |
+
ALTER TABLE `{$installer->getTable('sales/order')}` ADD COLUMN `invipay_status` VARCHAR(255) NULL DEFAULT NULL;
|
8 |
+
ALTER TABLE `{$installer->getTable('sales/order')}` ADD COLUMN `invipay_delivery_confirmed` TINYINT(1) NOT NULL DEFAULT 0;
|
9 |
+
ALTER TABLE `{$installer->getTable('sales/order')}` ADD COLUMN `invipay_completed` TINYINT(1) NOT NULL DEFAULT 0;
|
10 |
+
");
|
11 |
+
$installer->endSetup();
|
12 |
+
|
13 |
+
?>
|
app/design/frontend/base/default/layout/ipcpaygate.xml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<layout version="0.1.0">
|
2 |
+
<default>
|
3 |
+
<reference name="head" before="-">
|
4 |
+
<block type="core/template" name="invipay_widgets_head" template="ipcpaygate/widgets/head.phtml" />
|
5 |
+
</reference>
|
6 |
+
<reference name="before_body_end">
|
7 |
+
<block type="ipcpaygate/widgets_floatingpanel" name="invipay_widgets_floatingpanel"/>
|
8 |
+
</reference>
|
9 |
+
<reference name="cart_sidebar.extra_actions">
|
10 |
+
<block type="ipcpaygate/widgets_basketinfo" name="invipay_widgets_basketinfo"/>
|
11 |
+
</reference>
|
12 |
+
<reference name="footer">
|
13 |
+
<block type="ipcpaygate/widgets_footericon" name="invipay_widgets_footericon"/>
|
14 |
+
</reference>
|
15 |
+
</default>
|
16 |
+
</layout>
|
app/design/frontend/base/default/template/ipcpaygate/.DS_Store
ADDED
Binary file
|
app/design/frontend/base/default/template/ipcpaygate/form/checkout.phtml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">
|
2 |
+
<div>
|
3 |
+
<?php if($this->getMethod()->getConfigData('invipay_promo_checkout_text') == 'standard') { ?>
|
4 |
+
<p>Po odbiorze zamówionego towaru, zapłacisz za niego w terminie płatności wynikającym z faktury VAT, którą od nas otrzymasz za pośrednictwem aplikacji inviPay.com, powiększonym o 7 dni.</p>
|
5 |
+
<?php } ?>
|
6 |
+
|
7 |
+
<?php if($this->getMethod()->getConfigData('invipay_promo_checkout_text') == 'short') { ?>
|
8 |
+
|
9 |
+
<p>Po odbiorze zamówionego towaru, zapłacisz za niego w terminie płatności wynikającym z faktury VAT, którą od nas otrzymasz za pośrednictwem aplikacji inviPay.com powiększonym o 7 dni. Możesz też wydłużyć sobie ten termin do 4 miesięcy od zakupu (za dodatkową opłatą do inviPay.com).</p>
|
10 |
+
|
11 |
+
<?php } ?>
|
12 |
+
|
13 |
+
<?php if($this->getMethod()->getConfigData('invipay_promo_checkout_text') == 'medium') { ?>
|
14 |
+
|
15 |
+
<p>Bezpieczna, szybka i wygodna metoda płatności świadczona za pośrednictwem inviPay.com. Po wyborze tej metody płatności, zostaniesz przekierowany do bramki płatności inviPay.com gdzie będziesz mógł potwierdzić swoje zakupy (jeżeli posiadasz konto w inviPay.com) lub założyć konto w inviPay.com i dokonać potwierdzenia. Założenie konta w inviPay.com trwa 40 sekund i jest całkowicie bezpłatne oraz niezobowiązujące. Z chwilą potwierdzenia, Twoje zamówienie trafia do realizacji.</p>
|
16 |
+
|
17 |
+
<p>Po odbiorze zamówionego towaru, inviPay.com zapłaci za Twoje zakupy do sklepu, a Ty rozliczysz się z nich z inviPay.com w terminie płatności wynikającym z faktury VAT wystawionej przez sklep powiększonym o 7 dni od inviPay.com. Rozliczenie zakupu w ww. terminie płatności faktury będzie dla Ciebie całkowicie bezpłatne. </p>
|
18 |
+
|
19 |
+
<?php } ?>
|
20 |
+
|
21 |
+
<?php if($this->getMethod()->getConfigData('invipay_promo_checkout_text') == 'long') { ?>
|
22 |
+
|
23 |
+
<p>Robisz zakupy firmowe i chciałbyś zapłacić za nie tak jak to robisz poza Internetem tj. w terminie płatności wynikającym z faktury otrzymanej od sklepu? Nie lubisz płacić z góry przed otrzymaniem zamówienia? A może nie masz w tej chwili wolnych środków? Skorzystaj z metody płatności inviPay.com.</p>
|
24 |
+
|
25 |
+
<p>Dzięki inviPay.com możesz kupować i płacić za zakupy firmowe po ich odbiorze w terminie płatności wynikającym z faktury otrzymanej od sklepu powiększonym o 7 dni od inviPay.com (oczywiście całkowicie bezpłatnie). Jeżeli masz życzenie, możesz też wydłużyć sobie ten termin płatności nawet do 4 miesięcy od zakupu ponosząc dodatkową niewielką opłatę w wysokości 1%, za każde 15 dni wydłużenia. Zawsze to Ty decydujesz kiedy płacisz za swoje zakupy.</p>
|
26 |
+
|
27 |
+
<p>InviPay.com to nie tylko bezpieczeństwo i komfort zakupów. To też łatwość dokonywania zwrotów zakupionych towarów. Wystarczy zawiadomić inviPay.com o problemie z zamówieniem i ewentualnie odesłać towar do sklepu. Z uwagi na to, że nie dokonywałeś żadnych płatności przed otrzymaniem towaru nie musisz też czekać na ich zwrot. Tak inviPay.com na nowo definiuje "wygodne i bezpieczne zakupy online".</p>
|
28 |
+
|
29 |
+
<p>Aby dokonać zakupów na fakturę z odroczonym terminem, podczas składania zamówienia wybierz metodę płatności inviPay.com. Następnie zaloguj się na swoje konto inviPay.com i potwierdź kodem sms swoje zakupy. Jeżeli nie posiadasz konta, możesz je błyskawicznie założyć (zajmie Ci to 40 sekund, a założenie i prowadzenie konta jest całkowicie bezpłatne). Po potwierdzeniu zakupów, Twoje zamówienie trafia do realizacji.</p>
|
30 |
+
|
31 |
+
<?php } ?>
|
32 |
+
</div>
|
33 |
+
</div>
|
app/design/frontend/base/default/template/ipcpaygate/form/checkout_info.phtml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php echo $this->getLabelTitle(); ?>
|
2 |
+
<div>
|
3 |
+
<img src="http://invipay.com/promo/images/logo_slogan_big.png" alt="inviPay.com" style="display: inline !important; float: none !important; width: 75% !important; max-width: 150px !important; margin: 10px !important;" />
|
4 |
+
</div>
|
app/design/frontend/base/default/template/ipcpaygate/form/checkout_label.phtml
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<img src="http://invipay.com/promo/images/logo_slogan_small.png" alt="inviPay.com" style="display: inline !important; float: none !important; height: 25px !important; margin-right: 10px !important; vertical-align: middle !important;" />
|
2 |
+
<span><?php echo $this->getLabelTitle(); ?></span>
|
app/design/frontend/base/default/template/ipcpaygate/redirect.phtml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$redirectUrl = $this->getRedirectUrl();
|
3 |
+
$redirectUrl = htmlentities($redirectUrl);
|
4 |
+
?>
|
5 |
+
|
6 |
+
<h2>Trwa przekierowanie do inviPay.com...</h2>
|
7 |
+
<p>Za chwilę nastąpi przekierowanie do bramki płatniczej inviPay.com. Jeżeli Twoja przeglądarka nie zostanie przekierowana automatycznie <a href="<?php echo $redirectUrl; ?>">kliknij tutaj</a>.</p>
|
8 |
+
<script type="text/javascript">
|
9 |
+
window.setTimeout(function(){ document.location.href = '<?php echo $redirectUrl; ?>'; }, 500);
|
10 |
+
</script>
|
app/design/frontend/base/default/template/ipcpaygate/wait.phtml
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$orderId = $this->getOrderId();
|
3 |
+
$checkUrl = Mage::getUrl("ipcpaygate/payment/check", array("order" => $orderId));
|
4 |
+
?>
|
5 |
+
|
6 |
+
<h2>Oczekiwanie na potwierdzenie płatności w inviPay.com...</h2>
|
7 |
+
<p>Oczekujemy na potwierdzenie Twojej płatności w inviPay.com.</p>
|
8 |
+
<script type="text/javascript">
|
9 |
+
|
10 |
+
(function(){
|
11 |
+
|
12 |
+
ajaxCall = function(url, callback) {
|
13 |
+
|
14 |
+
var xhr;
|
15 |
+
|
16 |
+
if(typeof XMLHttpRequest !== 'undefined') {
|
17 |
+
xhr = new XMLHttpRequest();
|
18 |
+
}
|
19 |
+
else {
|
20 |
+
var versions = ["MSXML2.XmlHttp.5.0", "MSXML2.XmlHttp.4.0", "MSXML2.XmlHttp.3.0", "MSXML2.XmlHttp.2.0", "Microsoft.XmlHttp"]
|
21 |
+
|
22 |
+
for(var i = 0, len = versions.length; i < len; i++) {
|
23 |
+
try {
|
24 |
+
xhr = new ActiveXObject(versions[i]);
|
25 |
+
break;
|
26 |
+
}
|
27 |
+
catch(e){}
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
xhr.onreadystatechange = function() {
|
32 |
+
if(xhr.readyState < 4) {
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
|
36 |
+
if(xhr.status !== 200) {
|
37 |
+
return;
|
38 |
+
}
|
39 |
+
|
40 |
+
if(xhr.readyState === 4) {
|
41 |
+
callback(xhr);
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
xhr.open('GET', url, true);
|
46 |
+
xhr.send('');
|
47 |
+
}
|
48 |
+
|
49 |
+
doCheckPayment = function()
|
50 |
+
{
|
51 |
+
ajaxCall('<?php echo $checkUrl ?>', function(xhr) {
|
52 |
+
|
53 |
+
if (xhr) {
|
54 |
+
var response = xhr.responseText;
|
55 |
+
if (response) {
|
56 |
+
var obj = JSON.parse(response);
|
57 |
+
if (obj) {
|
58 |
+
if (obj['redirect'] == true && obj['redirect_url'] != null) {
|
59 |
+
document.location.href = obj['redirect_url'];
|
60 |
+
} else {
|
61 |
+
console.log('Check again!');
|
62 |
+
window.setTimeout(doCheckPayment, 1000);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
});
|
68 |
+
};
|
69 |
+
|
70 |
+
doCheckPayment();
|
71 |
+
|
72 |
+
})();
|
73 |
+
</script>
|
app/design/frontend/base/default/template/ipcpaygate/widgets/basketinfo.phtml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($this->getEnabled()) { ?>
|
2 |
+
|
3 |
+
<p style="text-align: center; margin-top: 10px; margin-bottom: 10px;"><b data-invipay-widget="BasketInfo" data-duedate-days="<?php echo $this->getDueDateDays(); ?>" data-format="d-m-y"></b></p>
|
4 |
+
|
5 |
+
<?php } ?>
|
app/design/frontend/base/default/template/ipcpaygate/widgets/floatingpanel.phtml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($this->getEnabled()) { ?>
|
2 |
+
|
3 |
+
<div data-invipay-widget="FloatingPanel" data-position="<?php echo $this->getStyle(); ?>" data-duedate-days="<?php echo $this->getDueDateDays(); ?>" data-minimum-value="<?php echo $this->getMinOrderTotal(); ?>"></div>
|
4 |
+
|
5 |
+
<?php } ?>
|
app/design/frontend/base/default/template/ipcpaygate/widgets/footericon.phtml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($this->getEnabled()) { ?>
|
2 |
+
<br style="clear: both; margin-top: 10px;">
|
3 |
+
<a href="http://www.invipay.com" target="_blank" style="border: none !important;"><img src="http://invipay.com/promo/images/logo_slogan_big.png" style="height: 40px !important; margin: 10px;" alt="<?php echo $this->getText(); ?>"></a>
|
4 |
+
|
5 |
+
<?php } ?>
|
app/design/frontend/base/default/template/ipcpaygate/widgets/head.phtml
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<script type="text/javascript" src="http://invipay.com/promo/InviPay.Widgets.min.js"></script>
|
app/etc/modules/Invipay_All.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Invipay_Ipcpaygate>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
|
8 |
+
<depends>
|
9 |
+
<Mage_Payment />
|
10 |
+
</depends>
|
11 |
+
</Invipay_Ipcpaygate>
|
12 |
+
</modules>
|
13 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Invipay_Ipcpaygate</name>
|
4 |
+
<version>1.0.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL-3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Bramka płatnicza inviPay.com</summary>
|
10 |
+
<description>Dzięki bramce płatności inviPay.com klient może zapłacić za zakupy w e-sklepie tak samo wygodnie i bezpiecznie jak to robi poza nim tj. dopiero po otrzymaniu i sprawdzeniu zamówienia w terminie płatności wynikającym z faktury, którą otrzymał od e-sklepu. Bezpiecznie, szybko i wygodnie na każdym etapie procesu.
|
11 |
+

|
12 |
+
Z drugiej strony, e-sklep już na etapie złożenia zamówienia przez klienta otrzymuje od inviPay.com zabezpieczenie całej płatności, którą wypłaca z inviPay.com natychmiast po zrealizowaniu zamówienia i wystawieniu faktury (bez czekania na termin płatności faktury).</description>
|
13 |
+
<notes>Pierwsze wydanie</notes>
|
14 |
+
<authors><author><name>Kuba Pilecki</name><user>MAG003279533</user><email>k.pilecki@gmail.com</email></author></authors>
|
15 |
+
<date>2016-01-22</date>
|
16 |
+
<time>16:30:22</time>
|
17 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Invipay_All.xml" hash="a74b71a076b06024ac9b43e50a3c5b91"/></dir></target><target name="magecommunity"><dir name="Invipay"><dir name="Common"><dir name="Apiclient"><file name="LiabilitiesApiClient.class.php" hash="fc4ba09f0d0db408093aa4116793baa6"/><file name="PaygateApiClient.class.php" hash="e7a12dc21f5be6471acfffc1170a248e"/><file name="ReportsApiClient.class.php" hash="f3f0fe461ce78703cd1dbb2662a6decb"/><file name="TestApiClient.class.php" hash="178607f8829fbec6b900a8414bc07624"/><file name="TransactionsApiClient.class.php" hash="6d20fa053f1cc5ab960d7fee7cfb325f"/><dir name="dto"><file name="Address.class.php" hash="ff349016b36288aad05889b4d695d28f"/><file name="BankAccount.class.php" hash="2a677ab6fed0d35a8dcb52efb9291ed3"/><file name="BaseApiData.class.php" hash="a6ef76b5029508f53ef8354edbe52a2d"/><file name="BaseDocumentDetails.class.php" hash="12ae197ccd291f88c1d4ede46c5409c7"/><file name="Contractor.class.php" hash="5c8d03d5d94d7d47fcb3bec75b7afe5d"/><file name="DocumentAttachmentDownloadInfo.class.php" hash="e67c0e9e7ab77286140e25e4777f9946"/><file name="FileData.class.php" hash="646d93761d160ec22b98ce134f50b4f6"/><file name="FileInfo.class.php" hash="37a991db3016b1966cbe5c16e7fec21c"/><file name="ListFilter.class.php" hash="5619ee73318986dc0a9b19e84810f1df"/><dir name="liabilitiesapiservice"><file name="CommissionInvoiceDetails.class.php" hash="09a9111c21e007c31b7a15b4b16f5386"/><file name="InterestInvoiceDetails.class.php" hash="9c8d0064c5630a175d6b4927ce7ca5fe"/><file name="InterestNoteDetails.class.php" hash="57f2b4d646174ac26545a0a987c31c75"/><file name="LiabilityDocumentDetails.class.php" hash="73510cd207cfae45876e5d4a2c3af9f3"/></dir><dir name="paygateapiservice"><file name="CallbackDataFormat.enum.php" hash="fddecb87075141f17d8f00ef1ede2d3b"/><file name="OrderToInvoiceData.class.php" hash="c5b6fdb14000ff0601dd3e58aabf9a1a"/><file name="PaymentCreationData.class.php" hash="f4176eb4ac306b30ec04ba303a5e662c"/><file name="PaymentData.class.php" hash="7b6acf1bdb6595add1183643635af4ae"/><file name="PaymentManagementData.class.php" hash="885b6bd61d714e83dd0d49a7925a9867"/><file name="PaymentRequestStatus.enum.php" hash="ebc15625baaa5b95dce69358254f5523"/><file name="PaymentStartInfo.class.php" hash="47413c9c8632cab45e427729939ea92e"/></dir><dir name="reportsapiservice"><file name="AccountantReportCommissionInvoiceItem.class.php" hash="875b542d5d3f889f06aa41234244e24d"/><file name="AccountantReportDocument.class.php" hash="7ff8f5c9b40a44e89f59ba2b0e55eba8"/><file name="AccountantReportInterestInvoiceItem.class.php" hash="c03e2a9c366bfb29f91c977c50465f70"/><file name="AccountantReportInterestNoteItem.class.php" hash="97368b9c64781768199b13bb8175e7be"/><file name="AccountantReportPaymentItem.class.php" hash="da2832dc6031dd6304a6a1baee47b962"/><file name="AccountantReportPayoffItem.class.php" hash="b146eec8d6c562964131bc825327a4d2"/><file name="AccountantReportPurchaseItem.class.php" hash="16ba5bbe01e723bf60c3ea9c45544084"/><file name="AccountantReportRSBItem.class.php" hash="a6363f2eb62ebb4571dbd4f2b87cba67"/><file name="AccountantReportRSPSettlementItem.class.php" hash="58e676d7b89a1b2d7e3d1e5067947836"/><file name="AccountantReportRSReversedSettlementItem.class.php" hash="c275a1bc23403fbd52b80e9dfb16c457"/><file name="AccountantReportRSSettlementItem.class.php" hash="014072417ff79bf370a368d6fd23e5e7"/><file name="AccountantReportResaleStatementItem.class.php" hash="62c8083f9d14dffc78dccbdfb147ef67"/><file name="AccountantReportSaleItem.class.php" hash="069ee1e48a6502fbe74048f5e6f36b68"/><file name="AccountantReportSettlementItem.class.php" hash="cb16a361e81c91b9f4fb06f2ba6f027e"/><file name="DocumentItem.class.php" hash="42f129867c013e876d76f401b6334f2a"/><file name="ReportFilter.class.php" hash="6431509fca97cc850215a9b24e88e308"/></dir><dir name="testapiservice"><file name="EchoIn.class.php" hash="5adbbca3cd1167e4c17bbef6c8694767"/><file name="EchoOut.class.php" hash="f8a363a7469fd2c08026013a6bc9a0a3"/></dir><dir name="transactionapiservice"><file name="BaseTransactionData.class.php" hash="de48f024b4f147fd720dc9a903fc70ce"/><file name="InvoiceData.class.php" hash="a551eb26ab489e8b71ac41411b75cbe3"/><file name="OrderData.class.php" hash="cddd51addb9c1a50cc20283fcee95c09"/><file name="TransactionDetails.class.php" hash="b80955b0cc09a976ca2984a7710f2daa"/><file name="TransactionItemDetails.class.php" hash="2510b1e2c0dcc797bbd3aa7fd61d12d5"/><file name="TransactionSide.enum.php" hash="b8a064d2746a4c8f85b9b53940dc324b"/><file name="TransactionType.enum.php" hash="1da4785de0de4cd8dfa92b4fd1b1b0fd"/><file name="TransactionsFilter.class.php" hash="6ab4a65ff7f0aa0d1ffd9b6d8d40c40b"/></dir><file name=".DS_Store" hash="db9f178be1e3f3b4672d7723ff99e838"/></dir><dir name="exceptions"><file name="AccessFromIpDeniedException.class.php" hash="10d27ad15a78481c60b933a29a651833"/><file name="ApiOperationException.class.php" hash="2565937e6c9c52eeb1283630792e4e55"/><file name="AuthenticationException.class.php" hash="16f450fd99458e61a346b8381d50ab61"/><file name="ObjectNotFoundException.class.php" hash="9c97b69974c67cbb9588a9cf448a42bd"/><file name="SignatureException.class.php" hash="6a97d00d5a9f11b27ebd5f015ec3b5da"/><file name="TransactionContractorException.class.php" hash="31d7e92e10b1fcbc5d5b577accf33937"/><file name="ValidationException.class.php" hash="243b86124c941eea5ababf98d146babe"/></dir><dir name="lib"><file name="AbstractRestApiClient.class.php" hash="49a0e3c46da46c5dab0222e0c51c83d0"/></dir><file name=".DS_Store" hash="e3b4b0ac5083b229d1679f91eac91efe"/></dir><file name=".DS_Store" hash="0a86ab0ca73c544a0d271f26baae097f"/></dir><dir name="Ipcpaygate"><dir name="Block"><dir name="Form"><file name="Checkout.php" hash="9a92da6993cb5e45f02bbb2bcc6a478c"/></dir><dir name="Info"><file name="Checkout.php" hash="5d5df97f7811cfc595810f49c8fba07e"/></dir><file name="Redirect.php" hash="8b75e3a69d9d7585d94c56ce21bde547"/><file name="Wait.php" hash="d38448d00281660f88c1770db6df6b8f"/><dir name="Widgets"><file name="Basketinfo.php" hash="7d32d565dbe33fee1941652db9e0e65e"/><file name="Floatingpanel.php" hash="70156ce6b4d9c9bce503806d9336db6d"/><file name="Footericon.php" hash="d77908b60c65489c299863089271f570"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="7f16b71b7ec1319816563269c3da4db5"/></dir><dir name="Helper"><file name="Data.php" hash="392a0453196a3f5c3ef93854b39cc3da"/><file name=".DS_Store" hash="5cc9b356b8566590d84d1a846226a1e1"/></dir><dir name="Model"><file name="Orderstatusobserver.php" hash="eb1aa78074f6cf760111a933f38ce543"/><file name="Paymentmethod.php" hash="b9e1a837463724eec729069be8ac6825"/><dir name="Resource"><file name="Setup.php" hash="5fdeabfaa3d15dd1b187d1c516f62b02"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Checkouttext.php" hash="47c6f310cdfdf919b9ea0a0788b78a30"/><file name="Floatingpanel.php" hash="1c5acad7b7c3ca864f93714ca6c8613c"/><dir name="Widgets"><file name="Floatingpanel.php" hash="389ab30e3849aa65ebfe9ee09f717cb3"/></dir><file name=".DS_Store" hash="5343b820b758e30ee613f67879a49745"/></dir><file name=".DS_Store" hash="f5208bdb3f4c2895c6c0809f370601c4"/></dir><file name=".DS_Store" hash="790cce256bd47fe17cf504eb519ccb6f"/></dir><file name=".DS_Store" hash="a62d56a5e78fa8b2d0b4187421321683"/></dir><dir name="controllers"><file name="PaymentController.php" hash="a1695dec03f0f2633c7291056c2dace8"/></dir><dir name="etc"><file name="config.xml" hash="5dc59eaed0b68c01731c7f1804c244f4"/><file name="system.xml" hash="7f265c364b8a70c58787cc96b2b65113"/></dir><dir name="sql"><dir name="ipcpaygate_setup"><file name="mysql4-install-1.0.0.0.php" hash="a15d8e5cfc533bde3f06db9d8417b8dc"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="d18cf2accf016fdd289002001e10873e"/></dir><file name=".DS_Store" hash="34dbe5a6985e0e478581b71889ff3088"/></dir><file name=".DS_Store" hash="542e0245a88a7d2c91c3785e22632cb8"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="ipcpaygate"><dir name="form"><file name="checkout.phtml" hash="92f8878ac5aa188fb1602a278a3f7200"/><file name="checkout_info.phtml" hash="5bd531bf5b8c20326dfa01613f2eb05c"/><file name="checkout_label.phtml" hash="c06e1ef6aed517d99796a7124e7f65a9"/></dir><file name="redirect.phtml" hash="d552d7a594766602ec10f99f1ac70310"/><file name="wait.phtml" hash="bc9349a14bd6fbd7bfb4dbc74704064c"/><dir name="widgets"><file name="basketinfo.phtml" hash="c00eb38ec8e12bca9834f56b297beb99"/><file name="floatingpanel.phtml" hash="9158bae9e9b6a40fa119bc8c77ef4163"/><file name="footericon.phtml" hash="7228d21af05ba8ab460378c1eb1a83a4"/><file name="head.phtml" hash="52877a06de606376f488459b26997877"/></dir><file name=".DS_Store" hash="e46e8349e010f638b0ebdf5cfccecadb"/></dir></dir><dir name="layout"><file name="ipcpaygate.xml" hash="97281b9392c9138976b83e6598286364"/></dir></dir></dir></dir></target></contents>
|
18 |
+
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
+
</package>
|