Skip to content
Snippets Groups Projects
Commit 30c4ee49 authored by mattwire's avatar mattwire
Browse files

Add HTML field definitions for StripeCustomer

parent 1ac2dde0
Branches
Tags
1 merge request!253Entity
......@@ -6,7 +6,7 @@
*
* Generated from com.drastikbydesign.stripe/xml/schema/CRM/Stripe/StripeCustomer.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:ecd2b24395fdeed772fce5cedf8d416e)
* (GenCodeChecksum:dd1ed7f28d02b0186afd06a69db33b83)
*/
use CRM_Stripe_ExtensionUtil as E;
......@@ -94,21 +94,6 @@ class CRM_Stripe_DAO_StripeCustomer extends CRM_Core_DAO {
return $plural ? E::ts('Stripe Customers') : E::ts('Stripe Customer');
}
/**
* Returns foreign keys and entity references.
*
* @return array
* [CRM_Core_Reference_Interface]
*/
public static function getReferenceColumns() {
if (!isset(Civi::$statics[__CLASS__]['links'])) {
Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
}
return Civi::$statics[__CLASS__]['links'];
}
/**
* Returns all the column names of this table
*
......@@ -155,6 +140,9 @@ class CRM_Stripe_DAO_StripeCustomer extends CRM_Core_DAO {
'entity' => 'StripeCustomer',
'bao' => 'CRM_Stripe_DAO_StripeCustomer',
'localizable' => 0,
'html' => [
'type' => 'Text',
],
'add' => NULL,
],
'contact_id' => [
......@@ -174,6 +162,9 @@ class CRM_Stripe_DAO_StripeCustomer extends CRM_Core_DAO {
'bao' => 'CRM_Stripe_DAO_StripeCustomer',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_Contact',
'html' => [
'type' => 'EntityRef',
],
'add' => NULL,
],
'processor_id' => [
......@@ -192,6 +183,9 @@ class CRM_Stripe_DAO_StripeCustomer extends CRM_Core_DAO {
'entity' => 'StripeCustomer',
'bao' => 'CRM_Stripe_DAO_StripeCustomer',
'localizable' => 0,
'html' => [
'type' => 'EntityRef',
],
'pseudoconstant' => [
'table' => 'civicrm_payment_processor',
'keyColumn' => 'id',
......@@ -220,6 +214,9 @@ class CRM_Stripe_DAO_StripeCustomer extends CRM_Core_DAO {
'entity' => 'StripeCustomer',
'bao' => 'CRM_Stripe_DAO_StripeCustomer',
'localizable' => 0,
'html' => [
'type' => 'Text',
],
'add' => NULL,
],
];
......@@ -228,37 +225,6 @@ class CRM_Stripe_DAO_StripeCustomer extends CRM_Core_DAO {
return Civi::$statics[__CLASS__]['fields'];
}
/**
* Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
* Array(string $name => string $uniqueName).
*/
public static function &fieldKeys() {
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
*
* @return string
*/
public static function getTableName() {
return self::$_tableName;
}
/**
* Returns if this table needs to be logged
*
* @return bool
*/
public function getLog() {
return self::$_log;
}
/**
* Returns the list of fields that can be imported
*
......
......@@ -6,7 +6,7 @@
*
* Generated from com.drastikbydesign.stripe/xml/schema/CRM/Stripe/StripePaymentintent.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:5aaffbeee4dd172cae4daf0e85a77600)
* (GenCodeChecksum:b67646ad6a172031ee010ed01449d20e)
*/
use CRM_Stripe_ExtensionUtil as E;
......@@ -157,22 +157,6 @@ class CRM_Stripe_DAO_StripePaymentintent extends CRM_Core_DAO {
return $plural ? E::ts('Stripe Paymentintents') : E::ts('Stripe Paymentintent');
}
/**
* Returns foreign keys and entity references.
*
* @return array
* [CRM_Core_Reference_Interface]
*/
public static function getReferenceColumns() {
if (!isset(Civi::$statics[__CLASS__]['links'])) {
Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'payment_processor_id', 'civicrm_payment_processor', 'id');
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
}
return Civi::$statics[__CLASS__]['links'];
}
/**
* Returns all the column names of this table
*
......@@ -433,37 +417,6 @@ class CRM_Stripe_DAO_StripePaymentintent extends CRM_Core_DAO {
return Civi::$statics[__CLASS__]['fields'];
}
/**
* Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
* Array(string $name => string $uniqueName).
*/
public static function &fieldKeys() {
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
*
* @return string
*/
public static function getTableName() {
return self::$_tableName;
}
/**
* Returns if this table needs to be logged
*
* @return bool
*/
public function getLog() {
return self::$_log;
}
/**
* Returns the list of fields that can be imported
*
......
......@@ -8,9 +8,11 @@
--
-- Generated from drop.tpl
-- DO NOT EDIT. Generated by CRM_Core_CodeGen
---- /*******************************************************
--
-- /*******************************************************
-- *
-- * Clean up the existing tables
-- *
-- * Clean up the existing tables-- *
-- *******************************************************/
SET FOREIGN_KEY_CHECKS=0;
......
-- /*******************************************************
-- *
-- * Create new tables
-- *
-- *******************************************************/
-- /*******************************************************
-- *
-- * civicrm_stripe_customers
......
CREATE TABLE IF NOT EXISTS `civicrm_stripe_paymentintent` (
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique ID',
-- /*******************************************************
-- *
-- * civicrm_stripe_paymentintent
-- *
-- * Stripe PaymentIntents
-- *
-- *******************************************************/
CREATE TABLE `civicrm_stripe_paymentintent` (
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique ID',
`stripe_intent_id` varchar(255) COMMENT 'The Stripe PaymentIntent/SetupIntent/PaymentMethod ID',
`contribution_id` int unsigned COMMENT 'FK ID from civicrm_contribution',
`payment_processor_id` int unsigned COMMENT 'Foreign key to civicrm_payment_processor.id',
......@@ -7,12 +14,13 @@ CREATE TABLE IF NOT EXISTS `civicrm_stripe_paymentintent` (
`status` varchar(25) NULL COMMENT 'The status of the paymentIntent',
`identifier` varchar(255) NULL COMMENT 'An identifier that we can use in CiviCRM to find the paymentIntent if we do not have the ID (eg. session key)',
`contact_id` int unsigned COMMENT 'FK to Contact',
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When was paymentIntent created',
`created_date` timestamp DEFAULT CURRENT_TIMESTAMP COMMENT 'When was paymentIntent created',
`flags` varchar(100) NULL COMMENT 'Flags associated with this PaymentIntent (NC=no contributionID when doPayment called)',
`referrer` varchar(255) NULL COMMENT 'HTTP referrer of this paymentIntent',
`extra_data` varchar(255) NULL COMMENT 'Extra data collected to help with diagnostics (such as email, name)',
PRIMARY KEY (`id`),
UNIQUE INDEX `UI_stripe_intent_id` (stripe_intent_id),
UNIQUE INDEX `UI_stripe_intent_id`(stripe_intent_id),
CONSTRAINT FK_civicrm_stripe_paymentintent_payment_processor_id FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor`(`id`) ON DELETE SET NULL,
CONSTRAINT FK_civicrm_stripe_paymentintent_contact_id FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB;
)
ENGINE=InnoDB;
......@@ -24,6 +24,9 @@
<type>varchar</type>
<length>255</length>
<comment>Stripe Customer ID</comment>
<html>
<type>Text</type>
</html>
</field>
<index>
<name>customer_id</name>
......@@ -35,6 +38,9 @@
<name>contact_id</name>
<type>int unsigned</type>
<comment>FK to Contact</comment>
<html>
<type>EntityRef</type>
</html>
</field>
<foreignKey>
<name>contact_id</name>
......@@ -48,6 +54,9 @@
<title>Payment Processor ID</title>
<type>int unsigned</type>
<comment>ID from civicrm_payment_processor</comment>
<html>
<type>EntityRef</type>
</html>
<pseudoconstant>
<table>civicrm_payment_processor</table>
<keyColumn>id</keyColumn>
......@@ -62,6 +71,9 @@
<headerPattern>/cur(rency)?/i</headerPattern>
<dataPattern>/^[A-Z]{3}$/i</dataPattern>
<comment>3 character string, value from Stripe customer.</comment>
<html>
<type>Text</type>
</html>
</field>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment