[#8] added transaction prefix

This commit is contained in:
B. Endres 2019-11-15 11:13:33 +01:00
commit c9695c1773
6 changed files with 41 additions and 6 deletions

View file

@ -145,6 +145,21 @@ class CRM_Twingle_Profile {
$this->data[$attribute_name] = $value;
}
/**
* Get the CiviCRM transaction ID (to be used in contributions and recurring contributions)
*
* @param $twingle_id string Twingle ID
* @return string CiviCRM transaction ID
*/
public function getTransactionID($twingle_id) {
$prefix = CRM_Core_BAO_Setting::getItem('de.systopia.twingle', 'twingle_prefix');
if (empty($prefix)) {
return $twingle_id;
} else {
return $prefix . $twingle_id;
}
}
/**
* Verifies whether the profile is valid (i.e. consistent and not colliding
* with other profiles).