Page MenuHomePhorge

PhortuneProviderController.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

PhortuneProviderController.php

<?php
final class PhortuneProviderController extends PhortuneController {
private $digest;
private $action;
public function willProcessRequest(array $data) {
$this->digest = $data['digest'];
$this->setAction($data['action']);
}
public function setAction($action) {
$this->action = $action;
return $this;
}
public function getAction() {
return $this->action;
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
// NOTE: This use of digests to identify payment providers is because
// payment provider keys don't necessarily have restrictions on what they
// contain (so they might have stuff that's not safe to put in URIs), and
// using digests prevents errors with URI encoding.
$provider = PhortunePaymentProvider::getProviderByDigest($this->digest);
if (!$provider) {
throw new Exception('Invalid payment provider digest!');
}
if (!$provider->canRespondToControllerAction($this->getAction())) {
return new Aphront404Response();
}
$response = $provider->processControllerRequest($this, $request);
if ($response instanceof AphrontResponse) {
return $response;
}
$title = 'Phortune';
return $this->buildApplicationPage(
$response,
array(
'title' => $title,
'device' => true,
));
}
public function loadCart($id) {
return id(new PhortuneCart());
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Jul 13, 8:42 PM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
351208
Default Alt Text
PhortuneProviderController.php (1 KB)

Event Timeline