| @@ 184-193 (lines=10) @@ | ||
| 181 | /** |
|
| 182 | * @inheritdoc |
|
| 183 | */ |
|
| 184 | public function beforeRequest(RequestEvent $event) |
|
| 185 | { |
|
| 186 | if ($event->command === self::RC_PURCHASE) { |
|
| 187 | $this->trigger(self::EVENT_BEFORE_PURCHASE, $event); |
|
| 188 | } elseif ($event->command === self::RC_QUERY_DR) { |
|
| 189 | $this->trigger(self::EVENT_BEFORE_QUERY_DR, $event); |
|
| 190 | } |
|
| 191 | ||
| 192 | parent::beforeRequest($event); |
|
| 193 | } |
|
| 194 | ||
| 195 | /** |
|
| 196 | * @inheritdoc |
|
| @@ 198-207 (lines=10) @@ | ||
| 195 | /** |
|
| 196 | * @inheritdoc |
|
| 197 | */ |
|
| 198 | public function afterRequest(RequestEvent $event) |
|
| 199 | { |
|
| 200 | if ($event->command === self::RC_PURCHASE) { |
|
| 201 | $this->trigger(self::EVENT_AFTER_PURCHASE, $event); |
|
| 202 | } elseif ($event->command === self::RC_QUERY_DR) { |
|
| 203 | $this->trigger(self::EVENT_AFTER_QUERY_DR, $event); |
|
| 204 | } |
|
| 205 | ||
| 206 | parent::afterRequest($event); |
|
| 207 | } |
|
| 208 | ||
| 209 | /** |
|
| 210 | * Phương thức này là phương thức ánh xạ của [[verifyRequest()]] nó sẽ tạo lệnh [[VRC_PURCHASE_SUCCESS]] |
|
| @@ 289-298 (lines=10) @@ | ||
| 286 | * |
|
| 287 | * @param VerifiedRequestEvent $event |
|
| 288 | */ |
|
| 289 | public function verifiedRequest(VerifiedRequestEvent $event) |
|
| 290 | { |
|
| 291 | if ($event->command === self::VRC_IPN) { |
|
| 292 | $this->trigger(self::EVENT_VERIFIED_REQUEST_IPN, $event); |
|
| 293 | } elseif ($event->command === self::VRC_PURCHASE_SUCCESS) { |
|
| 294 | $this->trigger(self::EVENT_VERIFIED_REQUEST_PURCHASE_SUCCESS, $event); |
|
| 295 | } |
|
| 296 | ||
| 297 | $this->trigger(self::EVENT_VERIFIED_REQUEST, $event); |
|
| 298 | } |
|
| 299 | ||
| 300 | ||
| 301 | } |
|