From 00fbf96212b16df26fd5034babe2a2de7dcd1006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mommert?= Date: Fri, 1 Sep 2017 16:05:03 +0200 Subject: [PATCH] SCCON-127 --- CHANGELOG.md | 14 ++++++++++++- composer.json | 2 +- .../Product/Loyalty/CardGroupsService.php | 20 +++++++++++++++++++ .../Product/Loyalty/MerchantCardsService.php | 18 +++++++++++++++++ .../Product/Loyalty/Model/CardGroup.php | 7 +++++++ .../Product/Loyalty/Model/MerchantCard.php | 19 ++++++++++++++++++ .../Product/Smart/IdentsService.php | 10 +++++++++- .../Product/Smart/Model/Ident.php | 3 +++ .../Product/Smart/TransactionsService.php | 9 +++++++-- 9 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 src/SecucardConnect/Product/Loyalty/CardGroupsService.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 81ba87a..ba98547 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed +## [1.5.0] - 2017-09-01 + +### Added +- TransactionService: type of transactions +- IdentService: getCardInfo method +- Product Ident: types of login +- MerchantCardService: validateCSC +- MerchantCardService: validatePasscode +- CardGroupService: checkPasscodeEnabled +- Product CardGroup: type of transactions +- Product MerchantCard: status of passcode ## [1.4.1] - 2017-06-06 @@ -345,4 +356,5 @@ First release [1.1.2]:https://github.com/secucard/secucard-connect-php-sdk/compare/v1.1.1...v1.1.2 [1.3.1]:https://github.com/secucard/secucard-connect-php-sdk/compare/v1.1.2...v1.3.1 [1.4.0]:https://github.com/secucard/secucard-connect-php-sdk/compare/v1.3.1...v1.4.0 -[1.4.1]:https://github.com/secucard/secucard-connect-php-sdk/compare/v1.4.0...v1.4.1 \ No newline at end of file +[1.4.1]:https://github.com/secucard/secucard-connect-php-sdk/compare/v1.4.0...v1.4.1 +[1.5.0]:https://github.com/secucard/secucard-connect-php-sdk/compare/v1.4.1...v1.5.0 \ No newline at end of file diff --git a/composer.json b/composer.json index 12af197..64a91a5 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "secucard connect PHP client SDK", "license": "Apache-2.0", "homepage": "https://github.com/secucard/secucard-connect-php-sdk", - "version": "v1.4.1", + "version": "v1.5.0", "require": { "php": ">=5.5.0", "guzzlehttp/guzzle": "~6.2", diff --git a/src/SecucardConnect/Product/Loyalty/CardGroupsService.php b/src/SecucardConnect/Product/Loyalty/CardGroupsService.php new file mode 100644 index 0000000..8b03926 --- /dev/null +++ b/src/SecucardConnect/Product/Loyalty/CardGroupsService.php @@ -0,0 +1,20 @@ +execute($cardGroupId, "checkPasscodeEnabled", null, ["action" => $transactionType, "cardnumber" => $cardNumber]); + } +} \ No newline at end of file diff --git a/src/SecucardConnect/Product/Loyalty/MerchantCardsService.php b/src/SecucardConnect/Product/Loyalty/MerchantCardsService.php index b4c94e7..4ebbcec 100644 --- a/src/SecucardConnect/Product/Loyalty/MerchantCardsService.php +++ b/src/SecucardConnect/Product/Loyalty/MerchantCardsService.php @@ -11,5 +11,23 @@ */ class MerchantCardsService extends ProductService { + /** + * Check the given CSC + * @param string $cardNumber cardnumber + * @param int $csc CSC number + * @return bool|null| + */ + public function validateCSC($cardNumber, $csc) { + return $this->execute("me", "CheckCsc", null, ["cardnumber" => $cardNumber, "csc" => $csc]); + } + /** + * Check the given passcode + * @param string $cardNumber cardnumber + * @param int $pin PIN number + * @return bool|null + */ + public function validatePasscode($cardNumber, $pin) { + return $this->execute("me", "CheckPasscode", null, ["cardnumber" => $cardNumber, "pin" => $pin]); + } } \ No newline at end of file diff --git a/src/SecucardConnect/Product/Loyalty/Model/CardGroup.php b/src/SecucardConnect/Product/Loyalty/Model/CardGroup.php index 3f146a3..0bdd52c 100644 --- a/src/SecucardConnect/Product/Loyalty/Model/CardGroup.php +++ b/src/SecucardConnect/Product/Loyalty/Model/CardGroup.php @@ -7,6 +7,13 @@ class CardGroup extends BaseModel { + const TRANSACTION_TYPE_CHARGE = 'charge'; + const TRANSACTION_TYPE_DISCHARGE = 'discharge'; + const TRANSACTION_TYPE_SALE_REVENUE = 'sale_revenue'; + const TRANSACTION_TYPE_CHARGE_POINTS = 'charge_points'; + const TRANSACTION_TYPE_DISCHARGE_POINTS = 'discharge_points'; + const TRANSACTION_TYPE_CASHREPORT = 'cashreport'; + /** * @var string */ diff --git a/src/SecucardConnect/Product/Loyalty/Model/MerchantCard.php b/src/SecucardConnect/Product/Loyalty/Model/MerchantCard.php index df55752..bc3deac 100644 --- a/src/SecucardConnect/Product/Loyalty/Model/MerchantCard.php +++ b/src/SecucardConnect/Product/Loyalty/Model/MerchantCard.php @@ -7,6 +7,10 @@ class MerchantCard extends BaseModel { + const PASSCODE_STATUS_NOT_ENABLED = 1; + const PASSCODE_STATUS_NOT_SET = 2; + const PASSCODE_STATUS_SET = 3; + /** * @var \SecucardConnect\Product\General\Model\Merchant */ @@ -47,6 +51,16 @@ class MerchantCard extends BaseModel */ public $balance; + /** + * @var int + */ + public $cash_balance; + + /** + * @var int + */ + public $bonus_balance; + /** * @var int */ @@ -71,4 +85,9 @@ class MerchantCard extends BaseModel * @var string */ public $lock_status; + + /** + * @var int + */ + public $passcode; } \ No newline at end of file diff --git a/src/SecucardConnect/Product/Smart/IdentsService.php b/src/SecucardConnect/Product/Smart/IdentsService.php index 1c5824f..8f78ee5 100644 --- a/src/SecucardConnect/Product/Smart/IdentsService.php +++ b/src/SecucardConnect/Product/Smart/IdentsService.php @@ -7,5 +7,13 @@ class IdentsService extends ProductService { - + /** + * Returns all public information about the Loyalty card + * @param string $cardNumber The cardnumber of the Loyalty card + * @param string @var \SecucardConnect\Product\Smart\Model\Ident + * @return mixed|null|string + */ + public function getCardInfo($cardNumber, $type) { + return $this->execute("notused", "validate", null, [["value" => $cardNumber, "type" => $type]]); + } } \ No newline at end of file diff --git a/src/SecucardConnect/Product/Smart/Model/Ident.php b/src/SecucardConnect/Product/Smart/Model/Ident.php index 8c08978..26863dc 100644 --- a/src/SecucardConnect/Product/Smart/Model/Ident.php +++ b/src/SecucardConnect/Product/Smart/Model/Ident.php @@ -13,6 +13,9 @@ */ class Ident extends BaseModel { + const TYPE_CARD = "card"; + const TYPE_CHECKIN = "checkin"; + /** * @var string */ diff --git a/src/SecucardConnect/Product/Smart/TransactionsService.php b/src/SecucardConnect/Product/Smart/TransactionsService.php index e440fbd..3d51c71 100644 --- a/src/SecucardConnect/Product/Smart/TransactionsService.php +++ b/src/SecucardConnect/Product/Smart/TransactionsService.php @@ -9,6 +9,12 @@ class TransactionsService extends ProductService { + const TYPE_DEMO = "demo"; + const TYPE_CASH = "cash"; + const TYPE_AUTO = "auto"; + const TYPE_ZVT = "cashless"; + const TYPE_LOYALTY = "loyalty"; + /** * Starting/Executing a transaction. * @@ -22,7 +28,7 @@ public function start($transactionId, $type) } /** - * Cancel an existing transaction. + * Cancel an existing loyalty transaction. * @param string $transactionId The transaction id. * @return bool True if successful false else. */ @@ -30,6 +36,5 @@ public function cancel($transactionId) { $res = $this->execute($transactionId, 'cancel', null, 'array'); return (bool)$res['result']; - } } \ No newline at end of file