-------------------------------------------------------------------------------- TABLE: communities CHANGED ---------- corp_gateway_currency ==> spreedly_currency_code corp_gateway_token ==> spreedly_gateway_token corp_transaction_token ==> spreedly_transaction_token Play_store_link ==> play_store_link ADDED ---------- ALTER TABLE `communities` ADD `spreedly_access_key` VARCHAR(40) NOT NULL AFTER `corp_gateway_mode`, ADD `spreedly_access_secret` VARCHAR(80) NOT NULL AFTER `spreedly_access_key`; spreedly_access_key varchar(40) spreedly credentials spreedly_access_secret varchar(80) spreedly credentials spreedly_country_code char(2) US, CA, etc. spreedly_gateway_type varchar(32) 'realex','blue_snap','stripe','element' spreedly_gateway_value_1 varchar(256) generic data for spreedly external gateways spreedly_gateway_value_2 varchar(256) generic data for spreedly external gateways spreedly_gateway_value_3 varchar(256) generic data for spreedly external gateways spreedly_gateway_value_4 varchar(256) generic data for spreedly external gateways spreedly_gateway_value_5 varchar(256) generic data for spreedly external gateways punchcard_mode char(1) rewards_cash_name varchar(30) rewards_cash_name varchar(30) points_name varchar(30) -------------------------------------------------------------------------------- Table: restaurants -------------------------------------------------------------------------------- COLUMN CURRENT CHANGE TO NOTES -------------------------------------------------------------------------------- payment_gateway text varchar(40) gw1 usaepay_wsdl_url varchar(255) gw2 usaepay_sourcekey varchar(255) gw3 usaepay_pin varchar(255) gw4 worldpay_servicekey varchar(255) gw5 worldpay_clientkey varchar(255) gw6 globalpay_value_1 varchar(32) gw7 globalpay_value_2 varchar(32) gw8 spreedly_value_1 varchar(32) gw9 spreedly_value_2 varchar(32) gw10 spreedly_value_3 varchar(32) gw11 spreedly_value_4 varchar(32) gw12 authorize_login_id varchar(255) gw13 authorize_transaction_key varchar(255) gw14 nuvei_terminal_id varchar(40) *** TO BE ADDED LATER *** nuvei_access_secret varchar(80) *** TO BE ADDED LATER *** nuvei_country_code char(2) *** TO BE ADDED LATER *** nuvei_currency_code char(3) *** TO BE ADDED LATER *** ALTER TABLE `restaurants` CHANGE `payment_gateway` `payment_gateway` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'gw1'; ALTER TABLE `restaurants` ADD `globalpay_value_1` VARCHAR(32) NOT NULL COMMENT 'gw7' AFTER `worldpay_clientkey`, ADD `globalpay_value_2` VARCHAR(32) NOT NULL COMMENT 'gw8' AFTER `globalpay_value_1`, ADD `spreedly_value_1` VARCHAR(32) NOT NULL COMMENT 'gw9' AFTER `globalpay_value_2`, ADD `spreedly_value_2` VARCHAR(32) NOT NULL COMMENT 'gw10' AFTER `spreedly_value_1`, ADD `spreedly_value_3` VARCHAR(32) NOT NULL COMMENT 'gw11' AFTER `spreedly_value_2`, ADD `spreedly_value_4` VARCHAR(32) NOT NULL COMMENT 'gw12' AFTER `spreedly_value_3`; -------------------------------------------------------------------------------- 1) What determines whether were talking to the corp gateway or the restaurant gateway? context only? i see the restaurant table fields are not being populated, even though they are used exclusively by some of the gateway functions. 2) should be a common data structure that holds all the needed gateway information, regardless of provider, including an indicator of whether that gateway is corp or rest or skoop or whatever. then pass that structure to EVERY low-level gateway function. eliminates data confusion, global variables, session variables, etc. like this $gatewayInfo = GetGatewayInfo( {corporate/location) ); usaepayUpdateUserProfile( $gatewayInfo, $profile_data ); spreedlyUpdateUserProfile( $gatewayInfo, $profile_data ); which opens the door for gatewayUpdateUserProfile( $gatewayInfo, $profile_data ); which handles all gateways, now and future. (of course, you could implement the $gatewayInfo as a class.) -------------------------------------------------------------------------------- Table: communities -------------------------------------------------------------------------------- record int(11) NO PRI NULL auto_increment id varchar(10) NO MUL NULL gc_group varchar(10) NO NULL community_name varchar(30) NO NULL payment_method varchar(1) NO NULL currency varchar(10) NO $ currency_symbol varchar(10) NO $ payment_mode varchar(1) NO 1 insurance_gateway_payment_id varchar(30) insurance_gateway_user_id varchar(30) qb_currency_code varchar(3) USD QuickBooks not sure what these are for corp_gateway_user_id varchar(30) 9882959 corp_gateway_payment_id varchar(30) 6939 patron pays client ------------------------ corp_gateway varchar(2) 1 corp_gateway_mode varchar(10) sandbox/live client pays Skoop! ------------------------ skoop_gateway varchar(2) 1=usaepay (not setup to work with any other gateway) skoop_gateway_mode varchar(10) sandbox/live skoop_gateway_key varchar(100) _JGX969090GO09WnPM5IP5WY6MaScxCo skoop_gateway_ref varchar(20) 123456 USAePay ------------------------ corp_key varchar(100) corp_ref varchar(20) usaepay_country_code varchar(2) US usaepay_currency_code varchar(4) 840 **These are in the restaurants table, and used by local pooling mode, but have no equivalent in the communities table usaepay_sourcekey usaepay_pin usaepay_wsdl_url WorldPay ------------------------ worldpay_servicekey varchar(255) worldpay_clientkey varchar(255) worldpay_country_code varchar(2) US worldpay_currency_code varchar(3) USD Global Payments ------------------------ globalpay_merchantid varchar(32) merchantid globalpay_secret varchar(32) secret globalpay_country_code varchar(2) US globalpay_currency_code varchar(3) USD Spreedly ------------------------ spreedly_access_key varchar(40) spreedly_access_secret varchar(80) spreedly_country_code char(2) US spreedly_currency_code char(3) USD spreedly_gateway_token varchar(32) 20+ char string, represents gateway interface created by Spreedly spreedly_transaction_token varchar(32) for spreedly_test spreedly_gateway_type varchar(32) secondary gateway name (e.g. 'realex','blue_snap','stripe','element') spreedly_gateway_value_1 varchar(256) generic data for spreedly external gateways spreedly_gateway_value_2 varchar(256) generic data for spreedly external gateways spreedly_gateway_value_3 varchar(256) generic data for spreedly external gateways spreedly_gateway_value_4 varchar(256) generic data for spreedly external gateways spreedly_gateway_value_5 varchar(256) generic data for spreedly external gateways Authorize.Net ------------------------ authorize_login_id not present authorize_transaction_key not present Nuvei ------------------------ nuvei_terminal_id varchar(40) nuvei_access_secret varchar(80) nuvei_country_code char(2) US nuvei_currency_code char(3) USD Paymentsense ------------------------ paymentsense_merchantid varchar(40) gateway account credentials paymentsense_password varchar(40) gateway account password paymentsense_presharedkey varchar(256) gateway presharedkey (hosted only) paymentsense_hashmethod varchar(32) gateway hashmethod (hosted only) paymentsense_domain varchar(80) gateway processor api domain (e.g. gateway.com) paymentsense_port varchar(8) gateway processor api port (4430 or 443) paymentsense_secret_key varchar(80) used to generate the Hash Keys, set in MMS paymentsense_country_code char(3) gateway country code, 3-digit number (e.g. 840) paymentsense_currency_code char(3) gateway currency code (e.g. GBP) -------------------------------------------------------------------------------- Table: patrons_paymentprofiles -------------------------------------------------------------------------------- patrons_paymentprofileID int(11) NO PRI None auto_increment patronID int(11) NO None restaurantID int(11) NO None gateway_code int(11) NO None gateway_user_id int(10) NO None gateway_payment_id int(11) NO None cc_first_name varchar(20) NO None cc_last_name varchar(20) NO None