Adjust payment workflows to deal with merchants and configurable providers in Phortune
Summary: Ref T2787. Builds on D10649 by rebining existing objects (carts, charges, etc) to merchantPHIDs and providerPHIDs instead of an implicit global merchant and weird global artifacts (providerType / providerKey). Basically: - When you create something that users can pay for, you specify a merchant to control where the payment goes. - Accounts are install-wide, but payment methods are bound to merchants. This seems to do a reasonable job of balancing usability and technical concerns. - Replace a bunch of weird links between objects with standard PHIDs. - Improve "add payment method" flow. Test Plan: Went through the Fund flow with Stripe and WePay, funding an initiative. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T2787 Differential Revision: https://secure.phabricator.com/D10652
This commit is contained in:
2
resources/sql/autopatches/20141007.fundmerchant.sql
Normal file
2
resources/sql/autopatches/20141007.fundmerchant.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE {$NAMESPACE}_fund.fund_initiative
|
||||
ADD merchantPHID VARBINARY(64);
|
||||
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_cart
|
||||
ADD merchantPHID VARBINARY(64) NOT NULL;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_cart
|
||||
ADD KEY `key_merchant` (merchantPHID);
|
||||
16
resources/sql/autopatches/20141007.phortunecharge.sql
Normal file
16
resources/sql/autopatches/20141007.phortunecharge.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
TRUNCATE TABLE {$NAMESPACE}_phortune.phortune_charge;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_charge
|
||||
DROP paymentProviderKey;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_charge
|
||||
ADD merchantPHID VARBINARY(64) NOT NULL;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_charge
|
||||
ADD providerPHID VARBINARY(64) NOT NULL;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_charge
|
||||
ADD KEY `key_merchant` (merchantPHID);
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_charge
|
||||
ADD KEY `key_provider` (providerPHID);
|
||||
16
resources/sql/autopatches/20141007.phortunepayment.sql
Normal file
16
resources/sql/autopatches/20141007.phortunepayment.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
TRUNCATE TABLE {$NAMESPACE}_phortune.phortune_paymentmethod;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
|
||||
DROP providerType;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
|
||||
DROP providerDomain;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
|
||||
ADD merchantPHID VARBINARY(64) NOT NULL;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
|
||||
ADD providerPHID VARBINARY(64) NOT NULL;
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_phortune.phortune_paymentmethod
|
||||
ADD KEY `key_merchant` (merchantPHID, accountPHID);
|
||||
Reference in New Issue
Block a user