Skip to content

Commit

Permalink
Merge pull request #7 from secucard/release/v1.5.0
Browse files Browse the repository at this point in the history
Release/v1.5.0
  • Loading branch information
amommert authored Sep 1, 2017
2 parents 944a138 + f113798 commit 1c2682a
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 5 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ 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

Expand Down Expand Up @@ -345,4 +357,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
[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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 20 additions & 0 deletions src/SecucardConnect/Product/Loyalty/CardGroupsService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace SecucardConnect\Product\Loyalty;


use SecucardConnect\Client\ProductService;

class CardGroupsService extends ProductService
{
/**
* Check if a passcode is enabled for this card
* @param string $cardGroupId CRG_XYZ
* @param string $transactionType FORM_TRANSACTION_XYZ
* @param string $cardNumber Number of the card
* @return bool|null
*/
public function checkPasscodeEnabled($cardGroupId, $transactionType, $cardNumber) {
return $this->execute($cardGroupId, "checkPasscodeEnabled", null, ["action" => $transactionType, "cardnumber" => $cardNumber]);
}
}
18 changes: 18 additions & 0 deletions src/SecucardConnect/Product/Loyalty/MerchantCardsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
7 changes: 7 additions & 0 deletions src/SecucardConnect/Product/Loyalty/Model/CardGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
19 changes: 19 additions & 0 deletions src/SecucardConnect/Product/Loyalty/Model/MerchantCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -47,6 +51,16 @@ class MerchantCard extends BaseModel
*/
public $balance;

/**
* @var int
*/
public $cash_balance;

/**
* @var int
*/
public $bonus_balance;

/**
* @var int
*/
Expand All @@ -71,4 +85,9 @@ class MerchantCard extends BaseModel
* @var string
*/
public $lock_status;

/**
* @var int
*/
public $passcode;
}
10 changes: 9 additions & 1 deletion src/SecucardConnect/Product/Smart/IdentsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]]);
}
}
3 changes: 3 additions & 0 deletions src/SecucardConnect/Product/Smart/Model/Ident.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
*/
class Ident extends BaseModel
{
const TYPE_CARD = "card";
const TYPE_CHECKIN = "checkin";

/**
* @var string
*/
Expand Down
9 changes: 7 additions & 2 deletions src/SecucardConnect/Product/Smart/TransactionsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -22,14 +28,13 @@ 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.
*/
public function cancel($transactionId)
{
$res = $this->execute($transactionId, 'cancel', null, 'array');
return (bool)$res['result'];

}
}

0 comments on commit 1c2682a

Please sign in to comment.