You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @return string A unique (at the time of function-call) payment reference.
37
+
*/
38
+
protectedstaticfunctiongeneratePaymentRef()
39
+
{
40
+
// Payment ref is a randomly generates string of 'safechars'
41
+
// Stolen from London Hackspace code
42
+
$safeChars = '2346789BCDFGHJKMPQRTVWXY';
43
+
// We prefix the ref with a string that lets people know it's us
44
+
$prefix = 'HSNTSB';
45
+
// Payment references can be up to 18 chars according to: http://www.bacs.co.uk/Bacs/Businesses/BacsDirectCredit/Receiving/Pages/PaymentReferenceInformation.aspx
46
+
$maxRefLength = 16;
47
+
$paymentRef = $prefix;
48
+
for ($i = strlen($prefix); $i < $maxRefLength; $i++) {
0 commit comments