123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
- namespace Ppb\Service\Fees;
- use Ppb\Service;
- class UserSignup extends Service\Fees
- {
-
- protected $_fees = array(
- self::SIGNUP => 'User Signup Fee',
- );
-
- protected $_totalAmount;
-
- protected $_redirect = array(
- 'module' => 'members',
- 'controller' => 'user',
- 'action' => 'login',
- );
-
- public function __construct($user = null)
- {
- parent::__construct();
- if ($user !== null) {
- $this->setUser($user);
- }
- }
-
- public function callback($ipn, array $post)
- {
- $usersService = new Service\Users();
- $user = $usersService->findBy('id', $post['user_id']);
- $flag = ($ipn) ? 1 : 0;
- $paymentStatus = ($ipn) ? 'confirmed' : 'failed';
- $user->save(array(
- 'active' => $flag,
- 'payment_status' => $paymentStatus,
- ));
- return $this;
- }
-
- public function getTotalAmount()
- {
- return $this->getFeeAmount('signup');
- }
- }
|