Skip to content

Commit

Permalink
prepare new paymen-api version
Browse files Browse the repository at this point in the history
  • Loading branch information
kokspflanze committed Nov 28, 2015
1 parent 6a137ed commit 3995041
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/PServerCMS/Entity/DonateLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class DonateLog

const TYPE_PAYMENT_WALL = 'paymentwall';
const TYPE_SUPER_REWARD = 'superreward';
const TYPE_XSOLLA = 'xsolla';
const TYPE_INTERNAL = 'internal';

const STATUS_SUCCESS = 1;
Expand Down
7 changes: 6 additions & 1 deletion src/PServerCMS/Entity/Repository/DonateLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ public function getDonationDataSuccess(\DateTime $dateTime)
->andWhere('p.type in (:type)')
->setParameter(
'type',
[Entity::TYPE_PAYMENT_WALL, Entity::TYPE_SUPER_REWARD],
[
Entity::TYPE_PAYMENT_WALL,
Entity::TYPE_SUPER_REWARD,
Entity::TYPE_XSOLLA,
],
\Doctrine\DBAL\Connection::PARAM_STR_ARRAY
)
->getQuery();
Expand All @@ -91,6 +95,7 @@ public function getDonateTypes()
return [
Entity::TYPE_PAYMENT_WALL,
Entity::TYPE_SUPER_REWARD,
Entity::TYPE_XSOLLA,
Entity::TYPE_INTERNAL
];
}
Expand Down
29 changes: 29 additions & 0 deletions src/PServerCMS/Service/PaymentValidation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php


namespace PServerCMS\Service;

use PaymentAPI\Service\Validation;

class PaymentValidation extends Validation
{

/**
* @param $userId
* @return bool
*/
public function userExists($userId)
{
$user = $this->getUserService()->getUser4Id($userId);
return (bool) $user;
}

/**
* @return User
*/
protected function getUserService()
{
return $this->getServiceManager()->get('small_user_service');
}

}

0 comments on commit 3995041

Please sign in to comment.