Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / phortune / provider / PhortuneTestPaymentProvider.php
blob8b8c731a84c331ee24d13458b9de02db5b3e2878
1 <?php
3 final class PhortuneTestPaymentProvider extends PhortunePaymentProvider {
5 public function isAcceptingLivePayments() {
6 return false;
9 public function getName() {
10 return pht('Test Payments');
13 public function getConfigureName() {
14 return pht('Test Payments');
17 public function getConfigureDescription() {
18 return pht(
19 'Adds a test provider to allow you to test payments. This allows '.
20 'users to make purchases by clicking a button without actually paying '.
21 'any money.');
24 public function getConfigureProvidesDescription() {
25 return pht('This merchant accepts test payments.');
28 public function getConfigureInstructions() {
29 return pht('This provider does not require any special configuration.');
32 public function canRunConfigurationTest() {
33 return false;
36 public function getPaymentMethodDescription() {
37 return pht('Add Mountain of Virtual Wealth');
40 public function getPaymentMethodIcon() {
41 return 'TestPayment';
44 public function getPaymentMethodProviderDescription() {
45 return pht('Infinite Free Money');
48 public function getDefaultPaymentMethodDisplayName(
49 PhortunePaymentMethod $method) {
50 return pht('Vast Wealth');
53 protected function executeCharge(
54 PhortunePaymentMethod $payment_method,
55 PhortuneCharge $charge) {
56 return;
59 protected function executeRefund(
60 PhortuneCharge $charge,
61 PhortuneCharge $refund) {
62 return;
65 public function updateCharge(PhortuneCharge $charge) {
66 return;
69 public function getAllConfigurableProperties() {
70 return array();
73 public function getAllConfigurableSecretProperties() {
74 return array();
77 public function processEditForm(
78 AphrontRequest $request,
79 array $values) {
81 $errors = array();
82 $issues = array();
83 $values = array();
85 return array($errors, $issues, $values);
88 public function extendEditForm(
89 AphrontRequest $request,
90 AphrontFormView $form,
91 array $values,
92 array $issues) {
93 return;
98 /* -( Adding Payment Methods )--------------------------------------------- */
101 public function canCreatePaymentMethods() {
102 return true;
106 public function translateCreatePaymentMethodErrorCode($error_code) {
107 return $error_code;
111 public function getCreatePaymentMethodErrorMessage($error_code) {
112 return null;
116 public function validateCreatePaymentMethodToken(array $token) {
117 return true;
121 public function createPaymentMethodFromRequest(
122 AphrontRequest $request,
123 PhortunePaymentMethod $method,
124 array $token) {
126 $method
127 ->setExpires('2050', '01')
128 ->setBrand('FreeMoney')
129 ->setLastFourDigits('9999')
130 ->setMetadata(
131 array(
132 'type' => 'test.wealth',
135 return array();
140 * @task addmethod
142 public function renderCreatePaymentMethodForm(
143 AphrontRequest $request,
144 array $errors) {
146 $ccform = id(new PhortuneCreditCardForm())
147 ->setSecurityAssurance(
148 pht('This is a test payment provider.'))
149 ->setUser($request->getUser())
150 ->setErrors($errors);
152 Javelin::initBehavior(
153 'test-payment-form',
154 array(
155 'formID' => $ccform->getFormID(),
158 return $ccform->buildForm();