Changeset 3319619
- Timestamp:
- 06/30/2025 12:12:23 AM (9 months ago)
- Location:
- simple-payment
- Files:
-
- 256 added
- 28 edited
- 1 copied
-
tags/2.4.1 (copied) (copied from simple-payment/trunk)
-
tags/2.4.1/addons/admin-columns-pro (added)
-
tags/2.4.1/addons/admin-columns-pro/classes (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Admin.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Capabilities.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Address.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Choices.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Custom (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Custom/User.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/MultipleChoices.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Name.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original/DateCreated.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original/DatePayment.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original/EntryId.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original/PaymentAmount.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original/SourceUrl.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original/Starred.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original/TransactionId.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original/User.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Original/UserIp.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/Product.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/Entry/ProductSelect.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/EntryConfigurator.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Column/EntryFactory.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/EntryServiceFactory.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/RequestHandler (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/RequestHandler/Query (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/RequestHandler/Query/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/Storage (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/Storage/Entry (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/Storage/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/Storage/Entry/Checkbox.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/Storage/Entry/MultiSelect.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/Strategy (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/Strategy/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/TableRows (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Editing/TableRows/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Export (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Export/Model (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Export/Model/Entry (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Export/Model/Entry/Address.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Export/Model/Entry/Check.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Export/Model/Entry/ItemList.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Export/Model/EntryFactory.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Export/Strategy (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Export/Strategy/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Container.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Field.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Multiple.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Number.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Options.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Address.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Checkbox.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/CheckboxGroup.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Consent.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Date.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Email.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Input.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/ItemList.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Name.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Number.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Product.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/ProductSelect.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Radio.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Select.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Textarea.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Field/Type/Unsupported.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/FieldFactory.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/FieldTypes.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/HideOnScreen (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/HideOnScreen/EntryFilters.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/HideOnScreen/WordPressNotifications.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/ListScreen (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/ListScreen/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/ListScreenFactory (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/ListScreenFactory/EntryFactory.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/ListTable.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/MetaTypes.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/Checkbox.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/CheckboxGroup.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/Choice.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/Choices.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/Consent.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/Date.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/DateColumn.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/EntryId.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/Number.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/PaymentAmount.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/Starred.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/Text.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/TextColumn.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/Entry/User.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Comparison/EntryFactory.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Query (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Query.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/Query/Bindings.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/TableScreen (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Search/TableScreen/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Service (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Service/ColumnGroup.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Service/Columns.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Service/ListScreens.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Service/Scripts.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Settings (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Settings/ChoiceDisplay.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/SimplePayment.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/TableFactory.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/TableScreen (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/TableScreen/Entry.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Utils (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Utils/FormField.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Utils/Hooks.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Value (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Value.php (added)
-
tags/2.4.1/addons/admin-columns-pro/classes/Value/EntryValue.php (added)
-
tags/2.4.1/addons/admin-columns-pro/init.php (added)
-
tags/2.4.1/addons/gravityforms/init.php (modified) (2 diffs)
-
tags/2.4.1/admin/admin.php (modified) (4 diffs)
-
tags/2.4.1/admin/style.css (modified) (2 diffs)
-
tags/2.4.1/admin/transaction-list-table.php (modified) (1 diff)
-
tags/2.4.1/admin/transaction-log.php (modified) (1 diff)
-
tags/2.4.1/curl.log (added)
-
tags/2.4.1/engines/cardcom.php (modified) (1 diff)
-
tags/2.4.1/languages/simple-payment.pot (modified) (7 diffs)
-
tags/2.4.1/readme.txt (modified) (2 diffs)
-
tags/2.4.1/simple-payment-plugin.php (modified) (5 diffs)
-
tags/2.4.1/vendor/autoload.php (modified) (1 diff)
-
tags/2.4.1/vendor/composer/InstalledVersions.php (modified) (5 diffs)
-
tags/2.4.1/vendor/composer/installed.php (modified) (2 diffs)
-
tags/2.4.1/vendor/yalla-ya/simple-payment/Engines/Cardcom.php (modified) (25 diffs)
-
tags/2.4.1/vendor/yalla-ya/simple-payment/Engines/Engine.php (modified) (2 diffs)
-
trunk/addons/admin-columns-pro (added)
-
trunk/addons/admin-columns-pro/classes (added)
-
trunk/addons/admin-columns-pro/classes/Admin.php (added)
-
trunk/addons/admin-columns-pro/classes/Capabilities.php (added)
-
trunk/addons/admin-columns-pro/classes/Column (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Address.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Choices.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Custom (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Custom/User.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/MultipleChoices.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Name.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original/DateCreated.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original/DatePayment.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original/EntryId.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original/PaymentAmount.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original/SourceUrl.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original/Starred.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original/TransactionId.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original/User.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Original/UserIp.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/Product.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/Entry/ProductSelect.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/EntryConfigurator.php (added)
-
trunk/addons/admin-columns-pro/classes/Column/EntryFactory.php (added)
-
trunk/addons/admin-columns-pro/classes/Editing (added)
-
trunk/addons/admin-columns-pro/classes/Editing/EntryServiceFactory.php (added)
-
trunk/addons/admin-columns-pro/classes/Editing/RequestHandler (added)
-
trunk/addons/admin-columns-pro/classes/Editing/RequestHandler/Query (added)
-
trunk/addons/admin-columns-pro/classes/Editing/RequestHandler/Query/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/Editing/Storage (added)
-
trunk/addons/admin-columns-pro/classes/Editing/Storage/Entry (added)
-
trunk/addons/admin-columns-pro/classes/Editing/Storage/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/Editing/Storage/Entry/Checkbox.php (added)
-
trunk/addons/admin-columns-pro/classes/Editing/Storage/Entry/MultiSelect.php (added)
-
trunk/addons/admin-columns-pro/classes/Editing/Strategy (added)
-
trunk/addons/admin-columns-pro/classes/Editing/Strategy/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/Editing/TableRows (added)
-
trunk/addons/admin-columns-pro/classes/Editing/TableRows/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/Export (added)
-
trunk/addons/admin-columns-pro/classes/Export/Model (added)
-
trunk/addons/admin-columns-pro/classes/Export/Model/Entry (added)
-
trunk/addons/admin-columns-pro/classes/Export/Model/Entry/Address.php (added)
-
trunk/addons/admin-columns-pro/classes/Export/Model/Entry/Check.php (added)
-
trunk/addons/admin-columns-pro/classes/Export/Model/Entry/ItemList.php (added)
-
trunk/addons/admin-columns-pro/classes/Export/Model/EntryFactory.php (added)
-
trunk/addons/admin-columns-pro/classes/Export/Strategy (added)
-
trunk/addons/admin-columns-pro/classes/Export/Strategy/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/Field (added)
-
trunk/addons/admin-columns-pro/classes/Field.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Container.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Field.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Multiple.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Number.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Options.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Address.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Checkbox.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/CheckboxGroup.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Consent.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Date.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Email.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Input.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/ItemList.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Name.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Number.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Product.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/ProductSelect.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Radio.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Select.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Textarea.php (added)
-
trunk/addons/admin-columns-pro/classes/Field/Type/Unsupported.php (added)
-
trunk/addons/admin-columns-pro/classes/FieldFactory.php (added)
-
trunk/addons/admin-columns-pro/classes/FieldTypes.php (added)
-
trunk/addons/admin-columns-pro/classes/HideOnScreen (added)
-
trunk/addons/admin-columns-pro/classes/HideOnScreen/EntryFilters.php (added)
-
trunk/addons/admin-columns-pro/classes/HideOnScreen/WordPressNotifications.php (added)
-
trunk/addons/admin-columns-pro/classes/ListScreen (added)
-
trunk/addons/admin-columns-pro/classes/ListScreen/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/ListScreenFactory (added)
-
trunk/addons/admin-columns-pro/classes/ListScreenFactory/EntryFactory.php (added)
-
trunk/addons/admin-columns-pro/classes/ListTable.php (added)
-
trunk/addons/admin-columns-pro/classes/MetaTypes.php (added)
-
trunk/addons/admin-columns-pro/classes/Search (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/Checkbox.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/CheckboxGroup.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/Choice.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/Choices.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/Consent.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/Date.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/DateColumn.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/EntryId.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/Number.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/PaymentAmount.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/Starred.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/Text.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/TextColumn.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/Entry/User.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Comparison/EntryFactory.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Query (added)
-
trunk/addons/admin-columns-pro/classes/Search/Query.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/Query/Bindings.php (added)
-
trunk/addons/admin-columns-pro/classes/Search/TableScreen (added)
-
trunk/addons/admin-columns-pro/classes/Search/TableScreen/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/Service (added)
-
trunk/addons/admin-columns-pro/classes/Service/ColumnGroup.php (added)
-
trunk/addons/admin-columns-pro/classes/Service/Columns.php (added)
-
trunk/addons/admin-columns-pro/classes/Service/ListScreens.php (added)
-
trunk/addons/admin-columns-pro/classes/Service/Scripts.php (added)
-
trunk/addons/admin-columns-pro/classes/Settings (added)
-
trunk/addons/admin-columns-pro/classes/Settings/ChoiceDisplay.php (added)
-
trunk/addons/admin-columns-pro/classes/SimplePayment.php (added)
-
trunk/addons/admin-columns-pro/classes/TableFactory.php (added)
-
trunk/addons/admin-columns-pro/classes/TableScreen (added)
-
trunk/addons/admin-columns-pro/classes/TableScreen/Entry.php (added)
-
trunk/addons/admin-columns-pro/classes/Utils (added)
-
trunk/addons/admin-columns-pro/classes/Utils/FormField.php (added)
-
trunk/addons/admin-columns-pro/classes/Utils/Hooks.php (added)
-
trunk/addons/admin-columns-pro/classes/Value (added)
-
trunk/addons/admin-columns-pro/classes/Value.php (added)
-
trunk/addons/admin-columns-pro/classes/Value/EntryValue.php (added)
-
trunk/addons/admin-columns-pro/init.php (added)
-
trunk/addons/gravityforms/init.php (modified) (2 diffs)
-
trunk/admin/admin.php (modified) (4 diffs)
-
trunk/admin/style.css (modified) (2 diffs)
-
trunk/admin/transaction-list-table.php (modified) (1 diff)
-
trunk/admin/transaction-log.php (modified) (1 diff)
-
trunk/curl.log (added)
-
trunk/engines/cardcom.php (modified) (1 diff)
-
trunk/languages/simple-payment.pot (modified) (7 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/simple-payment-plugin.php (modified) (5 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/InstalledVersions.php (modified) (5 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/vendor/yalla-ya/simple-payment/Engines/Cardcom.php (modified) (25 diffs)
-
trunk/vendor/yalla-ya/simple-payment/Engines/Engine.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-payment/tags/2.4.1/addons/gravityforms/init.php
r3318371 r3319619 573 573 574 574 public function return_url( $form_id, $lead_id ) { 575 // Lets use wordpress built-in function site_url576 /*$pageURL = GFCommon::is_ssl() ? 'https://' : 'http://';577 $server_port = apply_filters( 'gform_simplepayment_return_url_port', $_SERVER['SERVER_PORT'] );578 if ( $server_port != '80' && $server_port != 443) {579 $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $server_port . $_SERVER['REQUEST_URI'];580 } else {581 $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];582 }*/583 575 $pageURL = site_url( $_SERVER[ 'REQUEST_URI' ] ); 584 576 $ids_query = "ids={$form_id}|{$lead_id}"; … … 793 785 * @param array $entry The entry object currently being processed. 794 786 */ 795 $params[ 'redirect_url' ] = get_bloginfo( 'url' ) . '/?page=gf_simplepayment_ipn&entry_id=' . $entry[ 'id' ] . '&redirect_url=' . urlencode( $this->return_url( $form[ 'id' ], $entry[ 'id' ] ) ) . ( isset( $params[ 'target' ] ) && $params[ 'target' ] ? '&target=' . $params[ 'target' ] : '' );787 $params[ 'redirect_url' ] = get_bloginfo( 'url' ) . '/?page=gf_simplepayment_ipn&entry_id=' . $entry[ 'id' ] . '&redirect_url=' . urlencode( $this->return_url( $form[ 'id' ], $entry[ 'id' ] ) ) . ( isset( $params[ 'target' ] ) && $params[ 'target' ] ? '&target=' . $params[ 'target' ] : '' ); 796 788 $this->add_sp_pre_process( $feed, $submission_data, $form, $entry ); 797 789 $params = apply_filters( 'gform_simplepayment_args_before_payment', $params, $form[ 'id' ], $submission_data, $feed, $entry ); -
simple-payment/tags/2.4.1/admin/admin.php
r3318371 r3319619 56 56 } 57 57 } 58 add_action( 'admin_menu', [ $this, 'add_plugin_options_page' ] );58 //add_action( 'admin_menu', [ $this, 'add_plugin_options_page' ] ); 59 59 if ( !empty( $GLOBALS[ 'pagenow' ] ) ) { 60 60 switch ( $GLOBALS[ 'pagenow' ] ) { … … 68 68 } 69 69 } 70 71 $_active_plugins = array_merge( is_multisite() ? array_keys( get_site_option( 'active_sitewide_plugins', [] ) ) : [], get_option( 'active_plugins', [] ) ); 72 //if ( in_array( 'admin-columns-pro/admin-columns-pro.php', $_active_plugins ) ) { 73 // add_action( 'after_setup_theme', function () { 74 // require_once( SPWP_PLUGIN_DIR . '/addons/admin-columns-pro/init.php' ); 75 // } ); 76 //} 77 78 add_action( 'admin_enqueue_scripts', function () { 79 wp_enqueue_script( 'simple-payment-admin-js', plugin_dir_url( __FILE__ ) . 'script.js', [], false, true ); 80 wp_enqueue_style( 'simple-payment-admin-css', plugin_dir_url( __FILE__ ) . 'style.css', [], false ); 81 } ); 82 83 add_action( 'admin_init', [ $this, 'register_license_settings' ] ); 84 //add_action( 'sp_admin_tabs', [ $this, 'add_plugin_settings' ] ); 85 //add_filter( 'sp_admin_sections', [ $this, 'add_plugin_settings' ] ); 70 86 } 71 87 … … 177 193 'simple-payments', 178 194 [ $this, 'render_transactions' ], 179 plugin_dir_url( __FILE__ ). 'assets/simple-payment-icon.png',195 SPWP_PLUGIN_URL . 'assets/simple-payment-icon.png', 180 196 30 181 197 ); … … 463 479 ] ); 464 480 require( SPWP_PLUGIN_DIR.'/admin/transaction-list-table.php' ); 465 $list = new Transaction_List();481 $list = new Transaction_List(); // Consider using different List when using ACP - did_action( 'acp/ready' ); 466 482 } 467 483 -
simple-payment/tags/2.4.1/admin/style.css
r2176343 r3319619 1 1 .ttablenav .alignleft:nth-of-type(2n) { clear: both; } 2 pre.json {}3 2 pre.json .string { color: green; } 4 3 pre.json .number { color: darkorange; } … … 7 6 pre.json .key { color: red; } 8 7 pre.url { word-break: break-all; white-space: pre-wrap; } 8 .transaction-overview { 9 display: flex; 10 flex-wrap: wrap; 11 row-gap: 5px; 12 column-gap: 5px; 13 justify-content: space-between; 14 } 15 .transaction-item { 16 padding: 5px; 17 display: flex; 18 justify-content: space-between; 19 flex-grow: 1; 20 order: 0; 21 row-gap: 5px; 22 column-gap: 5px; 23 } 24 25 .transaction-item.item-parameters { 26 order: 100; 27 } 28 29 .transaction-item.item-redirect_url, .transaction-item.item-parameters, .transaction-item.item-user_agent { 30 flex-basis: 100%; 31 flex-direction: column; 32 } -
simple-payment/tags/2.4.1/admin/transaction-list-table.php
r3318406 r3319619 352 352 } else { 353 353 $screen = get_current_screen(); 354 //print_r( $screen ); 354 355 $per_page = get_user_meta(get_current_user_id(), $screen->get_option('per_page', 'option'), true); 355 356 $per_page = $per_page ? $per_page : $this->get_items_per_page( 'per_page', $screen->get_option('per_page', 'default')); -
simple-payment/tags/2.4.1/admin/transaction-log.php
r2448085 r3319619 13 13 ?> 14 14 <hr class="wp-header-end"> 15 <div class="transaction-overview"> 16 <?php 17 $payment = SimplePaymentPlugin::instance()->fetch( $_REQUEST[ 'id' ] ); 18 foreach( $payment as $key => $value ) { 19 if ( ! empty( $value ) ) { 20 echo '<div class="transaction-item item-' . $key . '"><strong>' . esc_html( ucfirst( $key ) ) . ':</strong> ' . ( !is_array( $value ) ? esc_html( $value ) : '<pre class="json">' . json_encode( $value ) . '</pre>' ) . '</div>'; 21 } 22 } 23 ?> 24 </div> 15 25 <?php $list->views(); ?> 16 26 <form id="transaction-logs-filter" method="get"> -
simple-payment/tags/2.4.1/engines/cardcom.php
r3318371 r3319619 16 16 }, 1000, 2 ); 17 17 18 /* 18 19 add_filter( 'sp_payment_callback', function( $url ) { 19 20 global $SPWP; 20 if ( !$SPWP::param( 'cardcom.short_urls' ) ) return ;21 if ( !$SPWP::param( 'cardcom.short_urls' ) ) return( $url ); 21 22 $uid = wp_generate_uuid4(); 22 23 set_transient( 'sp_' . $uid, $url ); // TODO: should we define expiration/ 5 days? 23 $url = add_query_arg( [24 $SPWP::OP=> $SPWP::OPERATION_REDIRECT,25 '_spr' => $uid26 ], site_url() );24 //$url = add_query_arg( [ 25 // $SPWP::SPRD => $SPWP::OPERATION_REDIRECT, 26 // '_spr' => $uid 27 //], site_url() ); 27 28 return( $url ); 28 29 }, 5000 ); 30 */ 31 32 add_filter( 'gform_simplepayment_return_url', function( $url, $form_id, $lead_id ) { 33 global $SPWP; 34 if ( !$SPWP::param( 'cardcom.short_urls' ) ) return( $url ); 35 $pageURL = site_url( '/_gf-sp' ); 36 $ids_query = "ids={$form_id}|{$lead_id}"; 37 $ids_query .= '&hash=' . wp_hash( $ids_query ); 38 $url = remove_query_arg( 'gf_simplepayment_retry', $pageURL ); 39 $url = add_query_arg( 'gf_simplepayment_return', base64_encode( $ids_query ), $url ); 40 return( $url ); 41 }, 50, 3 ); 42 29 43 30 44 add_filter( 'sp_payment_callback', function( $callback ) { -
simple-payment/tags/2.4.1/languages/simple-payment.pot
r3318406 r3319619 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Simple Payment 2. 3.9\n"5 "Project-Id-Version: Simple Payment 2.4.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/simple-payment\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-06- 26T17:29:54+00:00\n"12 "POT-Creation-Date: 2025-06-30T00:08:12+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.10.0\n" … … 17 17 #. Plugin Name of the plugin 18 18 #: simple-payment-plugin.php 19 #: addons/admin-columns-pro/classes/Service/ColumnGroup.php:20 20 #: addons/admin-columns-pro/classes/Service/ListScreens.php:19 19 21 #: addons/elementor/widget.php:31 20 22 #: addons/woocommerce/init.php:127 21 23 #: addons/woocommerce/init.php:248 22 24 #: addons/wpjobboard/config.php:8 23 #: admin/admin.php:1 6624 #: admin/admin.php:1 6725 #: admin/admin.php:182 26 #: admin/admin.php:183 25 27 msgid "Simple Payment" 26 28 msgstr "" … … 445 447 msgstr "" 446 448 447 #: addons/gravityforms/init.php:9 87449 #: addons/gravityforms/init.php:979 448 450 msgid "Payment Completed" 449 451 msgstr "" 450 452 451 #: addons/gravityforms/init.php:98 8453 #: addons/gravityforms/init.php:980 452 454 msgid "Payment Failed" 453 455 msgstr "" 454 456 455 #: addons/gravityforms/init.php:98 9457 #: addons/gravityforms/init.php:981 456 458 msgid "Subscription Created" 457 459 msgstr "" 458 460 459 #: addons/gravityforms/init.php:138 9461 #: addons/gravityforms/init.php:1381 460 462 #: addons/woocommerce/init.php:206 461 463 #: templates/form-woocommerce.php:65 … … 682 684 msgstr "" 683 685 684 #: admin/admin.php: 86686 #: admin/admin.php:102 685 687 msgid "Thanks for updating Simple Payment, you can checkout for new features and updates <a href=\"https://simple-payment.yalla-ya.com\" target=\"_blank\">here</a>." 686 688 msgstr "" 687 689 688 #: admin/admin.php: 90690 #: admin/admin.php:106 689 691 msgid "Thanks for installing Simple Payment, after your test our plugin, dont forget to get your license to process real transactions, you can do it <a href=\"https://simple-payment.yalla-ya.com\" target=\"_blank\">here</a>." 690 692 msgstr "" 691 693 692 #: admin/admin.php:1 16694 #: admin/admin.php:132 693 695 msgid "View Simple Payment documentation" 694 696 msgstr "" 695 697 696 #: admin/admin.php:1 16698 #: admin/admin.php:132 697 699 msgid "Docs" 698 700 msgstr "" 699 701 700 #: admin/admin.php:1 17702 #: admin/admin.php:133 701 703 msgid "Visit premium customer support" 702 704 msgstr "" 703 705 704 #: admin/admin.php:1 17706 #: admin/admin.php:133 705 707 msgid "Premium support" 706 708 msgstr "" 707 709 708 #: admin/admin.php:1 59709 #: admin/admin.php:3 56710 #: admin/admin.php:175 711 #: admin/admin.php:372 710 712 #: admin/settings.php:123 711 713 #: settings.php:122 … … 713 715 msgstr "" 714 716 715 #: admin/admin.php:1 74716 #: admin/admin.php:1 75717 #: admin/admin.php:190 718 #: admin/admin.php:191 717 719 #: admin/transaction-list-table.php:241 718 720 msgid "Payments" 719 721 msgstr "" 720 722 721 #: admin/admin.php: 185722 #: admin/admin.php: 186723 #: admin/admin.php:201 724 #: admin/admin.php:202 723 725 msgid "Transaction Details" 724 726 msgstr "" 725 727 726 #: admin/admin.php:2 07728 #: admin/admin.php:223 727 729 msgid "Simple Payment Settings" 728 730 msgstr "" 729 731 730 #: admin/admin.php:2 43732 #: admin/admin.php:259 731 733 msgid "License Key" 732 734 msgstr "" 733 735 734 #: admin/admin.php:4 06736 #: admin/admin.php:422 735 737 msgid "Auto" 736 738 msgstr "" 737 739 738 #: admin/admin.php:5 41740 #: admin/admin.php:557 739 741 msgid "License key is required" 740 742 msgstr "" 741 743 742 #: admin/admin.php:5 66744 #: admin/admin.php:582 743 745 msgid "License is not valid on the current domain" 744 746 msgstr "" 745 747 746 #: admin/admin.php:5 74748 #: admin/admin.php:590 747 749 msgid "License has not been activated" 748 750 msgstr "" 749 751 750 #: admin/admin.php:5 79752 #: admin/admin.php:595 751 753 msgid "License key was not found" 752 754 msgstr "" 753 755 754 #: admin/admin.php:5 83756 #: admin/admin.php:599 755 757 msgid "Unhandled error:" 756 758 msgstr "" … … 1963 1965 msgstr "" 1964 1966 1965 #: simple-payment-plugin.php:14 21967 #: simple-payment-plugin.php:144 1966 1968 msgid "Simple Payment License Error: %s" 1967 1969 msgstr "" 1968 1970 1969 #: simple-payment-plugin.php:14 21971 #: simple-payment-plugin.php:144 1970 1972 msgid "License error, or no license." 1971 1973 msgstr "" 1972 1974 1973 #: simple-payment-plugin.php:1 881975 #: simple-payment-plugin.php:190 1974 1976 msgid "Every %s Minutes" 1975 1977 msgstr "" 1976 1978 1977 #: simple-payment-plugin.php:58 41979 #: simple-payment-plugin.php:587 1978 1980 msgid "Error payment recharge" 1979 1981 msgstr "" 1980 1982 1981 #: simple-payment-plugin.php:83 31983 #: simple-payment-plugin.php:836 1982 1984 msgid "Couldn't update transaction: %s" 1983 1985 msgstr "" -
simple-payment/tags/2.4.1/readme.txt
r3318406 r3319619 4 4 Tags: credit card, simple payment, donation, membership, checkout, payment request, payment gateway, sales, woocommerce, store, ecommerce, e-commerce, commerce, gutenberg, elementor, cardcom, icount, icredit, payme, isracard, paypal 5 5 Requires at least: 4.6 6 Tested up to: 6. 6.27 Stable tag: 2.4. 06 Tested up to: 6.8.1 7 Stable tag: 2.4.1 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later … … 93 93 == Changelog == 94 94 95 = 2.3.10 = 95 = 2.4.2 = 96 *Release Date - 29 Jun 2025* 97 * Better support for Cardcom & GravityForms 98 * Security fixes 99 100 = 2.4.1 = 96 101 *Release Date - 26 Jun 2025* 97 102 * Security fix, XSS on admin. 98 99 = 2.3.9 =100 *Release Date - 26 Jun 2025*101 103 * Security and bug fixes 102 104 * Performance Improvment - Seperation of Front-end / Backend code 103 105 * Fixing issue with Woocommerce Subscriptions forcing tokens on Woocommerce Checkout 104 106 * Feature: shorten urls when Payment Gateway cannot handle standard url lengths 107 * Tested under PHP 8.4 105 108 106 109 = 2.2.2 = -
simple-payment/tags/2.4.1/simple-payment-plugin.php
r3318406 r3319619 4 4 * Plugin URI: https://simple-payment.yalla-ya.com 5 5 * Description: Simple Payment enables integration with multiple payment gateways, and customize multiple payment forms. 6 * Version: 2.4. 06 * Version: 2.4.1 7 7 * Author: Ido Kobelkowsky / yalla ya! 8 8 * Author URI: https://github.com/idokd … … 45 45 46 46 public static $table_name = 'sp_transactions'; 47 public static $table_name_metadata = 'sp_transactions_metadata'; 48 47 49 public static $engines = [ 'PayPal', 'Cardcom', 'iCount', 'PayMe', 'iCredit', 'CreditGuard', 'Meshulam', 'YaadPay', 'Credit2000', 'Custom' ]; 48 50 … … 275 277 $status = false; 276 278 if ( $code = parent::status( array_merge( $data, $params ) ) ) { 279 $params[ 'confirmation_code' ] = $code; 277 280 $status = self::update( $this->payment_id ? : $this->engine->transaction, [ 278 281 'status' => self::TRANSACTION_SUCCESS, … … 838 841 } 839 842 843 public function get_entry( $id, $engine = null ){ 844 return( $this->fetch( $id, $engine ) ); 845 } 840 846 841 847 public function fetch( $id, $engine = null ) { … … 1030 1036 require_once( 'addons/gravityforms/init.php' ); 1031 1037 1032 1033 1038 //require_once('addons/recaptcha/init.php'); 1034 1039 -
simple-payment/tags/2.4.1/vendor/autoload.php
r3318371 r3319619 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 -
simple-payment/tags/2.4.1/vendor/composer/InstalledVersions.php
r3318371 r3319619 28 28 { 29 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 30 36 * @var mixed[]|null 31 37 * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null 32 38 */ 33 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 34 45 35 46 /** … … 310 321 self::$installed = $data; 311 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 312 341 } 313 342 … … 323 352 324 353 $installed = array(); 354 $copiedLocalDir = false; 325 355 326 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 327 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 328 360 if (isset(self::$installedByVendor[$vendorDir])) { 329 361 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 363 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 332 364 $required = require $vendorDir.'/composer/installed.php'; 333 $installed[] = self::$installedByVendor[$vendorDir] = $required; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 336 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 337 374 } 338 375 } … … 351 388 } 352 389 353 if (self::$installed !== array() ) {390 if (self::$installed !== array() && !$copiedLocalDir) { 354 391 $installed[] = self::$installed; 355 392 } -
simple-payment/tags/2.4.1/vendor/composer/installed.php
r3318371 r3319619 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 8d70fa9f086df134f54cc8e70526cb888ea9b265',6 'reference' => '59fc00a8805a5e2566813aaee5fd97f5dada586c', 7 7 'type' => 'project', 8 8 'install_path' => __DIR__ . '/../../', … … 70 70 'pretty_version' => 'dev-master', 71 71 'version' => 'dev-master', 72 'reference' => ' 8d70fa9f086df134f54cc8e70526cb888ea9b265',72 'reference' => '59fc00a8805a5e2566813aaee5fd97f5dada586c', 73 73 'type' => 'project', 74 74 'install_path' => __DIR__ . '/../../', -
simple-payment/tags/2.4.1/vendor/yalla-ya/simple-payment/Engines/Cardcom.php
r3318371 r3319619 7 7 use DateInterval; 8 8 9 if (!defined("ABSPATH") ) {9 if (!defined("ABSPATH") ) { 10 10 exit; // Exit if accessed directly 11 11 } … … 49 49 const OPERATIONS = [ 1 => 'Charge', 2 => 'Charge & Token', 3 => 'Token (Charge Pending)', 4 => 'Suspended Deal' ]; 50 50 const DOC_TYPES = [ 1 => 'Invoice', 3 => 'Formal Receipt', 101 => 'Order Confirmation', 400 => 'Receipt' , 405 => 'Donation' ]; 51 const FIELD_STATUS = [ 'require' => 'Shown & Required', 'show' => 'Shown', 'hide' => 'Hidden' ];52 const CREDIT_TYPES = [ 1 => 'Normal', 6 => 'Credit' ];53 const DOC_OPERATIONS = [ 0 => 'No Invoice', 1 => 'Invoice', 2 => 'Forward (Do not show)' ];51 const FIELD_STATUS = [ 'require' => 'Shown & Required', 'show' => 'Shown', 'hide' => 'Hidden' ]; 52 const CREDIT_TYPES = [ 1 => 'Normal', 6 => 'Credit' ]; 53 const DOC_OPERATIONS = [ 0 => 'No Invoice', 1 => 'Invoice', 2 => 'Forward (Do not show)' ]; 54 54 55 55 public function __construct( $params = null, $handler = null, $sandbox = true ) { … … 59 59 60 60 public function process( $params ) { 61 //header("Location: ".$params[ 'url']);61 //header("Location: ".$params[ 'url' ]); 62 62 //return(true); 63 63 return( $params[ 'url' ] ); … … 74 74 $post[ 'username' ] = $this->username; 75 75 } 76 //$post[ 'terminalnumber'] = $this->terminal;77 //$post[ 'username'] = $this->username;76 //$post[ 'terminalnumber' ] = $this->terminal; 77 //$post[ 'username' ] = $this->username; 78 78 $post[ 'lowprofilecode' ] = $this->transaction; 79 79 $post[ 'codepage' ] = 65001; … … 106 106 'transaction_id' => $this->transaction, 107 107 'url' => $this->api[ 'indicator_request' ], 108 'status' => isset( $response[ 'OperationResponse' ] ) ? $response[ 'OperationResponse' ] : ( isset( $response[ 'DealResponse' ] ) ? $response[ 'DealResponse' ] : '' ),108 'status' => isset( $response[ 'OperationResponse' ] ) ? $response[ 'OperationResponse' ] : ( isset( $response[ 'DealResponse' ] ) ? $response[ 'DealResponse' ] : '' ), 109 109 'description' => isset( $response[ 'OperationResponseText' ] ) ? $response[ 'OperationResponseText' ] : $response[ 'Description' ], 110 110 'request' => json_encode( $post ), … … 117 117 switch( intval( $operation ) ) { 118 118 case 1: 119 $code = $response[ ' DealResponse' ];120 if ( isset( $response[ 'OperationResponse' ] ) && $response[ 'OperationResponse' ] == '0' && isset( $response[ 'DealResponse' ] ) && $response[ 'DealResponse'] == '0' ) {119 $code = $response[ 'InternalDealNumber' ]; 120 if ( isset( $response[ 'OperationResponse' ] ) && $response[ 'OperationResponse' ] == '0' && isset( $response[ 'DealResponse' ] ) && $response[ 'DealResponse' ] == '0' ) { 121 121 $this->confirmation_code = $code; 122 122 } … … 125 125 case 2: 126 126 $code = $response[ 'TokenResponse' ]; 127 if ( isset( $response[ 'OperationResponse' ] ) && $response[ 'OperationResponse' ] == '0' && isset( $response[ 'DealResponse' ] ) && $response[ 'DealResponse' ] == '0' && isset( $response[ 'TokenResponse' ] ) && $response[ 'TokenResponse' ] == '0' ) {127 if ( isset( $response[ 'OperationResponse' ] ) && $response[ 'OperationResponse' ] == '0' && isset( $response[ 'DealResponse' ] ) && $response[ 'DealResponse' ] == '0' && isset( $response[ 'TokenResponse' ] ) && $response[ 'TokenResponse' ] == '0' ) { 128 128 $this->confirmation_code = $code; 129 129 } … … 149 149 'url' => ':callback', 150 150 'status' => isset( $params[ 'ResposeCode' ] ) ? $params[ 'ResposeCode' ] : $params[ 'ResponseCode' ], 151 'description' => isset( $params[ 'OperationResponseText' ] ) ? $params[ 'OperationResponseText ' ] : $params['Description'],151 'description' => isset( $params[ 'OperationResponseText' ] ) ? $params[ 'OperationResponseText ' ] : $params[ 'Description' ], 152 152 'request' => json_encode( $params ), 153 153 'response' => null … … 156 156 } 157 157 158 public function status( $params) {159 parent::status( $params);160 $this->transaction = $params[ 'lowprofilecode'];161 $this->save( [158 public function status( $params ) { 159 parent::status( $params ); 160 $this->transaction = $params[ 'lowprofilecode' ]; 161 $this->save( [ 162 162 'transaction_id' => $this->transaction, 163 'url' => $_SERVER[ "REQUEST_URI"],164 'status' => isset( $params['OperationResponse']) ? $params['OperationResponse'] : $params['DealResponse'],165 'description' => isset( $params['OperationResponseText']) ? $params['OperationResponseText'] : $params['Description'],166 'request' => json_encode( $_REQUEST),163 'url' => $_SERVER[ 'REQUEST_URI' ], 164 'status' => isset( $params[ 'OperationResponse' ] ) ? $params[ 'OperationResponse' ] : $params[ 'DealResponse' ], 165 'description' => isset( $params[ 'OperationResponseText' ] ) ? $params[ 'OperationResponseText' ] : $params[ 'Description' ], 166 'request' => json_encode( $_REQUEST ), 167 167 'response' => null 168 ] );168 ] ); 169 169 $post = []; 170 170 if ( !$this->sandbox ) { 171 $post[ 'terminalnumber'] = $this->param_part($params);172 $post[ 'username'] = $this->param_part($params, 'username');171 $post[ 'terminalnumber' ] = $this->param_part( $params ); 172 $post[ 'username' ] = $this->param_part( $params, 'username' ); 173 173 } else { 174 $post[ 'terminalnumber'] = $this->terminal;175 $post[ 'username'] = $this->username;176 } 177 $post[ 'lowprofilecode'] = $params['lowprofilecode'];178 $status = $this->post( $this->api['indicator_request'], $post);179 parse_str( $status, $status);180 //$this->transaction = $params[ 'lowprofilecode'];174 $post[ 'terminalnumber' ] = $this->terminal; 175 $post[ 'username' ] = $this->username; 176 } 177 $post[ 'lowprofilecode' ] = $params[ 'lowprofilecode' ]; 178 $status = $this->post( $this->api[ 'indicator_request' ], $post); 179 parse_str( $status, $status ); 180 //$this->transaction = $params[ 'lowprofilecode' ]; 181 181 182 182 // TODO: fetch VISA, YEAR, MONTH, ID??? … … 184 184 if ( isset( $status[ 'Token' ] ) && $status[ 'Token' ] ) { 185 185 $token = [ 186 'token' => $status[ 'Token'],187 SimplePayment::CARD_OWNER => $status[ 'CardOwnerID'],188 SimplePayment::CARD_EXPIRY_YEAR => $status[ 'CardValidityYear'],189 SimplePayment::CARD_EXPIRY_MONTH => $status[ 'CardValidityMonth'],186 'token' => $status[ 'Token' ], 187 SimplePayment::CARD_OWNER => $status[ 'CardOwnerID' ], 188 SimplePayment::CARD_EXPIRY_YEAR => $status[ 'CardValidityYear' ], 189 SimplePayment::CARD_EXPIRY_MONTH => $status[ 'CardValidityMonth' ], 190 190 // 'card_type' => '', 191 'expiry' => $status[ 'TokenExDate'],191 'expiry' => $status[ 'TokenExDate' ], 192 192 ]; 193 193 } 194 194 $response = $status; 195 195 $this->confirmation_code = isset( $response[ 'InternalDealNumber' ] ) ? $response[ 'InternalDealNumber' ] : null; 196 $this->save( [196 $this->save( [ 197 197 'transaction_id' => $this->transaction, 198 'url' => $this->api[ 'indicator_request'],199 'status' => isset( $response['OperationResponse']) ? $response['OperationResponse'] : $response['DealResponse'],200 'description' => isset( $response['OperationResponseText']) ? $response['OperationResponseText'] : $response['Description'],201 'request' => json_encode( $post),202 'response' => json_encode( $response),198 'url' => $this->api[ 'indicator_request' ], 199 'status' => isset( $response[ 'OperationResponse' ] ) ? $response[ 'OperationResponse' ] : $response[ 'DealResponse' ], 200 'description' => isset( $response[ 'OperationResponseText' ] ) ? $response[ 'OperationResponseText' ] : $response[ 'Description' ], 201 'request' => json_encode( $post ), 202 'response' => json_encode( $response ), 203 203 'token' => $token 204 ] );205 if ( !isset($response['OperationResponse']) || $response['OperationResponse'] != 0) {206 throw new Exception( isset($response['OperationResponseText']) ? $response['OperationResponseText'] : $response['Description'], isset($response['OperationResponse']) ? $response['OperationResponse'] : $response['DealResponse']);207 } 208 if ( $params['Operation'] == 2 && isset($params['payments']) && $params['payments'] == "monthly") {209 if ( $this->param('recurr_at') == 'status' && $this->param('reurring') == 'provider') $this->recur_by_provider($params);204 ] ); 205 if ( !isset( $response[ 'OperationResponse' ]) || $response[ 'OperationResponse' ] != 0 ) { 206 throw new Exception( isset( $response[ 'OperationResponseText' ] ) ? $response[ 'OperationResponseText' ] : $response[ 'Description' ], isset( $response[ 'OperationResponse' ] ) ? $response[ 'OperationResponse' ] : $response[ 'DealResponse' ] ); 207 } 208 if ( $params[ 'Operation' ] == 2 && isset( $params[ 'payments' ] ) && $params[ 'payments' ] == 'monthly' ) { 209 if ( $this->param( 'recurr_at' ) == 'status' && $this->param( 'reurring' ) == 'provider' ) $this->recur_by_provider( $params ); 210 210 } 211 211 return( $this->confirmation_code ); … … 213 213 214 214 public function post_process($params) { 215 $this->transaction = isset( $_REQUEST[ 'lowprofilecode'] ) ? $_REQUEST['lowprofilecode'] : $params[ 'transaction_id' ];215 $this->transaction = isset( $_REQUEST[ 'lowprofilecode' ] ) ? $_REQUEST[ 'lowprofilecode' ] : $params[ 'transaction_id' ]; 216 216 $response = $_REQUEST; 217 217 $this->save([ 218 218 'transaction_id' => $this->transaction, 219 219 'url' => ':post_process', 220 'status' => isset($response[ 'ResponseCode']) ? $response['ResponseCode'] : $response['response_code'],221 'description' => isset($response[ 'Description']) ? $response['Description'] : null,220 'status' => isset($response[ 'ResponseCode' ]) ? $response[ 'ResponseCode' ] : $response[ 'response_code' ], 221 'description' => isset($response[ 'Description' ]) ? $response[ 'Description' ] : null, 222 222 'request' => json_encode($params), 223 223 'response' => json_encode($response) 224 224 ]); 225 if ($params[ 'Operation'] == 2 && isset($params['payments']) && $params['payments'] == "monthly") {226 if ($this->param( 'recurr_at') == 'post' && $this->param('reurring') == 'provider') return($this->recur_by_provider($params));225 if ($params[ 'Operation' ] == 2 && isset($params[ 'payments' ]) && $params[ 'payments' ] == "monthly") { 226 if ($this->param( 'recurr_at' ) == 'post' && $this->param( 'reurring' ) == 'provider' ) return($this->recur_by_provider($params) ); 227 227 } 228 228 // TODO: update confirmation code con status 229 //$this->confirmation_code = $response[ 'confirmation_code'];229 //$this->confirmation_code = $response[ 'confirmation_code' ]; 230 230 return( $_REQUEST[ 'ResponeCode' ] == 0 ); 231 231 } … … 254 254 $post[ 'APILevel' ] = $this->api[ 'version' ]; 255 255 if ( !$this->sandbox ) { 256 $post[ 'TerminalNumber' ] = $this->param_part( $params );257 $post[ 'UserName' ] = $this->param_part( $params, 'username' );258 // $this->password = $this->param_part($params, 'password' );259 // $post[ 'Password'] = $this->password;256 $post[ 'TerminalNumber' ] = $this->param_part( $params ); 257 $post[ 'UserName' ] = $this->param_part( $params, 'username' ); 258 // $this->password = $this->param_part($params, 'password' ); 259 // $post[ 'Password' ] = $this->password; 260 260 } else { 261 261 $post[ 'TerminalNumber' ] = $this->terminal; … … 271 271 272 272 273 $post[ 'ProductName'] = $params['product'];274 $post[ 'SumToBill'] = $params['amount'];275 276 if (isset($params[SimplePayment::CARD_OWNER]) && $params[SimplePayment::CARD_OWNER]) $post[ 'CardOwnerName'] = $params[SimplePayment::CARD_OWNER];277 if (!isset($post[ 'CardOwnerName']) && isset($params['full_name']) && $params['full_name']) $post['CardOwnerName'] = $params['full_name']; // card_holder278 279 if (isset($params[ 'phone']) && $params['phone']) $post['CardOwnerPhone'] = $params['phone'];280 if (isset($params[ 'email']) && $params['email']) $post['CardOwnerEmail'] = $params['email'];281 282 if (isset($params[ 'payment_id']) && $params['payment_id']) $post['ReturnValue'] = $params['payment_id'];283 284 $post[ 'codepage'] = 65001; // Codepage fixed to enable hebrew285 $currency = isset( $params[SimplePayment::CURRENCY]) && $params[SimplePayment::CURRENCY] ? $params[SimplePayment::CURRENCY] : $this->param('currency');286 if ( $currency) {287 if ( $currency = self::CURRENCIES[$currency]) $post['CoinID'] = $currency;288 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500);289 } 290 291 $language = isset( $params['language']) ? $params['language'] : $this->param('language');292 if ($language != '' ) $post['Language'] = $language;273 $post[ 'ProductName' ] = $params[ 'product' ]; 274 $post[ 'SumToBill' ] = $params[ 'amount' ]; 275 276 if (isset($params[SimplePayment::CARD_OWNER]) && $params[SimplePayment::CARD_OWNER]) $post[ 'CardOwnerName' ] = $params[SimplePayment::CARD_OWNER]; 277 if (!isset($post[ 'CardOwnerName' ]) && isset($params[ 'full_name' ]) && $params[ 'full_name' ]) $post[ 'CardOwnerName' ] = $params[ 'full_name' ]; // card_holder 278 279 if (isset($params[ 'phone' ]) && $params[ 'phone' ]) $post[ 'CardOwnerPhone' ] = $params[ 'phone' ]; 280 if (isset($params[ 'email' ]) && $params[ 'email' ]) $post[ 'CardOwnerEmail' ] = $params[ 'email' ]; 281 282 if (isset($params[ 'payment_id' ]) && $params[ 'payment_id' ]) $post[ 'ReturnValue' ] = $params[ 'payment_id' ]; 283 284 $post[ 'codepage' ] = 65001; // Codepage fixed to enable hebrew 285 $currency = isset( $params[ SimplePayment::CURRENCY ] ) && $params[ SimplePayment::CURRENCY ] ? $params[ SimplePayment::CURRENCY ] : $this->param( 'currency' ); 286 if ( $currency ) { 287 if ( $currency = self::CURRENCIES[ $currency ] ) $post[ 'CoinID' ] = $currency; 288 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500 ); 289 } 290 291 $language = isset( $params[ 'language' ] ) ? $params[ 'language' ] : $this->param( 'language' ); 292 if ($language != '' ) $post[ 'Language' ] = $language; 293 293 294 294 if ( !isset( $params[ 'payments' ] ) || ( isset( $params[ 'payments' ] ) && $params[ 'payments' ] ) ) { … … 302 302 } 303 303 304 $post[ 'SuccessRedirectUrl'] = $this->url(SimplePayment::OPERATION_SUCCESS, $params);305 $post[ 'ErrorRedirectUrl'] = $this->url(SimplePayment::OPERATION_ERROR, $params);306 $post[ 'IndicatorUrl'] = $this->url(SimplePayment::OPERATION_STATUS, $params);307 $post[ 'CancelUrl'] = $this->url(SimplePayment::OPERATION_CANCEL, $params);308 if ( $this->param('css') != '') $post[ 'CSSUrl' ] = $this->callback.(strpos($this->callback, '?') !== false ? '&' : '?').'op=css';309 310 $post[ 'CancelType'] = $this->cancelType;311 312 $creditType = $this->param( 'credit_type');313 if ( $creditType != '') $post['CreditType'] = $creditType;314 315 $show = $this->param( 'show_invoice_operation');316 if ( $operation != 3 && $show != '') $post['InvoiceHeadOperation'] = $operation == 3 ? 0 : $show;317 318 $show = $this->param( 'show_invoice_info');319 if ( $operation != 3 && $show != '') $post['ShowInvoiceHead'] = $show;320 321 $docType = $this->param( 'doc_type');322 if ( $operation != 3 && $docType != '') $post['DocTypeToCreate'] = $docType;323 324 $field = $this->param( 'field_name');325 if ( $field != '') {326 $post[ 'HideCardOwnerName'] = $field == 'hide' ? 'true' : 'false';327 } 328 329 $field = $this->param( 'field_phone');330 if ( $field != '') {331 $post[ 'ReqCardOwnerPhone'] = $field == 'require' ? 'true' : 'false';332 $post[ 'ShowCardOwnerPhone'] = $field == 'show' || $field == 'require' ? 'true' : 'false';333 } 334 335 $field = $this->param( 'field_email');336 if ( $field != '') {337 $post[ 'ReqCardOwnerEmail'] = $field == 'require' ? 'true' : 'false';338 $post[ 'ShowCardOwnerEmail'] = $field == 'show' || $field == 'require' ? 'true' : 'false';304 $post[ 'SuccessRedirectUrl' ] = $this->url( SimplePayment::OPERATION_SUCCESS, $params ); 305 $post[ 'ErrorRedirectUrl' ] = $this->url( SimplePayment::OPERATION_ERROR, $params ); 306 $post[ 'IndicatorUrl' ] = $this->url( SimplePayment::OPERATION_STATUS, $params ); 307 $post[ 'CancelUrl' ] = $this->url( SimplePayment::OPERATION_CANCEL, $params ); 308 if ( $this->param( 'css' ) != '' ) $post[ 'CSSUrl' ] = $this->callback . ( strpos( $this->callback, '?' ) !== false ? '&' : '?' ) . 'op=css'; 309 310 $post[ 'CancelType' ] = $this->cancelType; 311 312 $creditType = $this->param( 'credit_type' ); 313 if ( $creditType != '' ) $post[ 'CreditType' ] = $creditType; 314 315 $show = $this->param( 'show_invoice_operation' ); 316 if ( $operation != 3 && $show != '' ) $post[ 'InvoiceHeadOperation' ] = $operation == 3 ? 0 : $show; 317 318 $show = $this->param( 'show_invoice_info' ); 319 if ( $operation != 3 && $show != '' ) $post[ 'ShowInvoiceHead' ] = $show; 320 321 $docType = $this->param( 'doc_type' ); 322 if ( $operation != 3 && $docType != '' ) $post[ 'DocTypeToCreate' ] = $docType; 323 324 $field = $this->param( 'field_name' ); 325 if ( $field != '' ) { 326 $post[ 'HideCardOwnerName' ] = $field == 'hide' ? 'true' : 'false'; 327 } 328 329 $field = $this->param( 'field_phone' ); 330 if ( $field != '' ) { 331 $post[ 'ReqCardOwnerPhone' ] = $field == 'require' ? 'true' : 'false'; 332 $post[ 'ShowCardOwnerPhone' ] = $field == 'show' || $field == 'require' ? 'true' : 'false'; 333 } 334 335 $field = $this->param( 'field_email' ); 336 if ( $field != '' ) { 337 $post[ 'ReqCardOwnerEmail' ] = $field == 'require' ? 'true' : 'false'; 338 $post[ 'ShowCardOwnerEmail' ] = $field == 'show' || $field == 'require' ? 'true' : 'false'; 339 339 } 340 340 341 if ( (!isset($params['payments']) || $params['payments'] != "monthly") && $this->param('hide_user_id')) $post['HideCreditCardUserId'] = $this->param('hide_user_id') == 'true' ? 'true' : 'false';342 343 if ( $operation != 3 && isset($params['company']) && $params['company']) $post['InvoiceHead.CustName'] = $params['company'];344 if ( $operation != 3 && !isset($post['InvoiceHead.CustName']) && isset($params['full_name']) && $params['full_name']) $post['InvoiceHead.CustName'] = $params['full_name'];345 if ( $operation != 3) $post = array_merge($post, $this->document(array_merge($params, ['language' => $language, 'currency' => $currency])));341 if ( ( !isset( $params[ 'payments' ]) || $params[ 'payments' ] != "monthly" ) && $this->param( 'hide_user_id' ) ) $post[ 'HideCreditCardUserId' ] = $this->param( 'hide_user_id' ) == 'true' ? 'true' : 'false'; 342 343 if ( $operation != 3 && isset( $params[ 'company' ]) && $params[ 'company' ]) $post[ 'InvoiceHead.CustName' ] = $params[ 'company' ]; 344 if ( $operation != 3 && !isset( $post[ 'InvoiceHead.CustName' ]) && isset( $params[ 'full_name' ]) && $params[ 'full_name' ]) $post[ 'InvoiceHead.CustName' ] = $params[ 'full_name' ]; 345 if ( $operation != 3 ) $post = array_merge( $post, $this->document( array_merge( $params, [ 'language' => $language, 'currency' => $currency ] ) )); 346 346 347 347 // TODO: Analyze how to use those parameters … … 365 365 // SuspendedDealJValidateType 366 366 // SuspendedDealGroup 367 $status = $this->post( $this->api['payment_request'], $post);368 parse_str( $status, $status);369 $status[ 'url'] = $this->param('method') == 'paypal' ? $status['PayPalUrl'] : $status['url'];370 $this->transaction = $this->transaction ? : $status[ 'LowProfileCode'];367 $status = $this->post( $this->api[ 'payment_request' ], $post ); 368 parse_str( $status, $status ); 369 $status[ 'url' ] = $this->param( 'method' ) == 'paypal' ? $status[ 'PayPalUrl' ] : $status[ 'url' ]; 370 $this->transaction = $this->transaction ? : $status[ 'LowProfileCode' ]; 371 371 $response = $status; 372 $this->save( [372 $this->save( [ 373 373 'transaction_id' => $this->transaction, 374 'url' => $this->api[ 'payment_request'],375 'status' => isset( $response['ResponseCode']) ? $response['ResponseCode'] : $response['response_code'],376 'description' => isset( $response['Description']) ? $response['Description'] : null,377 'request' => json_encode( $post),378 'response' => json_encode( $response)379 ] );380 if ( isset($status['LowProfileCode']) && $status['LowProfileCode']) $this->transaction = $status['LowProfileCode'];381 if ( isset($status['ResponseCode']) && $status['ResponseCode'] != 0) {382 throw new Exception( $status['Description'], $status['ResponseCode']);383 } 384 return( $response);374 'url' => $this->api[ 'payment_request' ], 375 'status' => isset( $response[ 'ResponseCode' ]) ? $response[ 'ResponseCode' ] : $response[ 'response_code' ], 376 'description' => isset( $response[ 'Description' ]) ? $response[ 'Description' ] : null, 377 'request' => json_encode( $post ), 378 'response' => json_encode( $response ) 379 ] ); 380 if ( isset( $status[ 'LowProfileCode' ] ) && $status[ 'LowProfileCode' ] ) $this->transaction = $status[ 'LowProfileCode' ]; 381 if ( isset( $status[ 'ResponseCode' ] ) && $status[ 'ResponseCode' ] != 0 ) { 382 throw new Exception( $status[ 'Description' ], $status[ 'ResponseCode' ] ); 383 } 384 return( $response ); 385 385 } 386 386 … … 389 389 390 390 if (!$this->sandbox) { 391 $post[ 'TerminalNumber'] = $this->param_part($params);392 $post[ 'UserName'] = $this->param_part($params, 'username');393 $terminals = $this->param( 'terminal');394 $terminals = explode( ';', $terminals);391 $post[ 'TerminalNumber' ] = $this->param_part($params); 392 $post[ 'UserName' ] = $this->param_part($params, 'username' ); 393 $terminals = $this->param( 'terminal' ); 394 $terminals = explode( ';', $terminals); 395 395 } else { 396 $post[ 'TerminalNumber'] = $this->terminal;397 $post[ 'UserName'] = $this->username;398 } 399 400 if ($this->param( 'recurring_terminal')) $post['RecurringPayments.ChargeInTerminal'] = $this->param('recurring_terminal');401 $post[ 'Operation'] = $this->param('reurring_operation');402 $post[ 'LowProfileDealGuid'] = isset($params['lowprofilecode']) ? $params['lowprofilecode'] : $params['transaction_id'];396 $post[ 'TerminalNumber' ] = $this->terminal; 397 $post[ 'UserName' ] = $this->username; 398 } 399 400 if ($this->param( 'recurring_terminal' ) ) $post[ 'RecurringPayments.ChargeInTerminal' ] = $this->param( 'recurring_terminal' ); 401 $post[ 'Operation' ] = $this->param( 'reurring_operation' ); 402 $post[ 'LowProfileDealGuid' ] = isset($params[ 'lowprofilecode' ]) ? $params[ 'lowprofilecode' ] : $params[ 'transaction_id' ]; 403 403 404 if ($this->param( 'department_id')) $post['RecurringPayments.DepartmentId'] = $this->param('department_id');405 //if (isset($params[ 'payment_id']) && $params['payment_id']) $post['Account.SiteUniqueId'] = $params['payment_id'];406 407 if (isset($params[ 'payment_id']) && $params['payment_id']) $post['RecurringPayments.ReturnValue'] = $params['payment_id'];408 409 $post[ 'RecurringPayments.FlexItem.Price'] = $params['amount'];410 $post[ 'RecurringPayments.FlexItem.InvoiceDescription'] = isset($params['product']) ? $params['product'] : $params['concept'];411 $post[ 'RecurringPayments.InternalDecription'] = isset($params['product']) ? $params['product'] : $params['concept'];404 if ($this->param( 'department_id' ) ) $post[ 'RecurringPayments.DepartmentId' ] = $this->param( 'department_id' ); 405 //if (isset($params[ 'payment_id' ]) && $params[ 'payment_id' ]) $post[ 'Account.SiteUniqueId' ] = $params[ 'payment_id' ]; 406 407 if (isset($params[ 'payment_id' ]) && $params[ 'payment_id' ]) $post[ 'RecurringPayments.ReturnValue' ] = $params[ 'payment_id' ]; 408 409 $post[ 'RecurringPayments.FlexItem.Price' ] = $params[ 'amount' ]; 410 $post[ 'RecurringPayments.FlexItem.InvoiceDescription' ] = isset($params[ 'product' ]) ? $params[ 'product' ] : $params[ 'concept' ]; 411 $post[ 'RecurringPayments.InternalDecription' ] = isset($params[ 'product' ]) ? $params[ 'product' ] : $params[ 'concept' ]; 412 412 413 413 if (isset($params[SimplePayment::CARD_OWNER]) && $params[SimplePayment::CARD_OWNER]) { 414 $post[ 'Account.ContactName'] = $params[SimplePayment::CARD_OWNER];415 } 416 if (!isset($post[ 'CardOwnerName']) && isset($params['full_name']) && $params['full_name']) {417 $post[ 'Account.ContactName'] = $params['full_name']; // card_holder418 } 419 420 if (isset($params[ 'first_name']) && $params['first_name']) $post['Account.FirstName'] = $params['first_name'];421 if (isset($params[ 'last_name']) && $params['last_name']) $post['Account.FirstName'] = (isset($post['Account.FirstName']) && $post['Account.FirstName'] ? ' ' : '').$params['last_name'];422 423 if (isset($params[ 'phone']) && $params['phone']) $post['Account.PhLine'] = $params['phone'];424 if (isset($params[ 'mobile']) && $params['mobile']) $post['Account.PhMobile'] = $params['mobile'];425 if (isset($params[ 'email']) && $params['email']) $post['Account.Email'] = $params['email'];426 427 if (isset($params[ 'address']) && $params['address']) $post['Account.Street1'] = $params['address'];428 if (isset($params[ 'address2']) && $params['address2']) $post['Account.Street2'] = $params['address2'];429 if (isset($params[ 'zipcode']) && $params['zipcode']) $post['Account.ZipCode'] = $params['zipcode'];430 if (isset($params[ 'city']) && $params['city']) $post['Account.City'] = $params['city'];431 432 if (isset($params[ 'comment']) && $params['comment']) $post['Account.Comments'] = $params['comment'];433 434 if (isset($params[ 'tax_id']) && $params['tax_id']) $post['Account.RegisteredBusinessNumber'] = $params['tax_id'];435 436 if ($this->param( 'vat_free')) $post['Account.VatFree'] = 'true';437 438 $language = isset($params[ 'language']) ? $params['language'] : $this->param('language');439 if ($language != '' ) $post['Account.IsDocumentLangEnglish'] = $language == 'he' ? 'false' : 'true';440 441 $currency = isset($params[ 'currency']) && $params['currency'] ? $params['currency'] : $this->param('currency');442 if ($currency != '' ) {443 if ($currency = self::CURRENCIES[$currency]) $post[ 'RecurringPayments.FinalDebitCoinId'] = $currency;444 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500);445 } 446 447 $post[ 'codepage'] = 65001; // Codepage fixed to enable hebrew414 $post[ 'Account.ContactName' ] = $params[SimplePayment::CARD_OWNER]; 415 } 416 if (!isset($post[ 'CardOwnerName' ]) && isset($params[ 'full_name' ]) && $params[ 'full_name' ]) { 417 $post[ 'Account.ContactName' ] = $params[ 'full_name' ]; // card_holder 418 } 419 420 if (isset($params[ 'first_name' ]) && $params[ 'first_name' ]) $post[ 'Account.FirstName' ] = $params[ 'first_name' ]; 421 if (isset($params[ 'last_name' ]) && $params[ 'last_name' ]) $post[ 'Account.FirstName' ] = (isset($post[ 'Account.FirstName' ]) && $post[ 'Account.FirstName' ] ? ' ' : '' ).$params[ 'last_name' ]; 422 423 if (isset($params[ 'phone' ]) && $params[ 'phone' ]) $post[ 'Account.PhLine' ] = $params[ 'phone' ]; 424 if (isset($params[ 'mobile' ]) && $params[ 'mobile' ]) $post[ 'Account.PhMobile' ] = $params[ 'mobile' ]; 425 if (isset($params[ 'email' ]) && $params[ 'email' ]) $post[ 'Account.Email' ] = $params[ 'email' ]; 426 427 if (isset($params[ 'address' ]) && $params[ 'address' ]) $post[ 'Account.Street1' ] = $params[ 'address' ]; 428 if (isset($params[ 'address2' ]) && $params[ 'address2' ]) $post[ 'Account.Street2' ] = $params[ 'address2' ]; 429 if (isset($params[ 'zipcode' ]) && $params[ 'zipcode' ]) $post[ 'Account.ZipCode' ] = $params[ 'zipcode' ]; 430 if (isset($params[ 'city' ]) && $params[ 'city' ]) $post[ 'Account.City' ] = $params[ 'city' ]; 431 432 if (isset($params[ 'comment' ]) && $params[ 'comment' ]) $post[ 'Account.Comments' ] = $params[ 'comment' ]; 433 434 if (isset($params[ 'tax_id' ]) && $params[ 'tax_id' ]) $post[ 'Account.RegisteredBusinessNumber' ] = $params[ 'tax_id' ]; 435 436 if ($this->param( 'vat_free' ) ) $post[ 'Account.VatFree' ] = 'true'; 437 438 $language = isset($params[ 'language' ]) ? $params[ 'language' ] : $this->param( 'language' ); 439 if ($language != '' ) $post[ 'Account.IsDocumentLangEnglish' ] = $language == 'he' ? 'false' : 'true'; 440 441 $currency = isset($params[ 'currency' ]) && $params[ 'currency' ] ? $params[ 'currency' ] : $this->param( 'currency' ); 442 if ($currency != '' ) { 443 if ($currency = self::CURRENCIES[$currency]) $post[ 'RecurringPayments.FinalDebitCoinId' ] = $currency; 444 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500); 445 } 446 447 $post[ 'codepage' ] = 65001; // Codepage fixed to enable hebrew 448 448 // month from now 28 days 449 449 $date = new DateTime(); 450 $date->add(new DateInterval( 'P28D')); // P1D means a period of 28 day451 $post[ 'RecurringPayments.NextDateToBill'] = $date->format('d/m/Y');450 $date->add(new DateInterval( 'P28D' ) ); // P1D means a period of 28 day 451 $post[ 'RecurringPayments.NextDateToBill' ] = $date->format( 'd/m/Y' ); 452 452 453 453 $limit = $this->param( 'recurring_total' ); 454 $post[ 'RecurringPayments.TotalNumOfBills'] = $limit ? : 999999;455 456 $interval = $this->param( 'recurring_interval');457 if ($interval) $post[ 'TimeIntervalId'] = $interval;454 $post[ 'RecurringPayments.TotalNumOfBills' ] = $limit ? : 999999; 455 456 $interval = $this->param( 'recurring_interval' ); 457 if ($interval) $post[ 'TimeIntervalId' ] = $interval; 458 458 459 $docType = $this->param( 'doc_type');460 if ($docType != '' ) $post['RecurringPayments.DocTypeToCreate'] = $docType;461 462 $post[ 'RecurringPayments.FlexItem.IsPriceIncludeVat'] = 'true'; // Must be true - API requirement459 $docType = $this->param( 'doc_type' ); 460 if ($docType != '' ) $post[ 'RecurringPayments.DocTypeToCreate' ] = $docType; 461 462 $post[ 'RecurringPayments.FlexItem.IsPriceIncludeVat' ] = 'true'; // Must be true - API requirement 463 463 // TODO: assure to verifiy first_name / lasstname or use full name 464 if (isset($params[ 'full_name']) && trim($params['full_name'])) $post['Account.CompanyName'] = trim($params['full_name']);465 if (!isset($post[ 'Account.CompanyName']) && isset($params['first_name']) && trim($params['first_name'])) $post['Account.CompanyName'] = trim($params['first_name'].(isset($params['last_name']) ? ' '.$params['last_name'] : ''));466 if (!isset($post[ 'Account.CompanyName']) && isset($params['last_name']) && trim($params['last_name'])) $post['Account.CompanyName'] = trim($params['last_name']);467 if (isset($params[ 'company']) && trim($params['company'])) $post['Account.CompanyName'] = trim($params['company']);464 if (isset($params[ 'full_name' ]) && trim($params[ 'full_name' ]) ) $post[ 'Account.CompanyName' ] = trim($params[ 'full_name' ]); 465 if (!isset($post[ 'Account.CompanyName' ]) && isset($params[ 'first_name' ]) && trim($params[ 'first_name' ]) ) $post[ 'Account.CompanyName' ] = trim($params[ 'first_name' ].(isset($params[ 'last_name' ]) ? ' '.$params[ 'last_name' ] : '' ) ); 466 if (!isset($post[ 'Account.CompanyName' ]) && isset($params[ 'last_name' ]) && trim($params[ 'last_name' ]) ) $post[ 'Account.CompanyName' ] = trim($params[ 'last_name' ]); 467 if (isset($params[ 'company' ]) && trim($params[ 'company' ]) ) $post[ 'Account.CompanyName' ] = trim($params[ 'company' ]); 468 468 // Not in use: 469 469 // Account.AccountId , … … 471 471 // Account.ForeignAccountNumber , RecurringPayments.IsActive 472 472 // BankInfo.Bank BankInfo.Branch BankInfo.AccountNumber BankInfo.Description 473 $status = $this->post($this->api[ 'recurring_request'], $post);473 $status = $this->post($this->api[ 'recurring_request' ], $post); 474 474 parse_str($status, $status); 475 475 $response = $status; 476 476 $this->save([ 477 477 'transaction_id' => $this->transaction, 478 'url' => $this->api[ 'recurring_request'],479 'status' => isset($response[ 'ResponseCode']) ? $response['ResponseCode'] : $response['response_code'],480 'description' => isset($response[ 'Description']) ? $response['Description'] : null,478 'url' => $this->api[ 'recurring_request' ], 479 'status' => isset($response[ 'ResponseCode' ]) ? $response[ 'ResponseCode' ] : $response[ 'response_code' ], 480 'description' => isset($response[ 'Description' ]) ? $response[ 'Description' ] : null, 481 481 'request' => json_encode($post), 482 482 'response' => json_encode($response) … … 499 499 public function recur( $params ) { 500 500 $this->transaction = self::uuid(); 501 //$this->transaction = $params[ 'transaction_id'];501 //$this->transaction = $params[ 'transaction_id' ]; 502 502 $this->confirmation_code = $this->charge( $params ); 503 503 return( $this->confirmation_code ); … … 509 509 $post[ 'terminalnumber' ] = $this->param_part( $params ); 510 510 $post[ 'username' ] = $this->param_part( $params, 'username' ); 511 // $post[ 'TokenToCharge.UserPassword'] = $this->param_part($params, 'password');511 // $post[ 'TokenToCharge.UserPassword' ] = $this->param_part($params, 'password' ); 512 512 } else { 513 513 $post[ 'terminalnumber' ] = $this->terminal; … … 515 515 } 516 516 517 if ($refund) $post[ 'TokenToCharge.UserPassword'] = $this->password;518 519 $token = $params[ 'token'] ? json_decode($params['token'], true) : null;517 if ($refund) $post[ 'TokenToCharge.UserPassword' ] = $this->password; 518 519 $token = $params[ 'token' ] ? json_decode($params[ 'token' ], true) : null; 520 520 if ($token) { 521 $post[ 'TokenToCharge.Token'] = $token['token'];//$this->transaction;522 if (isset($token[SimplePayment::CARD_EXPIRY_YEAR]) ) $post['TokenToCharge.CardValidityYear'] = $token[SimplePayment::CARD_EXPIRY_YEAR];523 if (isset($token[SimplePayment::CARD_EXPIRY_MONTH]) ) $post['TokenToCharge.CardValidityMonth'] = $token[SimplePayment::CARD_EXPIRY_MONTH];524 if (isset($token[SimplePayment::CARD_OWNER_ID]) ) $post['TokenToCharge.IdentityNumber'] = $token[SimplePayment::CARD_OWNER_ID];525 } 526 $post[ 'TokenToCharge.SumToBill'] = $params['amount'];527 528 $currency = isset($params[SimplePayment::CURRENCY]) && $params[SimplePayment::CURRENCY] ? $params[SimplePayment::CURRENCY] : $this->param( 'currency');529 if ($currency != '' ) {530 if ($currency = self::CURRENCIES[$currency]) $post[ 'CoinID'] = $currency;531 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500);532 } 533 534 $post[ 'TokenToCharge.CoinID'] = $currency;535 536 537 538 539 $language = $this->param( 'language');540 if ($language != '' ) $post['Language'] = $language;521 $post[ 'TokenToCharge.Token' ] = $token[ 'token' ];//$this->transaction; 522 if (isset($token[SimplePayment::CARD_EXPIRY_YEAR]) ) $post[ 'TokenToCharge.CardValidityYear' ] = $token[SimplePayment::CARD_EXPIRY_YEAR]; 523 if (isset($token[SimplePayment::CARD_EXPIRY_MONTH]) ) $post[ 'TokenToCharge.CardValidityMonth' ] = $token[SimplePayment::CARD_EXPIRY_MONTH]; 524 if (isset($token[SimplePayment::CARD_OWNER_ID]) ) $post[ 'TokenToCharge.IdentityNumber' ] = $token[SimplePayment::CARD_OWNER_ID]; 525 } 526 $post[ 'TokenToCharge.SumToBill' ] = $params[ 'amount' ]; 527 528 $currency = isset($params[SimplePayment::CURRENCY]) && $params[SimplePayment::CURRENCY] ? $params[SimplePayment::CURRENCY] : $this->param( 'currency' ); 529 if ($currency != '' ) { 530 if ($currency = self::CURRENCIES[$currency]) $post[ 'CoinID' ] = $currency; 531 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500); 532 } 533 534 $post[ 'TokenToCharge.CoinID' ] = $currency; 535 536 537 538 539 $language = $this->param( 'language' ); 540 if ($language != '' ) $post[ 'Language' ] = $language; 541 541 542 542 // TokenToCharge.CardOwnerName … … 547 547 548 548 549 if ($refund) $post[ 'TokenToCharge.RefundInsteadOfCharge'] = $refund;550 if ($params[ 'PAYMENTS'] == 'monthly') $post['TokenToCharge.IsAutoRecurringPayment'] = 'true';551 552 if (isset($params[ 'approval_number']) && $params['approval_number']) $post['TokenToCharge.ApprovalNumber'] = $params['approval_number'];553 554 555 // $post = array_merge($post, $this->document(array_merge($params, [ 'language' => $language, 'currency' => $currency])));556 557 $status = $this->post($this->api[ 'payment_recur'], $post);549 if ($refund) $post[ 'TokenToCharge.RefundInsteadOfCharge' ] = $refund; 550 if ($params[ 'PAYMENTS' ] == 'monthly' ) $post[ 'TokenToCharge.IsAutoRecurringPayment' ] = 'true'; 551 552 if (isset($params[ 'approval_number' ]) && $params[ 'approval_number' ]) $post[ 'TokenToCharge.ApprovalNumber' ] = $params[ 'approval_number' ]; 553 554 555 // $post = array_merge($post, $this->document(array_merge($params, [ 'language' => $language, 'currency' => $currency]) )); 556 557 $status = $this->post($this->api[ 'payment_recur' ], $post); 558 558 parse_str($status, $status); 559 559 $response = $status; 560 560 $this->save([ 561 561 'transaction_id' => $this->transaction, 562 'url' => $this->api[ 'payment_recur'],563 'status' => isset($response[ 'ResponseCode']) ? $response['ResponseCode'] : $response['response_code'],564 'description' => isset($response[ 'Description']) ? $response['Description'] : null,562 'url' => $this->api[ 'payment_recur' ], 563 'status' => isset($response[ 'ResponseCode' ]) ? $response[ 'ResponseCode' ] : $response[ 'response_code' ], 564 'description' => isset($response[ 'Description' ]) ? $response[ 'Description' ] : null, 565 565 'request' => json_encode($post), 566 566 'response' => json_encode($response), … … 568 568 ]); 569 569 // InternalDealNumber 570 return($response[ 'ResponseCode'] == 0 ? $response['InternalDealNumber'] : false);570 return($response[ 'ResponseCode' ] == 0 ? $response[ 'InternalDealNumber' ] : false); 571 571 // Not in use: 572 572 // TokenToCharge.Salt, TokenToCharge.SumInStars, TokenToCharge.NumOfPayments … … 581 581 protected function document($params) { 582 582 $post = []; 583 $language = $this->param( 'language');584 $currency = isset($params[SimplePayment::CURRENCY]) ? $params[SimplePayment::CURRENCY] : $this->param( 'currency');585 if ($language) $post[ 'InvoiceHead.Languge'] = $params['language'];586 if ($currency) $post[ 'InvoiceHead.CoinID'] = $params['currency'];587 588 if (isset($params[ 'email']) && $params['email']) $post['InvoiceHead.Email'] = $params['email'];583 $language = $this->param( 'language' ); 584 $currency = isset($params[SimplePayment::CURRENCY]) ? $params[SimplePayment::CURRENCY] : $this->param( 'currency' ); 585 if ($language) $post[ 'InvoiceHead.Languge' ] = $params[ 'language' ]; 586 if ($currency) $post[ 'InvoiceHead.CoinID' ] = $params[ 'currency' ]; 587 588 if (isset($params[ 'email' ]) && $params[ 'email' ]) $post[ 'InvoiceHead.Email' ] = $params[ 'email' ]; 589 589 590 if (!$this->param( 'doc_details') || in_array($this->param('doc_details'), ['address', 'full'])) {591 if (isset($params[ 'address']) && $params['address']) $post['InvoiceHead.CustAddresLine1'] = $params['address'];592 if (isset($params[ 'address2']) && $params['address2']) $post['InvoiceHead.CustAddresLine2'] = $params['address2'];593 if (isset($params[ 'city']) && $params['city']) $post['InvoiceHead.CustCity'] = $params['city'];594 } 595 if (!$this->param( 'doc_details') || in_array($this->param('doc_details'), ['contact', 'full'])) {596 if (isset($params[ 'phone']) && $params['phone']) $post['InvoiceHead.CustLinePH'] = $params['phone'];597 if (isset($params[ 'mobile']) && $params['mobile']) $post['InvoiceHead.CustMobilePH'] = $params['mobile'];598 } 599 600 if (isset($params[ 'tax_id']) && $params['tax_id']) $post['InvoiceHead.CompID'] = $params['tax_id'];601 if (isset($params[ 'comment']) && $params['comment']) $post['InvoiceHead.Comments'] = $params['comment'];602 if ($this->param( 'email_invoice')) $post['InvoiceHead.SendByEmail'] = 'true';603 if ($this->param( 'vat_free')) $post['InvoiceHead.ExtIsVatFree'] = 'true';604 if ($this->param( 'auto_create_account')) $post['InvoiceHead.IsAutoCreateUpdateAccount'] = 'true';605 if ($this->param( 'auto_load_account')) $post['InvoiceHead.IsLoadInfoFromAccountID'] = 'true';606 if ($this->param( 'department_id')) $post['InvoiceHead.DepartmentId'] = $this->param('department_id');607 //if ( isset($params[ 'payment_id']) && $params['payment_id']) $post['InvoiceHead.SiteUniqueId'] = $params['payment_id'];590 if (!$this->param( 'doc_details' ) || in_array($this->param( 'doc_details' ), [ 'address', 'full' ]) ) { 591 if (isset($params[ 'address' ]) && $params[ 'address' ]) $post[ 'InvoiceHead.CustAddresLine1' ] = $params[ 'address' ]; 592 if (isset($params[ 'address2' ]) && $params[ 'address2' ]) $post[ 'InvoiceHead.CustAddresLine2' ] = $params[ 'address2' ]; 593 if (isset($params[ 'city' ]) && $params[ 'city' ]) $post[ 'InvoiceHead.CustCity' ] = $params[ 'city' ]; 594 } 595 if (!$this->param( 'doc_details' ) || in_array($this->param( 'doc_details' ), [ 'contact', 'full' ]) ) { 596 if (isset($params[ 'phone' ]) && $params[ 'phone' ]) $post[ 'InvoiceHead.CustLinePH' ] = $params[ 'phone' ]; 597 if (isset($params[ 'mobile' ]) && $params[ 'mobile' ]) $post[ 'InvoiceHead.CustMobilePH' ] = $params[ 'mobile' ]; 598 } 599 600 if (isset($params[ 'tax_id' ]) && $params[ 'tax_id' ]) $post[ 'InvoiceHead.CompID' ] = $params[ 'tax_id' ]; 601 if (isset($params[ 'comment' ]) && $params[ 'comment' ]) $post[ 'InvoiceHead.Comments' ] = $params[ 'comment' ]; 602 if ($this->param( 'email_invoice' ) ) $post[ 'InvoiceHead.SendByEmail' ] = 'true'; 603 if ($this->param( 'vat_free' ) ) $post[ 'InvoiceHead.ExtIsVatFree' ] = 'true'; 604 if ($this->param( 'auto_create_account' ) ) $post[ 'InvoiceHead.IsAutoCreateUpdateAccount' ] = 'true'; 605 if ($this->param( 'auto_load_account' ) ) $post[ 'InvoiceHead.IsLoadInfoFromAccountID' ] = 'true'; 606 if ($this->param( 'department_id' ) ) $post[ 'InvoiceHead.DepartmentId' ] = $this->param( 'department_id' ); 607 //if ( isset($params[ 'payment_id' ]) && $params[ 'payment_id' ]) $post[ 'InvoiceHead.SiteUniqueId' ] = $params[ 'payment_id' ]; 608 608 609 609 if ( isset( $params[ 'products' ] ) && is_array( $params[ 'products' ] ) ) { … … 615 615 $post[ 'InvoiceLines' . $index . '.Quantity' ] = $product[ 'qty' ]; 616 616 $post[ 'InvoiceLines' . $index . '.IsPriceIncludeVAT' ] = 'true'; // Must be true - API requirement 617 // TODO: support per item: $post[ 'InvoiceLines1.IsVatFree'] = 'true';617 // TODO: support per item: $post[ 'InvoiceLines1.IsVatFree' ] = 'true'; 618 618 if ( isset( $product[ 'id' ] ) && $product[ 'id' ] ) $post[ 'InvoiceLines' . $index . '.ProductID' ] = $product[ 'id' ]; 619 619 $index++; 620 620 } 621 621 } else { 622 $post[ 'InvoiceLines1.Description' ] = $params['product'];623 $post[ 'InvoiceLines1.Price' ] = $params['amount'];624 $post[ 'InvoiceLines1.Quantity' ] = 1;625 $post[ 'InvoiceLines1.IsPriceIncludeVAT' ] = 'true'; // Must be true - API requirement626 // TODO: support per item: $post[ 'InvoiceLines1.IsVatFree'] = 'true';622 $post[ 'InvoiceLines1.Description' ] = $params[ 'product' ]; 623 $post[ 'InvoiceLines1.Price' ] = $params[ 'amount' ]; 624 $post[ 'InvoiceLines1.Quantity' ] = 1; 625 $post[ 'InvoiceLines1.IsPriceIncludeVAT' ] = 'true'; // Must be true - API requirement 626 // TODO: support per item: $post[ 'InvoiceLines1.IsVatFree' ] = 'true'; 627 627 if ( isset( $params[ 'id' ] ) && $params[ 'id' ] ) $post[ 'InvoiceLines1.ProductID' ] = $params[ 'id' ]; 628 628 } … … 652 652 return($post); 653 653 } 654 655 //https://asmachta.co.il/?engine=Cardcom&payment_id=127046&redirect_url=https%3A%2F%2Fasmachta.co.il%2F%25d7%25a0%25d7%25a1%25d7%2597-%25d7%2598%25d7%2590%25d7%2591%25d7%2595%2F%3Fgf_simplepayment_return%3DaWRzPTJ8MTM0Nzk0Jmhhc2g9YWRkYmFjYmZiZGRjNDdlMTlkY2E1NzBiYjA0NmZkNzk&terminalnumber=125527&lowprofilecode=83fccd5d-6aed-4235-a1ab-62aceb769fad&ResponeCode=0&Operation=1&ResponseCode=0&Status=0 656 // Sanitize url for Cardcom, so we wont send cardcom parameters 657 public function url( $type, $params = null ) { 658 if ( $url = parent::url( $type, $params ) ) { 659 $parts = parse_url( $url ); 660 if ( isset( $parts[ 'query' ] ) ) { 661 parse_str( $parts[ 'query' ], $query ); 662 foreach ( [ 'terminalnumber', 'lowprofilecode', 'ResponeCode', 'Operation', 'ResponseCode', 'Status', 'DealRespone', 'InvoiceResponseCode', 'OperationResponse', 'OperationResponseText', 'ReturnValue' ] as $param ) { 663 unset( $query[ $param ] ); 664 } 665 $parts[ 'query' ] = http_build_query( $query ); 666 $url = $parts[ 'scheme' ] . '://' . $parts[ 'host' ]; 667 if ( isset( $parts[ 'port' ]) ) { 668 $url .= ':' . $parts[ 'port' ]; 669 } 670 if ( isset( $parts[ 'path' ] ) ) { 671 $url .= $parts[ 'path' ]; 672 } 673 if ( $parts[ 'query' ] ) { 674 $url .= '?' . $parts[ 'query' ]; 675 } 676 if ( isset( $parts[ 'fragment' ] ) ) { 677 $url .= '#' . $parts[ 'fragment' ]; 678 } 679 } 680 } 681 return( $url ); 682 } 654 683 655 684 } -
simple-payment/tags/2.4.1/vendor/yalla-ya/simple-payment/Engines/Engine.php
r3318371 r3319619 137 137 public function url( $type, $params = null ) { 138 138 $url = $this->callback; 139 $qry = []; 139 $qry = [ 140 'op' => $type, 141 'engine' => static::$name 142 ]; 140 143 if ( strpos( $url, 'transaction_id' ) === false ) $qry[ 'transaction_id' ] = $this->transaction; 141 144 if ( isset( $params[ 'payments' ] ) && strpos( $url, 'payments' ) === false ) $qry[ 'payments' ] = $params[ 'payments' ]; … … 143 146 if ( isset( $params[ 'target' ] ) && strpos( $url, 'target' ) === false ) $qry[ 'target' ] = $params[ 'target' ]; 144 147 if ( isset( $params[ 'redirect_url' ] ) && strpos( $url, 'redirect_url' ) === false ) $qry[ 'redirect_url' ] = $params[ 'redirect_url' ]; 145 return( $url . ( strpos( $url, '?' ) ? '&' : '?' ) . 'op=' . $type . '&engine=' . static::$name .( $qry ? '&' . http_build_query( $qry ) : '' ) );148 return( $url . ( strpos( $url, '?' ) ? '&' : '?' ) . ( $qry ? '&' . http_build_query( $qry ) : '' ) ); 146 149 } 147 150 -
simple-payment/trunk/addons/gravityforms/init.php
r3318371 r3319619 573 573 574 574 public function return_url( $form_id, $lead_id ) { 575 // Lets use wordpress built-in function site_url576 /*$pageURL = GFCommon::is_ssl() ? 'https://' : 'http://';577 $server_port = apply_filters( 'gform_simplepayment_return_url_port', $_SERVER['SERVER_PORT'] );578 if ( $server_port != '80' && $server_port != 443) {579 $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $server_port . $_SERVER['REQUEST_URI'];580 } else {581 $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];582 }*/583 575 $pageURL = site_url( $_SERVER[ 'REQUEST_URI' ] ); 584 576 $ids_query = "ids={$form_id}|{$lead_id}"; … … 793 785 * @param array $entry The entry object currently being processed. 794 786 */ 795 $params[ 'redirect_url' ] = get_bloginfo( 'url' ) . '/?page=gf_simplepayment_ipn&entry_id=' . $entry[ 'id' ] . '&redirect_url=' . urlencode( $this->return_url( $form[ 'id' ], $entry[ 'id' ] ) ) . ( isset( $params[ 'target' ] ) && $params[ 'target' ] ? '&target=' . $params[ 'target' ] : '' );787 $params[ 'redirect_url' ] = get_bloginfo( 'url' ) . '/?page=gf_simplepayment_ipn&entry_id=' . $entry[ 'id' ] . '&redirect_url=' . urlencode( $this->return_url( $form[ 'id' ], $entry[ 'id' ] ) ) . ( isset( $params[ 'target' ] ) && $params[ 'target' ] ? '&target=' . $params[ 'target' ] : '' ); 796 788 $this->add_sp_pre_process( $feed, $submission_data, $form, $entry ); 797 789 $params = apply_filters( 'gform_simplepayment_args_before_payment', $params, $form[ 'id' ], $submission_data, $feed, $entry ); -
simple-payment/trunk/admin/admin.php
r3318371 r3319619 56 56 } 57 57 } 58 add_action( 'admin_menu', [ $this, 'add_plugin_options_page' ] );58 //add_action( 'admin_menu', [ $this, 'add_plugin_options_page' ] ); 59 59 if ( !empty( $GLOBALS[ 'pagenow' ] ) ) { 60 60 switch ( $GLOBALS[ 'pagenow' ] ) { … … 68 68 } 69 69 } 70 71 $_active_plugins = array_merge( is_multisite() ? array_keys( get_site_option( 'active_sitewide_plugins', [] ) ) : [], get_option( 'active_plugins', [] ) ); 72 //if ( in_array( 'admin-columns-pro/admin-columns-pro.php', $_active_plugins ) ) { 73 // add_action( 'after_setup_theme', function () { 74 // require_once( SPWP_PLUGIN_DIR . '/addons/admin-columns-pro/init.php' ); 75 // } ); 76 //} 77 78 add_action( 'admin_enqueue_scripts', function () { 79 wp_enqueue_script( 'simple-payment-admin-js', plugin_dir_url( __FILE__ ) . 'script.js', [], false, true ); 80 wp_enqueue_style( 'simple-payment-admin-css', plugin_dir_url( __FILE__ ) . 'style.css', [], false ); 81 } ); 82 83 add_action( 'admin_init', [ $this, 'register_license_settings' ] ); 84 //add_action( 'sp_admin_tabs', [ $this, 'add_plugin_settings' ] ); 85 //add_filter( 'sp_admin_sections', [ $this, 'add_plugin_settings' ] ); 70 86 } 71 87 … … 177 193 'simple-payments', 178 194 [ $this, 'render_transactions' ], 179 plugin_dir_url( __FILE__ ). 'assets/simple-payment-icon.png',195 SPWP_PLUGIN_URL . 'assets/simple-payment-icon.png', 180 196 30 181 197 ); … … 463 479 ] ); 464 480 require( SPWP_PLUGIN_DIR.'/admin/transaction-list-table.php' ); 465 $list = new Transaction_List();481 $list = new Transaction_List(); // Consider using different List when using ACP - did_action( 'acp/ready' ); 466 482 } 467 483 -
simple-payment/trunk/admin/style.css
r2176343 r3319619 1 1 .ttablenav .alignleft:nth-of-type(2n) { clear: both; } 2 pre.json {}3 2 pre.json .string { color: green; } 4 3 pre.json .number { color: darkorange; } … … 7 6 pre.json .key { color: red; } 8 7 pre.url { word-break: break-all; white-space: pre-wrap; } 8 .transaction-overview { 9 display: flex; 10 flex-wrap: wrap; 11 row-gap: 5px; 12 column-gap: 5px; 13 justify-content: space-between; 14 } 15 .transaction-item { 16 padding: 5px; 17 display: flex; 18 justify-content: space-between; 19 flex-grow: 1; 20 order: 0; 21 row-gap: 5px; 22 column-gap: 5px; 23 } 24 25 .transaction-item.item-parameters { 26 order: 100; 27 } 28 29 .transaction-item.item-redirect_url, .transaction-item.item-parameters, .transaction-item.item-user_agent { 30 flex-basis: 100%; 31 flex-direction: column; 32 } -
simple-payment/trunk/admin/transaction-list-table.php
r3318406 r3319619 352 352 } else { 353 353 $screen = get_current_screen(); 354 //print_r( $screen ); 354 355 $per_page = get_user_meta(get_current_user_id(), $screen->get_option('per_page', 'option'), true); 355 356 $per_page = $per_page ? $per_page : $this->get_items_per_page( 'per_page', $screen->get_option('per_page', 'default')); -
simple-payment/trunk/admin/transaction-log.php
r2448085 r3319619 13 13 ?> 14 14 <hr class="wp-header-end"> 15 <div class="transaction-overview"> 16 <?php 17 $payment = SimplePaymentPlugin::instance()->fetch( $_REQUEST[ 'id' ] ); 18 foreach( $payment as $key => $value ) { 19 if ( ! empty( $value ) ) { 20 echo '<div class="transaction-item item-' . $key . '"><strong>' . esc_html( ucfirst( $key ) ) . ':</strong> ' . ( !is_array( $value ) ? esc_html( $value ) : '<pre class="json">' . json_encode( $value ) . '</pre>' ) . '</div>'; 21 } 22 } 23 ?> 24 </div> 15 25 <?php $list->views(); ?> 16 26 <form id="transaction-logs-filter" method="get"> -
simple-payment/trunk/engines/cardcom.php
r3318371 r3319619 16 16 }, 1000, 2 ); 17 17 18 /* 18 19 add_filter( 'sp_payment_callback', function( $url ) { 19 20 global $SPWP; 20 if ( !$SPWP::param( 'cardcom.short_urls' ) ) return ;21 if ( !$SPWP::param( 'cardcom.short_urls' ) ) return( $url ); 21 22 $uid = wp_generate_uuid4(); 22 23 set_transient( 'sp_' . $uid, $url ); // TODO: should we define expiration/ 5 days? 23 $url = add_query_arg( [24 $SPWP::OP=> $SPWP::OPERATION_REDIRECT,25 '_spr' => $uid26 ], site_url() );24 //$url = add_query_arg( [ 25 // $SPWP::SPRD => $SPWP::OPERATION_REDIRECT, 26 // '_spr' => $uid 27 //], site_url() ); 27 28 return( $url ); 28 29 }, 5000 ); 30 */ 31 32 add_filter( 'gform_simplepayment_return_url', function( $url, $form_id, $lead_id ) { 33 global $SPWP; 34 if ( !$SPWP::param( 'cardcom.short_urls' ) ) return( $url ); 35 $pageURL = site_url( '/_gf-sp' ); 36 $ids_query = "ids={$form_id}|{$lead_id}"; 37 $ids_query .= '&hash=' . wp_hash( $ids_query ); 38 $url = remove_query_arg( 'gf_simplepayment_retry', $pageURL ); 39 $url = add_query_arg( 'gf_simplepayment_return', base64_encode( $ids_query ), $url ); 40 return( $url ); 41 }, 50, 3 ); 42 29 43 30 44 add_filter( 'sp_payment_callback', function( $callback ) { -
simple-payment/trunk/languages/simple-payment.pot
r3318406 r3319619 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Simple Payment 2. 3.9\n"5 "Project-Id-Version: Simple Payment 2.4.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/simple-payment\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-06- 26T17:29:54+00:00\n"12 "POT-Creation-Date: 2025-06-30T00:08:12+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.10.0\n" … … 17 17 #. Plugin Name of the plugin 18 18 #: simple-payment-plugin.php 19 #: addons/admin-columns-pro/classes/Service/ColumnGroup.php:20 20 #: addons/admin-columns-pro/classes/Service/ListScreens.php:19 19 21 #: addons/elementor/widget.php:31 20 22 #: addons/woocommerce/init.php:127 21 23 #: addons/woocommerce/init.php:248 22 24 #: addons/wpjobboard/config.php:8 23 #: admin/admin.php:1 6624 #: admin/admin.php:1 6725 #: admin/admin.php:182 26 #: admin/admin.php:183 25 27 msgid "Simple Payment" 26 28 msgstr "" … … 445 447 msgstr "" 446 448 447 #: addons/gravityforms/init.php:9 87449 #: addons/gravityforms/init.php:979 448 450 msgid "Payment Completed" 449 451 msgstr "" 450 452 451 #: addons/gravityforms/init.php:98 8453 #: addons/gravityforms/init.php:980 452 454 msgid "Payment Failed" 453 455 msgstr "" 454 456 455 #: addons/gravityforms/init.php:98 9457 #: addons/gravityforms/init.php:981 456 458 msgid "Subscription Created" 457 459 msgstr "" 458 460 459 #: addons/gravityforms/init.php:138 9461 #: addons/gravityforms/init.php:1381 460 462 #: addons/woocommerce/init.php:206 461 463 #: templates/form-woocommerce.php:65 … … 682 684 msgstr "" 683 685 684 #: admin/admin.php: 86686 #: admin/admin.php:102 685 687 msgid "Thanks for updating Simple Payment, you can checkout for new features and updates <a href=\"https://simple-payment.yalla-ya.com\" target=\"_blank\">here</a>." 686 688 msgstr "" 687 689 688 #: admin/admin.php: 90690 #: admin/admin.php:106 689 691 msgid "Thanks for installing Simple Payment, after your test our plugin, dont forget to get your license to process real transactions, you can do it <a href=\"https://simple-payment.yalla-ya.com\" target=\"_blank\">here</a>." 690 692 msgstr "" 691 693 692 #: admin/admin.php:1 16694 #: admin/admin.php:132 693 695 msgid "View Simple Payment documentation" 694 696 msgstr "" 695 697 696 #: admin/admin.php:1 16698 #: admin/admin.php:132 697 699 msgid "Docs" 698 700 msgstr "" 699 701 700 #: admin/admin.php:1 17702 #: admin/admin.php:133 701 703 msgid "Visit premium customer support" 702 704 msgstr "" 703 705 704 #: admin/admin.php:1 17706 #: admin/admin.php:133 705 707 msgid "Premium support" 706 708 msgstr "" 707 709 708 #: admin/admin.php:1 59709 #: admin/admin.php:3 56710 #: admin/admin.php:175 711 #: admin/admin.php:372 710 712 #: admin/settings.php:123 711 713 #: settings.php:122 … … 713 715 msgstr "" 714 716 715 #: admin/admin.php:1 74716 #: admin/admin.php:1 75717 #: admin/admin.php:190 718 #: admin/admin.php:191 717 719 #: admin/transaction-list-table.php:241 718 720 msgid "Payments" 719 721 msgstr "" 720 722 721 #: admin/admin.php: 185722 #: admin/admin.php: 186723 #: admin/admin.php:201 724 #: admin/admin.php:202 723 725 msgid "Transaction Details" 724 726 msgstr "" 725 727 726 #: admin/admin.php:2 07728 #: admin/admin.php:223 727 729 msgid "Simple Payment Settings" 728 730 msgstr "" 729 731 730 #: admin/admin.php:2 43732 #: admin/admin.php:259 731 733 msgid "License Key" 732 734 msgstr "" 733 735 734 #: admin/admin.php:4 06736 #: admin/admin.php:422 735 737 msgid "Auto" 736 738 msgstr "" 737 739 738 #: admin/admin.php:5 41740 #: admin/admin.php:557 739 741 msgid "License key is required" 740 742 msgstr "" 741 743 742 #: admin/admin.php:5 66744 #: admin/admin.php:582 743 745 msgid "License is not valid on the current domain" 744 746 msgstr "" 745 747 746 #: admin/admin.php:5 74748 #: admin/admin.php:590 747 749 msgid "License has not been activated" 748 750 msgstr "" 749 751 750 #: admin/admin.php:5 79752 #: admin/admin.php:595 751 753 msgid "License key was not found" 752 754 msgstr "" 753 755 754 #: admin/admin.php:5 83756 #: admin/admin.php:599 755 757 msgid "Unhandled error:" 756 758 msgstr "" … … 1963 1965 msgstr "" 1964 1966 1965 #: simple-payment-plugin.php:14 21967 #: simple-payment-plugin.php:144 1966 1968 msgid "Simple Payment License Error: %s" 1967 1969 msgstr "" 1968 1970 1969 #: simple-payment-plugin.php:14 21971 #: simple-payment-plugin.php:144 1970 1972 msgid "License error, or no license." 1971 1973 msgstr "" 1972 1974 1973 #: simple-payment-plugin.php:1 881975 #: simple-payment-plugin.php:190 1974 1976 msgid "Every %s Minutes" 1975 1977 msgstr "" 1976 1978 1977 #: simple-payment-plugin.php:58 41979 #: simple-payment-plugin.php:587 1978 1980 msgid "Error payment recharge" 1979 1981 msgstr "" 1980 1982 1981 #: simple-payment-plugin.php:83 31983 #: simple-payment-plugin.php:836 1982 1984 msgid "Couldn't update transaction: %s" 1983 1985 msgstr "" -
simple-payment/trunk/readme.txt
r3318406 r3319619 4 4 Tags: credit card, simple payment, donation, membership, checkout, payment request, payment gateway, sales, woocommerce, store, ecommerce, e-commerce, commerce, gutenberg, elementor, cardcom, icount, icredit, payme, isracard, paypal 5 5 Requires at least: 4.6 6 Tested up to: 6. 6.27 Stable tag: 2.4. 06 Tested up to: 6.8.1 7 Stable tag: 2.4.1 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later … … 93 93 == Changelog == 94 94 95 = 2.3.10 = 95 = 2.4.2 = 96 *Release Date - 29 Jun 2025* 97 * Better support for Cardcom & GravityForms 98 * Security fixes 99 100 = 2.4.1 = 96 101 *Release Date - 26 Jun 2025* 97 102 * Security fix, XSS on admin. 98 99 = 2.3.9 =100 *Release Date - 26 Jun 2025*101 103 * Security and bug fixes 102 104 * Performance Improvment - Seperation of Front-end / Backend code 103 105 * Fixing issue with Woocommerce Subscriptions forcing tokens on Woocommerce Checkout 104 106 * Feature: shorten urls when Payment Gateway cannot handle standard url lengths 107 * Tested under PHP 8.4 105 108 106 109 = 2.2.2 = -
simple-payment/trunk/simple-payment-plugin.php
r3318406 r3319619 4 4 * Plugin URI: https://simple-payment.yalla-ya.com 5 5 * Description: Simple Payment enables integration with multiple payment gateways, and customize multiple payment forms. 6 * Version: 2.4. 06 * Version: 2.4.1 7 7 * Author: Ido Kobelkowsky / yalla ya! 8 8 * Author URI: https://github.com/idokd … … 45 45 46 46 public static $table_name = 'sp_transactions'; 47 public static $table_name_metadata = 'sp_transactions_metadata'; 48 47 49 public static $engines = [ 'PayPal', 'Cardcom', 'iCount', 'PayMe', 'iCredit', 'CreditGuard', 'Meshulam', 'YaadPay', 'Credit2000', 'Custom' ]; 48 50 … … 275 277 $status = false; 276 278 if ( $code = parent::status( array_merge( $data, $params ) ) ) { 279 $params[ 'confirmation_code' ] = $code; 277 280 $status = self::update( $this->payment_id ? : $this->engine->transaction, [ 278 281 'status' => self::TRANSACTION_SUCCESS, … … 838 841 } 839 842 843 public function get_entry( $id, $engine = null ){ 844 return( $this->fetch( $id, $engine ) ); 845 } 840 846 841 847 public function fetch( $id, $engine = null ) { … … 1030 1036 require_once( 'addons/gravityforms/init.php' ); 1031 1037 1032 1033 1038 //require_once('addons/recaptcha/init.php'); 1034 1039 -
simple-payment/trunk/vendor/autoload.php
r3318371 r3319619 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 -
simple-payment/trunk/vendor/composer/InstalledVersions.php
r3318371 r3319619 28 28 { 29 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 30 36 * @var mixed[]|null 31 37 * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null 32 38 */ 33 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 34 45 35 46 /** … … 310 321 self::$installed = $data; 311 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 312 341 } 313 342 … … 323 352 324 353 $installed = array(); 354 $copiedLocalDir = false; 325 355 326 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 327 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 328 360 if (isset(self::$installedByVendor[$vendorDir])) { 329 361 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 363 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 332 364 $required = require $vendorDir.'/composer/installed.php'; 333 $installed[] = self::$installedByVendor[$vendorDir] = $required; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 336 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 337 374 } 338 375 } … … 351 388 } 352 389 353 if (self::$installed !== array() ) {390 if (self::$installed !== array() && !$copiedLocalDir) { 354 391 $installed[] = self::$installed; 355 392 } -
simple-payment/trunk/vendor/composer/installed.php
r3318371 r3319619 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 8d70fa9f086df134f54cc8e70526cb888ea9b265',6 'reference' => '59fc00a8805a5e2566813aaee5fd97f5dada586c', 7 7 'type' => 'project', 8 8 'install_path' => __DIR__ . '/../../', … … 70 70 'pretty_version' => 'dev-master', 71 71 'version' => 'dev-master', 72 'reference' => ' 8d70fa9f086df134f54cc8e70526cb888ea9b265',72 'reference' => '59fc00a8805a5e2566813aaee5fd97f5dada586c', 73 73 'type' => 'project', 74 74 'install_path' => __DIR__ . '/../../', -
simple-payment/trunk/vendor/yalla-ya/simple-payment/Engines/Cardcom.php
r3318371 r3319619 7 7 use DateInterval; 8 8 9 if (!defined("ABSPATH") ) {9 if (!defined("ABSPATH") ) { 10 10 exit; // Exit if accessed directly 11 11 } … … 49 49 const OPERATIONS = [ 1 => 'Charge', 2 => 'Charge & Token', 3 => 'Token (Charge Pending)', 4 => 'Suspended Deal' ]; 50 50 const DOC_TYPES = [ 1 => 'Invoice', 3 => 'Formal Receipt', 101 => 'Order Confirmation', 400 => 'Receipt' , 405 => 'Donation' ]; 51 const FIELD_STATUS = [ 'require' => 'Shown & Required', 'show' => 'Shown', 'hide' => 'Hidden' ];52 const CREDIT_TYPES = [ 1 => 'Normal', 6 => 'Credit' ];53 const DOC_OPERATIONS = [ 0 => 'No Invoice', 1 => 'Invoice', 2 => 'Forward (Do not show)' ];51 const FIELD_STATUS = [ 'require' => 'Shown & Required', 'show' => 'Shown', 'hide' => 'Hidden' ]; 52 const CREDIT_TYPES = [ 1 => 'Normal', 6 => 'Credit' ]; 53 const DOC_OPERATIONS = [ 0 => 'No Invoice', 1 => 'Invoice', 2 => 'Forward (Do not show)' ]; 54 54 55 55 public function __construct( $params = null, $handler = null, $sandbox = true ) { … … 59 59 60 60 public function process( $params ) { 61 //header("Location: ".$params[ 'url']);61 //header("Location: ".$params[ 'url' ]); 62 62 //return(true); 63 63 return( $params[ 'url' ] ); … … 74 74 $post[ 'username' ] = $this->username; 75 75 } 76 //$post[ 'terminalnumber'] = $this->terminal;77 //$post[ 'username'] = $this->username;76 //$post[ 'terminalnumber' ] = $this->terminal; 77 //$post[ 'username' ] = $this->username; 78 78 $post[ 'lowprofilecode' ] = $this->transaction; 79 79 $post[ 'codepage' ] = 65001; … … 106 106 'transaction_id' => $this->transaction, 107 107 'url' => $this->api[ 'indicator_request' ], 108 'status' => isset( $response[ 'OperationResponse' ] ) ? $response[ 'OperationResponse' ] : ( isset( $response[ 'DealResponse' ] ) ? $response[ 'DealResponse' ] : '' ),108 'status' => isset( $response[ 'OperationResponse' ] ) ? $response[ 'OperationResponse' ] : ( isset( $response[ 'DealResponse' ] ) ? $response[ 'DealResponse' ] : '' ), 109 109 'description' => isset( $response[ 'OperationResponseText' ] ) ? $response[ 'OperationResponseText' ] : $response[ 'Description' ], 110 110 'request' => json_encode( $post ), … … 117 117 switch( intval( $operation ) ) { 118 118 case 1: 119 $code = $response[ ' DealResponse' ];120 if ( isset( $response[ 'OperationResponse' ] ) && $response[ 'OperationResponse' ] == '0' && isset( $response[ 'DealResponse' ] ) && $response[ 'DealResponse'] == '0' ) {119 $code = $response[ 'InternalDealNumber' ]; 120 if ( isset( $response[ 'OperationResponse' ] ) && $response[ 'OperationResponse' ] == '0' && isset( $response[ 'DealResponse' ] ) && $response[ 'DealResponse' ] == '0' ) { 121 121 $this->confirmation_code = $code; 122 122 } … … 125 125 case 2: 126 126 $code = $response[ 'TokenResponse' ]; 127 if ( isset( $response[ 'OperationResponse' ] ) && $response[ 'OperationResponse' ] == '0' && isset( $response[ 'DealResponse' ] ) && $response[ 'DealResponse' ] == '0' && isset( $response[ 'TokenResponse' ] ) && $response[ 'TokenResponse' ] == '0' ) {127 if ( isset( $response[ 'OperationResponse' ] ) && $response[ 'OperationResponse' ] == '0' && isset( $response[ 'DealResponse' ] ) && $response[ 'DealResponse' ] == '0' && isset( $response[ 'TokenResponse' ] ) && $response[ 'TokenResponse' ] == '0' ) { 128 128 $this->confirmation_code = $code; 129 129 } … … 149 149 'url' => ':callback', 150 150 'status' => isset( $params[ 'ResposeCode' ] ) ? $params[ 'ResposeCode' ] : $params[ 'ResponseCode' ], 151 'description' => isset( $params[ 'OperationResponseText' ] ) ? $params[ 'OperationResponseText ' ] : $params['Description'],151 'description' => isset( $params[ 'OperationResponseText' ] ) ? $params[ 'OperationResponseText ' ] : $params[ 'Description' ], 152 152 'request' => json_encode( $params ), 153 153 'response' => null … … 156 156 } 157 157 158 public function status( $params) {159 parent::status( $params);160 $this->transaction = $params[ 'lowprofilecode'];161 $this->save( [158 public function status( $params ) { 159 parent::status( $params ); 160 $this->transaction = $params[ 'lowprofilecode' ]; 161 $this->save( [ 162 162 'transaction_id' => $this->transaction, 163 'url' => $_SERVER[ "REQUEST_URI"],164 'status' => isset( $params['OperationResponse']) ? $params['OperationResponse'] : $params['DealResponse'],165 'description' => isset( $params['OperationResponseText']) ? $params['OperationResponseText'] : $params['Description'],166 'request' => json_encode( $_REQUEST),163 'url' => $_SERVER[ 'REQUEST_URI' ], 164 'status' => isset( $params[ 'OperationResponse' ] ) ? $params[ 'OperationResponse' ] : $params[ 'DealResponse' ], 165 'description' => isset( $params[ 'OperationResponseText' ] ) ? $params[ 'OperationResponseText' ] : $params[ 'Description' ], 166 'request' => json_encode( $_REQUEST ), 167 167 'response' => null 168 ] );168 ] ); 169 169 $post = []; 170 170 if ( !$this->sandbox ) { 171 $post[ 'terminalnumber'] = $this->param_part($params);172 $post[ 'username'] = $this->param_part($params, 'username');171 $post[ 'terminalnumber' ] = $this->param_part( $params ); 172 $post[ 'username' ] = $this->param_part( $params, 'username' ); 173 173 } else { 174 $post[ 'terminalnumber'] = $this->terminal;175 $post[ 'username'] = $this->username;176 } 177 $post[ 'lowprofilecode'] = $params['lowprofilecode'];178 $status = $this->post( $this->api['indicator_request'], $post);179 parse_str( $status, $status);180 //$this->transaction = $params[ 'lowprofilecode'];174 $post[ 'terminalnumber' ] = $this->terminal; 175 $post[ 'username' ] = $this->username; 176 } 177 $post[ 'lowprofilecode' ] = $params[ 'lowprofilecode' ]; 178 $status = $this->post( $this->api[ 'indicator_request' ], $post); 179 parse_str( $status, $status ); 180 //$this->transaction = $params[ 'lowprofilecode' ]; 181 181 182 182 // TODO: fetch VISA, YEAR, MONTH, ID??? … … 184 184 if ( isset( $status[ 'Token' ] ) && $status[ 'Token' ] ) { 185 185 $token = [ 186 'token' => $status[ 'Token'],187 SimplePayment::CARD_OWNER => $status[ 'CardOwnerID'],188 SimplePayment::CARD_EXPIRY_YEAR => $status[ 'CardValidityYear'],189 SimplePayment::CARD_EXPIRY_MONTH => $status[ 'CardValidityMonth'],186 'token' => $status[ 'Token' ], 187 SimplePayment::CARD_OWNER => $status[ 'CardOwnerID' ], 188 SimplePayment::CARD_EXPIRY_YEAR => $status[ 'CardValidityYear' ], 189 SimplePayment::CARD_EXPIRY_MONTH => $status[ 'CardValidityMonth' ], 190 190 // 'card_type' => '', 191 'expiry' => $status[ 'TokenExDate'],191 'expiry' => $status[ 'TokenExDate' ], 192 192 ]; 193 193 } 194 194 $response = $status; 195 195 $this->confirmation_code = isset( $response[ 'InternalDealNumber' ] ) ? $response[ 'InternalDealNumber' ] : null; 196 $this->save( [196 $this->save( [ 197 197 'transaction_id' => $this->transaction, 198 'url' => $this->api[ 'indicator_request'],199 'status' => isset( $response['OperationResponse']) ? $response['OperationResponse'] : $response['DealResponse'],200 'description' => isset( $response['OperationResponseText']) ? $response['OperationResponseText'] : $response['Description'],201 'request' => json_encode( $post),202 'response' => json_encode( $response),198 'url' => $this->api[ 'indicator_request' ], 199 'status' => isset( $response[ 'OperationResponse' ] ) ? $response[ 'OperationResponse' ] : $response[ 'DealResponse' ], 200 'description' => isset( $response[ 'OperationResponseText' ] ) ? $response[ 'OperationResponseText' ] : $response[ 'Description' ], 201 'request' => json_encode( $post ), 202 'response' => json_encode( $response ), 203 203 'token' => $token 204 ] );205 if ( !isset($response['OperationResponse']) || $response['OperationResponse'] != 0) {206 throw new Exception( isset($response['OperationResponseText']) ? $response['OperationResponseText'] : $response['Description'], isset($response['OperationResponse']) ? $response['OperationResponse'] : $response['DealResponse']);207 } 208 if ( $params['Operation'] == 2 && isset($params['payments']) && $params['payments'] == "monthly") {209 if ( $this->param('recurr_at') == 'status' && $this->param('reurring') == 'provider') $this->recur_by_provider($params);204 ] ); 205 if ( !isset( $response[ 'OperationResponse' ]) || $response[ 'OperationResponse' ] != 0 ) { 206 throw new Exception( isset( $response[ 'OperationResponseText' ] ) ? $response[ 'OperationResponseText' ] : $response[ 'Description' ], isset( $response[ 'OperationResponse' ] ) ? $response[ 'OperationResponse' ] : $response[ 'DealResponse' ] ); 207 } 208 if ( $params[ 'Operation' ] == 2 && isset( $params[ 'payments' ] ) && $params[ 'payments' ] == 'monthly' ) { 209 if ( $this->param( 'recurr_at' ) == 'status' && $this->param( 'reurring' ) == 'provider' ) $this->recur_by_provider( $params ); 210 210 } 211 211 return( $this->confirmation_code ); … … 213 213 214 214 public function post_process($params) { 215 $this->transaction = isset( $_REQUEST[ 'lowprofilecode'] ) ? $_REQUEST['lowprofilecode'] : $params[ 'transaction_id' ];215 $this->transaction = isset( $_REQUEST[ 'lowprofilecode' ] ) ? $_REQUEST[ 'lowprofilecode' ] : $params[ 'transaction_id' ]; 216 216 $response = $_REQUEST; 217 217 $this->save([ 218 218 'transaction_id' => $this->transaction, 219 219 'url' => ':post_process', 220 'status' => isset($response[ 'ResponseCode']) ? $response['ResponseCode'] : $response['response_code'],221 'description' => isset($response[ 'Description']) ? $response['Description'] : null,220 'status' => isset($response[ 'ResponseCode' ]) ? $response[ 'ResponseCode' ] : $response[ 'response_code' ], 221 'description' => isset($response[ 'Description' ]) ? $response[ 'Description' ] : null, 222 222 'request' => json_encode($params), 223 223 'response' => json_encode($response) 224 224 ]); 225 if ($params[ 'Operation'] == 2 && isset($params['payments']) && $params['payments'] == "monthly") {226 if ($this->param( 'recurr_at') == 'post' && $this->param('reurring') == 'provider') return($this->recur_by_provider($params));225 if ($params[ 'Operation' ] == 2 && isset($params[ 'payments' ]) && $params[ 'payments' ] == "monthly") { 226 if ($this->param( 'recurr_at' ) == 'post' && $this->param( 'reurring' ) == 'provider' ) return($this->recur_by_provider($params) ); 227 227 } 228 228 // TODO: update confirmation code con status 229 //$this->confirmation_code = $response[ 'confirmation_code'];229 //$this->confirmation_code = $response[ 'confirmation_code' ]; 230 230 return( $_REQUEST[ 'ResponeCode' ] == 0 ); 231 231 } … … 254 254 $post[ 'APILevel' ] = $this->api[ 'version' ]; 255 255 if ( !$this->sandbox ) { 256 $post[ 'TerminalNumber' ] = $this->param_part( $params );257 $post[ 'UserName' ] = $this->param_part( $params, 'username' );258 // $this->password = $this->param_part($params, 'password' );259 // $post[ 'Password'] = $this->password;256 $post[ 'TerminalNumber' ] = $this->param_part( $params ); 257 $post[ 'UserName' ] = $this->param_part( $params, 'username' ); 258 // $this->password = $this->param_part($params, 'password' ); 259 // $post[ 'Password' ] = $this->password; 260 260 } else { 261 261 $post[ 'TerminalNumber' ] = $this->terminal; … … 271 271 272 272 273 $post[ 'ProductName'] = $params['product'];274 $post[ 'SumToBill'] = $params['amount'];275 276 if (isset($params[SimplePayment::CARD_OWNER]) && $params[SimplePayment::CARD_OWNER]) $post[ 'CardOwnerName'] = $params[SimplePayment::CARD_OWNER];277 if (!isset($post[ 'CardOwnerName']) && isset($params['full_name']) && $params['full_name']) $post['CardOwnerName'] = $params['full_name']; // card_holder278 279 if (isset($params[ 'phone']) && $params['phone']) $post['CardOwnerPhone'] = $params['phone'];280 if (isset($params[ 'email']) && $params['email']) $post['CardOwnerEmail'] = $params['email'];281 282 if (isset($params[ 'payment_id']) && $params['payment_id']) $post['ReturnValue'] = $params['payment_id'];283 284 $post[ 'codepage'] = 65001; // Codepage fixed to enable hebrew285 $currency = isset( $params[SimplePayment::CURRENCY]) && $params[SimplePayment::CURRENCY] ? $params[SimplePayment::CURRENCY] : $this->param('currency');286 if ( $currency) {287 if ( $currency = self::CURRENCIES[$currency]) $post['CoinID'] = $currency;288 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500);289 } 290 291 $language = isset( $params['language']) ? $params['language'] : $this->param('language');292 if ($language != '' ) $post['Language'] = $language;273 $post[ 'ProductName' ] = $params[ 'product' ]; 274 $post[ 'SumToBill' ] = $params[ 'amount' ]; 275 276 if (isset($params[SimplePayment::CARD_OWNER]) && $params[SimplePayment::CARD_OWNER]) $post[ 'CardOwnerName' ] = $params[SimplePayment::CARD_OWNER]; 277 if (!isset($post[ 'CardOwnerName' ]) && isset($params[ 'full_name' ]) && $params[ 'full_name' ]) $post[ 'CardOwnerName' ] = $params[ 'full_name' ]; // card_holder 278 279 if (isset($params[ 'phone' ]) && $params[ 'phone' ]) $post[ 'CardOwnerPhone' ] = $params[ 'phone' ]; 280 if (isset($params[ 'email' ]) && $params[ 'email' ]) $post[ 'CardOwnerEmail' ] = $params[ 'email' ]; 281 282 if (isset($params[ 'payment_id' ]) && $params[ 'payment_id' ]) $post[ 'ReturnValue' ] = $params[ 'payment_id' ]; 283 284 $post[ 'codepage' ] = 65001; // Codepage fixed to enable hebrew 285 $currency = isset( $params[ SimplePayment::CURRENCY ] ) && $params[ SimplePayment::CURRENCY ] ? $params[ SimplePayment::CURRENCY ] : $this->param( 'currency' ); 286 if ( $currency ) { 287 if ( $currency = self::CURRENCIES[ $currency ] ) $post[ 'CoinID' ] = $currency; 288 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500 ); 289 } 290 291 $language = isset( $params[ 'language' ] ) ? $params[ 'language' ] : $this->param( 'language' ); 292 if ($language != '' ) $post[ 'Language' ] = $language; 293 293 294 294 if ( !isset( $params[ 'payments' ] ) || ( isset( $params[ 'payments' ] ) && $params[ 'payments' ] ) ) { … … 302 302 } 303 303 304 $post[ 'SuccessRedirectUrl'] = $this->url(SimplePayment::OPERATION_SUCCESS, $params);305 $post[ 'ErrorRedirectUrl'] = $this->url(SimplePayment::OPERATION_ERROR, $params);306 $post[ 'IndicatorUrl'] = $this->url(SimplePayment::OPERATION_STATUS, $params);307 $post[ 'CancelUrl'] = $this->url(SimplePayment::OPERATION_CANCEL, $params);308 if ( $this->param('css') != '') $post[ 'CSSUrl' ] = $this->callback.(strpos($this->callback, '?') !== false ? '&' : '?').'op=css';309 310 $post[ 'CancelType'] = $this->cancelType;311 312 $creditType = $this->param( 'credit_type');313 if ( $creditType != '') $post['CreditType'] = $creditType;314 315 $show = $this->param( 'show_invoice_operation');316 if ( $operation != 3 && $show != '') $post['InvoiceHeadOperation'] = $operation == 3 ? 0 : $show;317 318 $show = $this->param( 'show_invoice_info');319 if ( $operation != 3 && $show != '') $post['ShowInvoiceHead'] = $show;320 321 $docType = $this->param( 'doc_type');322 if ( $operation != 3 && $docType != '') $post['DocTypeToCreate'] = $docType;323 324 $field = $this->param( 'field_name');325 if ( $field != '') {326 $post[ 'HideCardOwnerName'] = $field == 'hide' ? 'true' : 'false';327 } 328 329 $field = $this->param( 'field_phone');330 if ( $field != '') {331 $post[ 'ReqCardOwnerPhone'] = $field == 'require' ? 'true' : 'false';332 $post[ 'ShowCardOwnerPhone'] = $field == 'show' || $field == 'require' ? 'true' : 'false';333 } 334 335 $field = $this->param( 'field_email');336 if ( $field != '') {337 $post[ 'ReqCardOwnerEmail'] = $field == 'require' ? 'true' : 'false';338 $post[ 'ShowCardOwnerEmail'] = $field == 'show' || $field == 'require' ? 'true' : 'false';304 $post[ 'SuccessRedirectUrl' ] = $this->url( SimplePayment::OPERATION_SUCCESS, $params ); 305 $post[ 'ErrorRedirectUrl' ] = $this->url( SimplePayment::OPERATION_ERROR, $params ); 306 $post[ 'IndicatorUrl' ] = $this->url( SimplePayment::OPERATION_STATUS, $params ); 307 $post[ 'CancelUrl' ] = $this->url( SimplePayment::OPERATION_CANCEL, $params ); 308 if ( $this->param( 'css' ) != '' ) $post[ 'CSSUrl' ] = $this->callback . ( strpos( $this->callback, '?' ) !== false ? '&' : '?' ) . 'op=css'; 309 310 $post[ 'CancelType' ] = $this->cancelType; 311 312 $creditType = $this->param( 'credit_type' ); 313 if ( $creditType != '' ) $post[ 'CreditType' ] = $creditType; 314 315 $show = $this->param( 'show_invoice_operation' ); 316 if ( $operation != 3 && $show != '' ) $post[ 'InvoiceHeadOperation' ] = $operation == 3 ? 0 : $show; 317 318 $show = $this->param( 'show_invoice_info' ); 319 if ( $operation != 3 && $show != '' ) $post[ 'ShowInvoiceHead' ] = $show; 320 321 $docType = $this->param( 'doc_type' ); 322 if ( $operation != 3 && $docType != '' ) $post[ 'DocTypeToCreate' ] = $docType; 323 324 $field = $this->param( 'field_name' ); 325 if ( $field != '' ) { 326 $post[ 'HideCardOwnerName' ] = $field == 'hide' ? 'true' : 'false'; 327 } 328 329 $field = $this->param( 'field_phone' ); 330 if ( $field != '' ) { 331 $post[ 'ReqCardOwnerPhone' ] = $field == 'require' ? 'true' : 'false'; 332 $post[ 'ShowCardOwnerPhone' ] = $field == 'show' || $field == 'require' ? 'true' : 'false'; 333 } 334 335 $field = $this->param( 'field_email' ); 336 if ( $field != '' ) { 337 $post[ 'ReqCardOwnerEmail' ] = $field == 'require' ? 'true' : 'false'; 338 $post[ 'ShowCardOwnerEmail' ] = $field == 'show' || $field == 'require' ? 'true' : 'false'; 339 339 } 340 340 341 if ( (!isset($params['payments']) || $params['payments'] != "monthly") && $this->param('hide_user_id')) $post['HideCreditCardUserId'] = $this->param('hide_user_id') == 'true' ? 'true' : 'false';342 343 if ( $operation != 3 && isset($params['company']) && $params['company']) $post['InvoiceHead.CustName'] = $params['company'];344 if ( $operation != 3 && !isset($post['InvoiceHead.CustName']) && isset($params['full_name']) && $params['full_name']) $post['InvoiceHead.CustName'] = $params['full_name'];345 if ( $operation != 3) $post = array_merge($post, $this->document(array_merge($params, ['language' => $language, 'currency' => $currency])));341 if ( ( !isset( $params[ 'payments' ]) || $params[ 'payments' ] != "monthly" ) && $this->param( 'hide_user_id' ) ) $post[ 'HideCreditCardUserId' ] = $this->param( 'hide_user_id' ) == 'true' ? 'true' : 'false'; 342 343 if ( $operation != 3 && isset( $params[ 'company' ]) && $params[ 'company' ]) $post[ 'InvoiceHead.CustName' ] = $params[ 'company' ]; 344 if ( $operation != 3 && !isset( $post[ 'InvoiceHead.CustName' ]) && isset( $params[ 'full_name' ]) && $params[ 'full_name' ]) $post[ 'InvoiceHead.CustName' ] = $params[ 'full_name' ]; 345 if ( $operation != 3 ) $post = array_merge( $post, $this->document( array_merge( $params, [ 'language' => $language, 'currency' => $currency ] ) )); 346 346 347 347 // TODO: Analyze how to use those parameters … … 365 365 // SuspendedDealJValidateType 366 366 // SuspendedDealGroup 367 $status = $this->post( $this->api['payment_request'], $post);368 parse_str( $status, $status);369 $status[ 'url'] = $this->param('method') == 'paypal' ? $status['PayPalUrl'] : $status['url'];370 $this->transaction = $this->transaction ? : $status[ 'LowProfileCode'];367 $status = $this->post( $this->api[ 'payment_request' ], $post ); 368 parse_str( $status, $status ); 369 $status[ 'url' ] = $this->param( 'method' ) == 'paypal' ? $status[ 'PayPalUrl' ] : $status[ 'url' ]; 370 $this->transaction = $this->transaction ? : $status[ 'LowProfileCode' ]; 371 371 $response = $status; 372 $this->save( [372 $this->save( [ 373 373 'transaction_id' => $this->transaction, 374 'url' => $this->api[ 'payment_request'],375 'status' => isset( $response['ResponseCode']) ? $response['ResponseCode'] : $response['response_code'],376 'description' => isset( $response['Description']) ? $response['Description'] : null,377 'request' => json_encode( $post),378 'response' => json_encode( $response)379 ] );380 if ( isset($status['LowProfileCode']) && $status['LowProfileCode']) $this->transaction = $status['LowProfileCode'];381 if ( isset($status['ResponseCode']) && $status['ResponseCode'] != 0) {382 throw new Exception( $status['Description'], $status['ResponseCode']);383 } 384 return( $response);374 'url' => $this->api[ 'payment_request' ], 375 'status' => isset( $response[ 'ResponseCode' ]) ? $response[ 'ResponseCode' ] : $response[ 'response_code' ], 376 'description' => isset( $response[ 'Description' ]) ? $response[ 'Description' ] : null, 377 'request' => json_encode( $post ), 378 'response' => json_encode( $response ) 379 ] ); 380 if ( isset( $status[ 'LowProfileCode' ] ) && $status[ 'LowProfileCode' ] ) $this->transaction = $status[ 'LowProfileCode' ]; 381 if ( isset( $status[ 'ResponseCode' ] ) && $status[ 'ResponseCode' ] != 0 ) { 382 throw new Exception( $status[ 'Description' ], $status[ 'ResponseCode' ] ); 383 } 384 return( $response ); 385 385 } 386 386 … … 389 389 390 390 if (!$this->sandbox) { 391 $post[ 'TerminalNumber'] = $this->param_part($params);392 $post[ 'UserName'] = $this->param_part($params, 'username');393 $terminals = $this->param( 'terminal');394 $terminals = explode( ';', $terminals);391 $post[ 'TerminalNumber' ] = $this->param_part($params); 392 $post[ 'UserName' ] = $this->param_part($params, 'username' ); 393 $terminals = $this->param( 'terminal' ); 394 $terminals = explode( ';', $terminals); 395 395 } else { 396 $post[ 'TerminalNumber'] = $this->terminal;397 $post[ 'UserName'] = $this->username;398 } 399 400 if ($this->param( 'recurring_terminal')) $post['RecurringPayments.ChargeInTerminal'] = $this->param('recurring_terminal');401 $post[ 'Operation'] = $this->param('reurring_operation');402 $post[ 'LowProfileDealGuid'] = isset($params['lowprofilecode']) ? $params['lowprofilecode'] : $params['transaction_id'];396 $post[ 'TerminalNumber' ] = $this->terminal; 397 $post[ 'UserName' ] = $this->username; 398 } 399 400 if ($this->param( 'recurring_terminal' ) ) $post[ 'RecurringPayments.ChargeInTerminal' ] = $this->param( 'recurring_terminal' ); 401 $post[ 'Operation' ] = $this->param( 'reurring_operation' ); 402 $post[ 'LowProfileDealGuid' ] = isset($params[ 'lowprofilecode' ]) ? $params[ 'lowprofilecode' ] : $params[ 'transaction_id' ]; 403 403 404 if ($this->param( 'department_id')) $post['RecurringPayments.DepartmentId'] = $this->param('department_id');405 //if (isset($params[ 'payment_id']) && $params['payment_id']) $post['Account.SiteUniqueId'] = $params['payment_id'];406 407 if (isset($params[ 'payment_id']) && $params['payment_id']) $post['RecurringPayments.ReturnValue'] = $params['payment_id'];408 409 $post[ 'RecurringPayments.FlexItem.Price'] = $params['amount'];410 $post[ 'RecurringPayments.FlexItem.InvoiceDescription'] = isset($params['product']) ? $params['product'] : $params['concept'];411 $post[ 'RecurringPayments.InternalDecription'] = isset($params['product']) ? $params['product'] : $params['concept'];404 if ($this->param( 'department_id' ) ) $post[ 'RecurringPayments.DepartmentId' ] = $this->param( 'department_id' ); 405 //if (isset($params[ 'payment_id' ]) && $params[ 'payment_id' ]) $post[ 'Account.SiteUniqueId' ] = $params[ 'payment_id' ]; 406 407 if (isset($params[ 'payment_id' ]) && $params[ 'payment_id' ]) $post[ 'RecurringPayments.ReturnValue' ] = $params[ 'payment_id' ]; 408 409 $post[ 'RecurringPayments.FlexItem.Price' ] = $params[ 'amount' ]; 410 $post[ 'RecurringPayments.FlexItem.InvoiceDescription' ] = isset($params[ 'product' ]) ? $params[ 'product' ] : $params[ 'concept' ]; 411 $post[ 'RecurringPayments.InternalDecription' ] = isset($params[ 'product' ]) ? $params[ 'product' ] : $params[ 'concept' ]; 412 412 413 413 if (isset($params[SimplePayment::CARD_OWNER]) && $params[SimplePayment::CARD_OWNER]) { 414 $post[ 'Account.ContactName'] = $params[SimplePayment::CARD_OWNER];415 } 416 if (!isset($post[ 'CardOwnerName']) && isset($params['full_name']) && $params['full_name']) {417 $post[ 'Account.ContactName'] = $params['full_name']; // card_holder418 } 419 420 if (isset($params[ 'first_name']) && $params['first_name']) $post['Account.FirstName'] = $params['first_name'];421 if (isset($params[ 'last_name']) && $params['last_name']) $post['Account.FirstName'] = (isset($post['Account.FirstName']) && $post['Account.FirstName'] ? ' ' : '').$params['last_name'];422 423 if (isset($params[ 'phone']) && $params['phone']) $post['Account.PhLine'] = $params['phone'];424 if (isset($params[ 'mobile']) && $params['mobile']) $post['Account.PhMobile'] = $params['mobile'];425 if (isset($params[ 'email']) && $params['email']) $post['Account.Email'] = $params['email'];426 427 if (isset($params[ 'address']) && $params['address']) $post['Account.Street1'] = $params['address'];428 if (isset($params[ 'address2']) && $params['address2']) $post['Account.Street2'] = $params['address2'];429 if (isset($params[ 'zipcode']) && $params['zipcode']) $post['Account.ZipCode'] = $params['zipcode'];430 if (isset($params[ 'city']) && $params['city']) $post['Account.City'] = $params['city'];431 432 if (isset($params[ 'comment']) && $params['comment']) $post['Account.Comments'] = $params['comment'];433 434 if (isset($params[ 'tax_id']) && $params['tax_id']) $post['Account.RegisteredBusinessNumber'] = $params['tax_id'];435 436 if ($this->param( 'vat_free')) $post['Account.VatFree'] = 'true';437 438 $language = isset($params[ 'language']) ? $params['language'] : $this->param('language');439 if ($language != '' ) $post['Account.IsDocumentLangEnglish'] = $language == 'he' ? 'false' : 'true';440 441 $currency = isset($params[ 'currency']) && $params['currency'] ? $params['currency'] : $this->param('currency');442 if ($currency != '' ) {443 if ($currency = self::CURRENCIES[$currency]) $post[ 'RecurringPayments.FinalDebitCoinId'] = $currency;444 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500);445 } 446 447 $post[ 'codepage'] = 65001; // Codepage fixed to enable hebrew414 $post[ 'Account.ContactName' ] = $params[SimplePayment::CARD_OWNER]; 415 } 416 if (!isset($post[ 'CardOwnerName' ]) && isset($params[ 'full_name' ]) && $params[ 'full_name' ]) { 417 $post[ 'Account.ContactName' ] = $params[ 'full_name' ]; // card_holder 418 } 419 420 if (isset($params[ 'first_name' ]) && $params[ 'first_name' ]) $post[ 'Account.FirstName' ] = $params[ 'first_name' ]; 421 if (isset($params[ 'last_name' ]) && $params[ 'last_name' ]) $post[ 'Account.FirstName' ] = (isset($post[ 'Account.FirstName' ]) && $post[ 'Account.FirstName' ] ? ' ' : '' ).$params[ 'last_name' ]; 422 423 if (isset($params[ 'phone' ]) && $params[ 'phone' ]) $post[ 'Account.PhLine' ] = $params[ 'phone' ]; 424 if (isset($params[ 'mobile' ]) && $params[ 'mobile' ]) $post[ 'Account.PhMobile' ] = $params[ 'mobile' ]; 425 if (isset($params[ 'email' ]) && $params[ 'email' ]) $post[ 'Account.Email' ] = $params[ 'email' ]; 426 427 if (isset($params[ 'address' ]) && $params[ 'address' ]) $post[ 'Account.Street1' ] = $params[ 'address' ]; 428 if (isset($params[ 'address2' ]) && $params[ 'address2' ]) $post[ 'Account.Street2' ] = $params[ 'address2' ]; 429 if (isset($params[ 'zipcode' ]) && $params[ 'zipcode' ]) $post[ 'Account.ZipCode' ] = $params[ 'zipcode' ]; 430 if (isset($params[ 'city' ]) && $params[ 'city' ]) $post[ 'Account.City' ] = $params[ 'city' ]; 431 432 if (isset($params[ 'comment' ]) && $params[ 'comment' ]) $post[ 'Account.Comments' ] = $params[ 'comment' ]; 433 434 if (isset($params[ 'tax_id' ]) && $params[ 'tax_id' ]) $post[ 'Account.RegisteredBusinessNumber' ] = $params[ 'tax_id' ]; 435 436 if ($this->param( 'vat_free' ) ) $post[ 'Account.VatFree' ] = 'true'; 437 438 $language = isset($params[ 'language' ]) ? $params[ 'language' ] : $this->param( 'language' ); 439 if ($language != '' ) $post[ 'Account.IsDocumentLangEnglish' ] = $language == 'he' ? 'false' : 'true'; 440 441 $currency = isset($params[ 'currency' ]) && $params[ 'currency' ] ? $params[ 'currency' ] : $this->param( 'currency' ); 442 if ($currency != '' ) { 443 if ($currency = self::CURRENCIES[$currency]) $post[ 'RecurringPayments.FinalDebitCoinId' ] = $currency; 444 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500); 445 } 446 447 $post[ 'codepage' ] = 65001; // Codepage fixed to enable hebrew 448 448 // month from now 28 days 449 449 $date = new DateTime(); 450 $date->add(new DateInterval( 'P28D')); // P1D means a period of 28 day451 $post[ 'RecurringPayments.NextDateToBill'] = $date->format('d/m/Y');450 $date->add(new DateInterval( 'P28D' ) ); // P1D means a period of 28 day 451 $post[ 'RecurringPayments.NextDateToBill' ] = $date->format( 'd/m/Y' ); 452 452 453 453 $limit = $this->param( 'recurring_total' ); 454 $post[ 'RecurringPayments.TotalNumOfBills'] = $limit ? : 999999;455 456 $interval = $this->param( 'recurring_interval');457 if ($interval) $post[ 'TimeIntervalId'] = $interval;454 $post[ 'RecurringPayments.TotalNumOfBills' ] = $limit ? : 999999; 455 456 $interval = $this->param( 'recurring_interval' ); 457 if ($interval) $post[ 'TimeIntervalId' ] = $interval; 458 458 459 $docType = $this->param( 'doc_type');460 if ($docType != '' ) $post['RecurringPayments.DocTypeToCreate'] = $docType;461 462 $post[ 'RecurringPayments.FlexItem.IsPriceIncludeVat'] = 'true'; // Must be true - API requirement459 $docType = $this->param( 'doc_type' ); 460 if ($docType != '' ) $post[ 'RecurringPayments.DocTypeToCreate' ] = $docType; 461 462 $post[ 'RecurringPayments.FlexItem.IsPriceIncludeVat' ] = 'true'; // Must be true - API requirement 463 463 // TODO: assure to verifiy first_name / lasstname or use full name 464 if (isset($params[ 'full_name']) && trim($params['full_name'])) $post['Account.CompanyName'] = trim($params['full_name']);465 if (!isset($post[ 'Account.CompanyName']) && isset($params['first_name']) && trim($params['first_name'])) $post['Account.CompanyName'] = trim($params['first_name'].(isset($params['last_name']) ? ' '.$params['last_name'] : ''));466 if (!isset($post[ 'Account.CompanyName']) && isset($params['last_name']) && trim($params['last_name'])) $post['Account.CompanyName'] = trim($params['last_name']);467 if (isset($params[ 'company']) && trim($params['company'])) $post['Account.CompanyName'] = trim($params['company']);464 if (isset($params[ 'full_name' ]) && trim($params[ 'full_name' ]) ) $post[ 'Account.CompanyName' ] = trim($params[ 'full_name' ]); 465 if (!isset($post[ 'Account.CompanyName' ]) && isset($params[ 'first_name' ]) && trim($params[ 'first_name' ]) ) $post[ 'Account.CompanyName' ] = trim($params[ 'first_name' ].(isset($params[ 'last_name' ]) ? ' '.$params[ 'last_name' ] : '' ) ); 466 if (!isset($post[ 'Account.CompanyName' ]) && isset($params[ 'last_name' ]) && trim($params[ 'last_name' ]) ) $post[ 'Account.CompanyName' ] = trim($params[ 'last_name' ]); 467 if (isset($params[ 'company' ]) && trim($params[ 'company' ]) ) $post[ 'Account.CompanyName' ] = trim($params[ 'company' ]); 468 468 // Not in use: 469 469 // Account.AccountId , … … 471 471 // Account.ForeignAccountNumber , RecurringPayments.IsActive 472 472 // BankInfo.Bank BankInfo.Branch BankInfo.AccountNumber BankInfo.Description 473 $status = $this->post($this->api[ 'recurring_request'], $post);473 $status = $this->post($this->api[ 'recurring_request' ], $post); 474 474 parse_str($status, $status); 475 475 $response = $status; 476 476 $this->save([ 477 477 'transaction_id' => $this->transaction, 478 'url' => $this->api[ 'recurring_request'],479 'status' => isset($response[ 'ResponseCode']) ? $response['ResponseCode'] : $response['response_code'],480 'description' => isset($response[ 'Description']) ? $response['Description'] : null,478 'url' => $this->api[ 'recurring_request' ], 479 'status' => isset($response[ 'ResponseCode' ]) ? $response[ 'ResponseCode' ] : $response[ 'response_code' ], 480 'description' => isset($response[ 'Description' ]) ? $response[ 'Description' ] : null, 481 481 'request' => json_encode($post), 482 482 'response' => json_encode($response) … … 499 499 public function recur( $params ) { 500 500 $this->transaction = self::uuid(); 501 //$this->transaction = $params[ 'transaction_id'];501 //$this->transaction = $params[ 'transaction_id' ]; 502 502 $this->confirmation_code = $this->charge( $params ); 503 503 return( $this->confirmation_code ); … … 509 509 $post[ 'terminalnumber' ] = $this->param_part( $params ); 510 510 $post[ 'username' ] = $this->param_part( $params, 'username' ); 511 // $post[ 'TokenToCharge.UserPassword'] = $this->param_part($params, 'password');511 // $post[ 'TokenToCharge.UserPassword' ] = $this->param_part($params, 'password' ); 512 512 } else { 513 513 $post[ 'terminalnumber' ] = $this->terminal; … … 515 515 } 516 516 517 if ($refund) $post[ 'TokenToCharge.UserPassword'] = $this->password;518 519 $token = $params[ 'token'] ? json_decode($params['token'], true) : null;517 if ($refund) $post[ 'TokenToCharge.UserPassword' ] = $this->password; 518 519 $token = $params[ 'token' ] ? json_decode($params[ 'token' ], true) : null; 520 520 if ($token) { 521 $post[ 'TokenToCharge.Token'] = $token['token'];//$this->transaction;522 if (isset($token[SimplePayment::CARD_EXPIRY_YEAR]) ) $post['TokenToCharge.CardValidityYear'] = $token[SimplePayment::CARD_EXPIRY_YEAR];523 if (isset($token[SimplePayment::CARD_EXPIRY_MONTH]) ) $post['TokenToCharge.CardValidityMonth'] = $token[SimplePayment::CARD_EXPIRY_MONTH];524 if (isset($token[SimplePayment::CARD_OWNER_ID]) ) $post['TokenToCharge.IdentityNumber'] = $token[SimplePayment::CARD_OWNER_ID];525 } 526 $post[ 'TokenToCharge.SumToBill'] = $params['amount'];527 528 $currency = isset($params[SimplePayment::CURRENCY]) && $params[SimplePayment::CURRENCY] ? $params[SimplePayment::CURRENCY] : $this->param( 'currency');529 if ($currency != '' ) {530 if ($currency = self::CURRENCIES[$currency]) $post[ 'CoinID'] = $currency;531 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500);532 } 533 534 $post[ 'TokenToCharge.CoinID'] = $currency;535 536 537 538 539 $language = $this->param( 'language');540 if ($language != '' ) $post['Language'] = $language;521 $post[ 'TokenToCharge.Token' ] = $token[ 'token' ];//$this->transaction; 522 if (isset($token[SimplePayment::CARD_EXPIRY_YEAR]) ) $post[ 'TokenToCharge.CardValidityYear' ] = $token[SimplePayment::CARD_EXPIRY_YEAR]; 523 if (isset($token[SimplePayment::CARD_EXPIRY_MONTH]) ) $post[ 'TokenToCharge.CardValidityMonth' ] = $token[SimplePayment::CARD_EXPIRY_MONTH]; 524 if (isset($token[SimplePayment::CARD_OWNER_ID]) ) $post[ 'TokenToCharge.IdentityNumber' ] = $token[SimplePayment::CARD_OWNER_ID]; 525 } 526 $post[ 'TokenToCharge.SumToBill' ] = $params[ 'amount' ]; 527 528 $currency = isset($params[SimplePayment::CURRENCY]) && $params[SimplePayment::CURRENCY] ? $params[SimplePayment::CURRENCY] : $this->param( 'currency' ); 529 if ($currency != '' ) { 530 if ($currency = self::CURRENCIES[$currency]) $post[ 'CoinID' ] = $currency; 531 else throw new Exception( 'CURRENCY_NOT_SUPPORTED_BY_ENGINE', 500); 532 } 533 534 $post[ 'TokenToCharge.CoinID' ] = $currency; 535 536 537 538 539 $language = $this->param( 'language' ); 540 if ($language != '' ) $post[ 'Language' ] = $language; 541 541 542 542 // TokenToCharge.CardOwnerName … … 547 547 548 548 549 if ($refund) $post[ 'TokenToCharge.RefundInsteadOfCharge'] = $refund;550 if ($params[ 'PAYMENTS'] == 'monthly') $post['TokenToCharge.IsAutoRecurringPayment'] = 'true';551 552 if (isset($params[ 'approval_number']) && $params['approval_number']) $post['TokenToCharge.ApprovalNumber'] = $params['approval_number'];553 554 555 // $post = array_merge($post, $this->document(array_merge($params, [ 'language' => $language, 'currency' => $currency])));556 557 $status = $this->post($this->api[ 'payment_recur'], $post);549 if ($refund) $post[ 'TokenToCharge.RefundInsteadOfCharge' ] = $refund; 550 if ($params[ 'PAYMENTS' ] == 'monthly' ) $post[ 'TokenToCharge.IsAutoRecurringPayment' ] = 'true'; 551 552 if (isset($params[ 'approval_number' ]) && $params[ 'approval_number' ]) $post[ 'TokenToCharge.ApprovalNumber' ] = $params[ 'approval_number' ]; 553 554 555 // $post = array_merge($post, $this->document(array_merge($params, [ 'language' => $language, 'currency' => $currency]) )); 556 557 $status = $this->post($this->api[ 'payment_recur' ], $post); 558 558 parse_str($status, $status); 559 559 $response = $status; 560 560 $this->save([ 561 561 'transaction_id' => $this->transaction, 562 'url' => $this->api[ 'payment_recur'],563 'status' => isset($response[ 'ResponseCode']) ? $response['ResponseCode'] : $response['response_code'],564 'description' => isset($response[ 'Description']) ? $response['Description'] : null,562 'url' => $this->api[ 'payment_recur' ], 563 'status' => isset($response[ 'ResponseCode' ]) ? $response[ 'ResponseCode' ] : $response[ 'response_code' ], 564 'description' => isset($response[ 'Description' ]) ? $response[ 'Description' ] : null, 565 565 'request' => json_encode($post), 566 566 'response' => json_encode($response), … … 568 568 ]); 569 569 // InternalDealNumber 570 return($response[ 'ResponseCode'] == 0 ? $response['InternalDealNumber'] : false);570 return($response[ 'ResponseCode' ] == 0 ? $response[ 'InternalDealNumber' ] : false); 571 571 // Not in use: 572 572 // TokenToCharge.Salt, TokenToCharge.SumInStars, TokenToCharge.NumOfPayments … … 581 581 protected function document($params) { 582 582 $post = []; 583 $language = $this->param( 'language');584 $currency = isset($params[SimplePayment::CURRENCY]) ? $params[SimplePayment::CURRENCY] : $this->param( 'currency');585 if ($language) $post[ 'InvoiceHead.Languge'] = $params['language'];586 if ($currency) $post[ 'InvoiceHead.CoinID'] = $params['currency'];587 588 if (isset($params[ 'email']) && $params['email']) $post['InvoiceHead.Email'] = $params['email'];583 $language = $this->param( 'language' ); 584 $currency = isset($params[SimplePayment::CURRENCY]) ? $params[SimplePayment::CURRENCY] : $this->param( 'currency' ); 585 if ($language) $post[ 'InvoiceHead.Languge' ] = $params[ 'language' ]; 586 if ($currency) $post[ 'InvoiceHead.CoinID' ] = $params[ 'currency' ]; 587 588 if (isset($params[ 'email' ]) && $params[ 'email' ]) $post[ 'InvoiceHead.Email' ] = $params[ 'email' ]; 589 589 590 if (!$this->param( 'doc_details') || in_array($this->param('doc_details'), ['address', 'full'])) {591 if (isset($params[ 'address']) && $params['address']) $post['InvoiceHead.CustAddresLine1'] = $params['address'];592 if (isset($params[ 'address2']) && $params['address2']) $post['InvoiceHead.CustAddresLine2'] = $params['address2'];593 if (isset($params[ 'city']) && $params['city']) $post['InvoiceHead.CustCity'] = $params['city'];594 } 595 if (!$this->param( 'doc_details') || in_array($this->param('doc_details'), ['contact', 'full'])) {596 if (isset($params[ 'phone']) && $params['phone']) $post['InvoiceHead.CustLinePH'] = $params['phone'];597 if (isset($params[ 'mobile']) && $params['mobile']) $post['InvoiceHead.CustMobilePH'] = $params['mobile'];598 } 599 600 if (isset($params[ 'tax_id']) && $params['tax_id']) $post['InvoiceHead.CompID'] = $params['tax_id'];601 if (isset($params[ 'comment']) && $params['comment']) $post['InvoiceHead.Comments'] = $params['comment'];602 if ($this->param( 'email_invoice')) $post['InvoiceHead.SendByEmail'] = 'true';603 if ($this->param( 'vat_free')) $post['InvoiceHead.ExtIsVatFree'] = 'true';604 if ($this->param( 'auto_create_account')) $post['InvoiceHead.IsAutoCreateUpdateAccount'] = 'true';605 if ($this->param( 'auto_load_account')) $post['InvoiceHead.IsLoadInfoFromAccountID'] = 'true';606 if ($this->param( 'department_id')) $post['InvoiceHead.DepartmentId'] = $this->param('department_id');607 //if ( isset($params[ 'payment_id']) && $params['payment_id']) $post['InvoiceHead.SiteUniqueId'] = $params['payment_id'];590 if (!$this->param( 'doc_details' ) || in_array($this->param( 'doc_details' ), [ 'address', 'full' ]) ) { 591 if (isset($params[ 'address' ]) && $params[ 'address' ]) $post[ 'InvoiceHead.CustAddresLine1' ] = $params[ 'address' ]; 592 if (isset($params[ 'address2' ]) && $params[ 'address2' ]) $post[ 'InvoiceHead.CustAddresLine2' ] = $params[ 'address2' ]; 593 if (isset($params[ 'city' ]) && $params[ 'city' ]) $post[ 'InvoiceHead.CustCity' ] = $params[ 'city' ]; 594 } 595 if (!$this->param( 'doc_details' ) || in_array($this->param( 'doc_details' ), [ 'contact', 'full' ]) ) { 596 if (isset($params[ 'phone' ]) && $params[ 'phone' ]) $post[ 'InvoiceHead.CustLinePH' ] = $params[ 'phone' ]; 597 if (isset($params[ 'mobile' ]) && $params[ 'mobile' ]) $post[ 'InvoiceHead.CustMobilePH' ] = $params[ 'mobile' ]; 598 } 599 600 if (isset($params[ 'tax_id' ]) && $params[ 'tax_id' ]) $post[ 'InvoiceHead.CompID' ] = $params[ 'tax_id' ]; 601 if (isset($params[ 'comment' ]) && $params[ 'comment' ]) $post[ 'InvoiceHead.Comments' ] = $params[ 'comment' ]; 602 if ($this->param( 'email_invoice' ) ) $post[ 'InvoiceHead.SendByEmail' ] = 'true'; 603 if ($this->param( 'vat_free' ) ) $post[ 'InvoiceHead.ExtIsVatFree' ] = 'true'; 604 if ($this->param( 'auto_create_account' ) ) $post[ 'InvoiceHead.IsAutoCreateUpdateAccount' ] = 'true'; 605 if ($this->param( 'auto_load_account' ) ) $post[ 'InvoiceHead.IsLoadInfoFromAccountID' ] = 'true'; 606 if ($this->param( 'department_id' ) ) $post[ 'InvoiceHead.DepartmentId' ] = $this->param( 'department_id' ); 607 //if ( isset($params[ 'payment_id' ]) && $params[ 'payment_id' ]) $post[ 'InvoiceHead.SiteUniqueId' ] = $params[ 'payment_id' ]; 608 608 609 609 if ( isset( $params[ 'products' ] ) && is_array( $params[ 'products' ] ) ) { … … 615 615 $post[ 'InvoiceLines' . $index . '.Quantity' ] = $product[ 'qty' ]; 616 616 $post[ 'InvoiceLines' . $index . '.IsPriceIncludeVAT' ] = 'true'; // Must be true - API requirement 617 // TODO: support per item: $post[ 'InvoiceLines1.IsVatFree'] = 'true';617 // TODO: support per item: $post[ 'InvoiceLines1.IsVatFree' ] = 'true'; 618 618 if ( isset( $product[ 'id' ] ) && $product[ 'id' ] ) $post[ 'InvoiceLines' . $index . '.ProductID' ] = $product[ 'id' ]; 619 619 $index++; 620 620 } 621 621 } else { 622 $post[ 'InvoiceLines1.Description' ] = $params['product'];623 $post[ 'InvoiceLines1.Price' ] = $params['amount'];624 $post[ 'InvoiceLines1.Quantity' ] = 1;625 $post[ 'InvoiceLines1.IsPriceIncludeVAT' ] = 'true'; // Must be true - API requirement626 // TODO: support per item: $post[ 'InvoiceLines1.IsVatFree'] = 'true';622 $post[ 'InvoiceLines1.Description' ] = $params[ 'product' ]; 623 $post[ 'InvoiceLines1.Price' ] = $params[ 'amount' ]; 624 $post[ 'InvoiceLines1.Quantity' ] = 1; 625 $post[ 'InvoiceLines1.IsPriceIncludeVAT' ] = 'true'; // Must be true - API requirement 626 // TODO: support per item: $post[ 'InvoiceLines1.IsVatFree' ] = 'true'; 627 627 if ( isset( $params[ 'id' ] ) && $params[ 'id' ] ) $post[ 'InvoiceLines1.ProductID' ] = $params[ 'id' ]; 628 628 } … … 652 652 return($post); 653 653 } 654 655 //https://asmachta.co.il/?engine=Cardcom&payment_id=127046&redirect_url=https%3A%2F%2Fasmachta.co.il%2F%25d7%25a0%25d7%25a1%25d7%2597-%25d7%2598%25d7%2590%25d7%2591%25d7%2595%2F%3Fgf_simplepayment_return%3DaWRzPTJ8MTM0Nzk0Jmhhc2g9YWRkYmFjYmZiZGRjNDdlMTlkY2E1NzBiYjA0NmZkNzk&terminalnumber=125527&lowprofilecode=83fccd5d-6aed-4235-a1ab-62aceb769fad&ResponeCode=0&Operation=1&ResponseCode=0&Status=0 656 // Sanitize url for Cardcom, so we wont send cardcom parameters 657 public function url( $type, $params = null ) { 658 if ( $url = parent::url( $type, $params ) ) { 659 $parts = parse_url( $url ); 660 if ( isset( $parts[ 'query' ] ) ) { 661 parse_str( $parts[ 'query' ], $query ); 662 foreach ( [ 'terminalnumber', 'lowprofilecode', 'ResponeCode', 'Operation', 'ResponseCode', 'Status', 'DealRespone', 'InvoiceResponseCode', 'OperationResponse', 'OperationResponseText', 'ReturnValue' ] as $param ) { 663 unset( $query[ $param ] ); 664 } 665 $parts[ 'query' ] = http_build_query( $query ); 666 $url = $parts[ 'scheme' ] . '://' . $parts[ 'host' ]; 667 if ( isset( $parts[ 'port' ]) ) { 668 $url .= ':' . $parts[ 'port' ]; 669 } 670 if ( isset( $parts[ 'path' ] ) ) { 671 $url .= $parts[ 'path' ]; 672 } 673 if ( $parts[ 'query' ] ) { 674 $url .= '?' . $parts[ 'query' ]; 675 } 676 if ( isset( $parts[ 'fragment' ] ) ) { 677 $url .= '#' . $parts[ 'fragment' ]; 678 } 679 } 680 } 681 return( $url ); 682 } 654 683 655 684 } -
simple-payment/trunk/vendor/yalla-ya/simple-payment/Engines/Engine.php
r3318371 r3319619 137 137 public function url( $type, $params = null ) { 138 138 $url = $this->callback; 139 $qry = []; 139 $qry = [ 140 'op' => $type, 141 'engine' => static::$name 142 ]; 140 143 if ( strpos( $url, 'transaction_id' ) === false ) $qry[ 'transaction_id' ] = $this->transaction; 141 144 if ( isset( $params[ 'payments' ] ) && strpos( $url, 'payments' ) === false ) $qry[ 'payments' ] = $params[ 'payments' ]; … … 143 146 if ( isset( $params[ 'target' ] ) && strpos( $url, 'target' ) === false ) $qry[ 'target' ] = $params[ 'target' ]; 144 147 if ( isset( $params[ 'redirect_url' ] ) && strpos( $url, 'redirect_url' ) === false ) $qry[ 'redirect_url' ] = $params[ 'redirect_url' ]; 145 return( $url . ( strpos( $url, '?' ) ? '&' : '?' ) . 'op=' . $type . '&engine=' . static::$name .( $qry ? '&' . http_build_query( $qry ) : '' ) );148 return( $url . ( strpos( $url, '?' ) ? '&' : '?' ) . ( $qry ? '&' . http_build_query( $qry ) : '' ) ); 146 149 } 147 150
Note: See TracChangeset
for help on using the changeset viewer.