From 1f34d30aced9eba0930b7d5797e4c8b06bab0dd0 Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Wed, 9 Oct 2019 14:29:40 +0100 Subject: [PATCH] dev/financial#57 Add order_reference field --- CRM/Financial/DAO/FinancialTrxn.php | 25 +++++++++++++++++++++- CRM/Upgrade/Incremental/php/FiveTwenty.php | 2 ++ xml/schema/Financial/FinancialTrxn.xml | 13 +++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CRM/Financial/DAO/FinancialTrxn.php b/CRM/Financial/DAO/FinancialTrxn.php index c740bff55f..837ddd6782 100644 --- a/CRM/Financial/DAO/FinancialTrxn.php +++ b/CRM/Financial/DAO/FinancialTrxn.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Financial/FinancialTrxn.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:ea6e4e27680634c1c2e4def15d91e02c) + * (GenCodeChecksum:30dff7f6f16ef7cd997187a202a59173) */ /** @@ -145,6 +145,13 @@ class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO { */ public $pan_truncation; + /** + * Payment Processor external order reference + * + * @var string + */ + public $order_reference; + /** * Class constructor. */ @@ -460,6 +467,22 @@ class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO { 'type' => 'Text', ], ], + 'financial_trxn_order_reference' => [ + 'name' => 'order_reference', + 'type' => CRM_Utils_Type::T_STRING, + 'title' => ts('Order Reference'), + 'description' => ts('Payment Processor external order reference'), + 'maxlength' => 255, + 'size' => 25, + 'where' => 'civicrm_financial_trxn.order_reference', + 'table_name' => 'civicrm_financial_trxn', + 'entity' => 'FinancialTrxn', + 'bao' => 'CRM_Financial_DAO_FinancialTrxn', + 'localizable' => 0, + 'html' => [ + 'type' => 'Text', + ], + ], ]; CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } diff --git a/CRM/Upgrade/Incremental/php/FiveTwenty.php b/CRM/Upgrade/Incremental/php/FiveTwenty.php index 94b9e029e7..9485ff8813 100644 --- a/CRM/Upgrade/Incremental/php/FiveTwenty.php +++ b/CRM/Upgrade/Incremental/php/FiveTwenty.php @@ -81,6 +81,8 @@ class CRM_Upgrade_Incremental_php_FiveTwenty extends CRM_Upgrade_Incremental_Bas 'frontend_title', "varchar(255) DEFAULT NULL COMMENT 'Contribution Page Public title'", TRUE, '5.20.alpha1'); $this->addTask('Add is_template field to civicrm_contribution', 'addColumn', 'civicrm_contribution', 'is_template', "tinyint(4) DEFAULT '0' COMMENT 'Shows this is a template for recurring contributions.'", FALSE, '5.20.alpha1'); + $this->addTask('Add order_reference field to civicrm_financial_trxn', 'addColumn', 'civicrm_financial_trxn', 'order_reference', + "varchar(255) COMMENT 'Payment Processor external order reference'", FALSE, '5.20.alpha1'); $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev); } diff --git a/xml/schema/Financial/FinancialTrxn.xml b/xml/schema/Financial/FinancialTrxn.xml index 55290a872e..f7f0bb05d7 100644 --- a/xml/schema/Financial/FinancialTrxn.xml +++ b/xml/schema/Financial/FinancialTrxn.xml @@ -286,4 +286,17 @@ Last 4 digits of credit card 4.7 + + order_reference + financial_trxn_order_reference + Order Reference + varchar + 255 + + Text + 25 + + Payment Processor external order reference + 5.20 + -- 2.25.1