Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1513404
PhortuneProviderController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhortuneProviderController.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment