3 final class PhortuneTestPaymentProvider
extends PhortunePaymentProvider
{
5 public function isAcceptingLivePayments() {
9 public function getName() {
10 return pht('Test Payments');
13 public function getConfigureName() {
14 return pht('Test Payments');
17 public function getConfigureDescription() {
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 '.
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() {
36 public function getPaymentMethodDescription() {
37 return pht('Add Mountain of Virtual Wealth');
40 public function getPaymentMethodIcon() {
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) {
59 protected function executeRefund(
60 PhortuneCharge
$charge,
61 PhortuneCharge
$refund) {
65 public function updateCharge(PhortuneCharge
$charge) {
69 public function getAllConfigurableProperties() {
73 public function getAllConfigurableSecretProperties() {
77 public function processEditForm(
78 AphrontRequest
$request,
85 return array($errors, $issues, $values);
88 public function extendEditForm(
89 AphrontRequest
$request,
90 AphrontFormView
$form,
98 /* -( Adding Payment Methods )--------------------------------------------- */
101 public function canCreatePaymentMethods() {
106 public function translateCreatePaymentMethodErrorCode($error_code) {
111 public function getCreatePaymentMethodErrorMessage($error_code) {
116 public function validateCreatePaymentMethodToken(array $token) {
121 public function createPaymentMethodFromRequest(
122 AphrontRequest
$request,
123 PhortunePaymentMethod
$method,
127 ->setExpires('2050', '01')
128 ->setBrand('FreeMoney')
129 ->setLastFourDigits('9999')
132 'type' => 'test.wealth',
142 public function renderCreatePaymentMethodForm(
143 AphrontRequest
$request,
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(
155 'formID' => $ccform->getFormID(),
158 return $ccform->buildForm();