[#8] added twingle ID prefix

This commit is contained in:
B. Endres 2019-11-15 09:09:14 +01:00
parent 33c81951fc
commit d9a44f07e7
7 changed files with 42 additions and 7 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).