Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103163729
PhortuneController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Feb 27, 19:49
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Mar 1, 19:49 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
24508951
Attached To
rPH Phabricator
PhortuneController.php
View Options
<?php
abstract
class
PhortuneController
extends
PhabricatorController
{
protected
function
addAccountCrumb
(
$crumbs
,
PhortuneAccount
$account
,
$link
=
true
)
{
$name
=
pht
(
'Account'
);
$href
=
null
;
if
(
$link
)
{
$href
=
$this
->
getApplicationURI
(
$account
->
getID
().
'/'
);
$crumbs
->
addTextCrumb
(
$name
,
$href
);
}
else
{
$crumbs
->
addTextCrumb
(
$name
);
}
}
private
function
loadEnabledProvidersForMerchant
(
PhortuneMerchant
$merchant
)
{
$viewer
=
$this
->
getRequest
()->
getUser
();
$provider_configs
=
id
(
new
PhortunePaymentProviderConfigQuery
())
->
setViewer
(
$viewer
)
->
withMerchantPHIDs
(
array
(
$merchant
->
getPHID
()))
->
execute
();
$providers
=
mpull
(
$provider_configs
,
'buildProvider'
,
'getID'
);
foreach
(
$providers
as
$key
=>
$provider
)
{
if
(!
$provider
->
isEnabled
())
{
unset
(
$providers
[
$key
]);
}
}
return
$providers
;
}
protected
function
loadCreatePaymentMethodProvidersForMerchant
(
PhortuneMerchant
$merchant
)
{
$providers
=
$this
->
loadEnabledProvidersForMerchant
(
$merchant
);
foreach
(
$providers
as
$key
=>
$provider
)
{
if
(!
$provider
->
canCreatePaymentMethods
())
{
unset
(
$providers
[
$key
]);
continue
;
}
}
return
$providers
;
}
protected
function
loadOneTimePaymentProvidersForMerchant
(
PhortuneMerchant
$merchant
)
{
$providers
=
$this
->
loadEnabledProvidersForMerchant
(
$merchant
);
foreach
(
$providers
as
$key
=>
$provider
)
{
if
(!
$provider
->
canProcessOneTimePayments
())
{
unset
(
$providers
[
$key
]);
continue
;
}
}
return
$providers
;
}
}
Event Timeline
Log In to Comment