Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2893288
PhortunePaymentMethodDisableController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhortunePaymentMethodDisableController.php
View Options
<?php
final
class
PhortunePaymentMethodDisableController
extends
PhortuneController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
(
)
;
$method_id
=
$request
->
getURIData
(
'id'
)
;
$method
=
id
(
new
PhortunePaymentMethodQuery
(
)
)
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$method_id
)
)
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
)
)
->
executeOne
(
)
;
if
(
!
$method
)
{
return
new
Aphront404Response
(
)
;
}
if
(
$method
->
getStatus
(
)
==
PhortunePaymentMethod
::
STATUS_DISABLED
)
{
return
new
Aphront400Response
(
)
;
}
$account
=
$method
->
getAccount
(
)
;
$account_uri
=
$this
->
getApplicationURI
(
$account
->
getID
(
)
.
'/'
)
;
if
(
$request
->
isFormPost
(
)
)
{
// TODO: ApplicationTransactions!
$method
->
setStatus
(
PhortunePaymentMethod
::
STATUS_DISABLED
)
->
save
(
)
;
return
id
(
new
AphrontRedirectResponse
(
)
)
->
setURI
(
$account_uri
)
;
}
return
$this
->
newDialog
(
)
->
setTitle
(
pht
(
'Disable Payment Method?'
)
)
->
setShortTitle
(
pht
(
'Disable Payment Method'
)
)
->
appendParagraph
(
pht
(
'Disable the payment method "%s"?'
,
phutil_tag
(
'strong'
,
array
(
)
,
$method
->
getFullDisplayName
(
)
)
)
)
->
appendParagraph
(
pht
(
'You will no longer be able to make payments using this payment '
.
'method. Disabled payment methods can not be reactivated.'
)
)
->
addCancelButton
(
$account_uri
)
->
addSubmitButton
(
pht
(
'Disable Payment Method'
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 18:09 (6 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127292
Default Alt Text
PhortunePaymentMethodDisableController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment