General cleanup for adding payment methods in Phortune

Summary:
This has no real behavioral changes (except better error handling), it just factors things out to be a bit cleaner. In particular:

  - Move more shared form behaviors into the common JS form component.
  - Move more error handling into shared pathways.
  - Make the specialized Stripe / Balanced methods do less work.

This needs some more polish for nontrival errors (especially on the Balanced side) but none of the error behavior is worse than it was and a lot of it is much better.

Ref T2787.

Test Plan: Hit all invalid form errors, added valid payment methods with Stripe and Balacned.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2787

Differential Revision: https://secure.phabricator.com/D5771
This commit is contained in:
epriestley
2013-04-25 09:49:32 -07:00
parent 6efba56448
commit 7a5f622820
16 changed files with 443 additions and 287 deletions

View File

@@ -0,0 +1,19 @@
TRUNCATE TABLE {$NAMESPACE}_phortune.phortune_paymentmethod;
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
ADD brand VARCHAR(64) NOT NULL;
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
ADD expires VARCHAR(16) NOT NULL;
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
ADD providerType VARCHAR(16) NOT NULL;
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
ADD providerDomain VARCHAR(64) NOT NULL;
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
ADD lastFourDigits VARCHAR(16) NOT NULL;
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
DROP expiresEpoch;