Changeset 1459748
- Timestamp:
- 07/24/2016 11:35:19 AM (10 years ago)
- Location:
- sepa-girocode/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
sepa-girocode.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sepa-girocode/trunk/readme.txt
r1455701 r1459748 27 27 * bic: Bank Identifier Code, facultative for participants of the European Economic Area 28 28 * beneficiary: Name of the beneficiary 29 * amount: Amount of money t ransfer in EUR29 * amount: Amount of money to transfer in EUR 30 30 * purpose: Description of the payments purpose 31 * purposecode: Standard-Codes for payment purposes, e.g. CHAR for Charity-Payments 32 * reference: Alternative to unstructured purpose description, use of reference overrules purpose-field 33 * clickable: With this field set to 1 the QR-Code can be downloaded als .girocode file 31 34 32 35 = Come on, show me an example ... = 33 36 34 37 OK, let's donate 5 EUR for the German Red Cross: 35 [girocode iban="DE63370205000005023307" beneficiary="German Red Cross" amount="5 .00" purpose="Donation"]38 [girocode iban="DE63370205000005023307" beneficiary="German Red Cross" amount="5" purpose="Donation"] 36 39 37 40 = Which apps do support Girocode? = … … 47 50 48 51 == Changelog == 52 = 0.3 = 53 * Added new parameters (clickable, purposecode, reference) 54 * QR-Codes now can be clickable for supported apps 55 * Fixed broken div-element 56 49 57 = 0.2 = 50 58 * Changed QR-Code-Enginge from google api to local lib (http://phpqrcode.sourceforge.net/) -
sepa-girocode/trunk/sepa-girocode.php
r1455705 r1459748 8 8 Plugin URI: http://www.halli-online.de/sepa-girocode/ 9 9 Description: Create EPC-Codes (in Germany known as Girocode) for money transfer | Girocode-Barcode für SEPA-Überweisungen erstellen 10 Version: 0. 210 Version: 0.3 11 11 Author: Michael Hallmann 12 12 Author URI: http://www.halli-online.de/ … … 39 39 $this->data['purpose'] = ""; 40 40 $this->data['amount'] = 0; 41 $this->data['isclickable'] = 0; 42 $this->data['purposecode'] = ''; 43 $this->data['reference'] = ''; 41 44 } 42 45 … … 76 79 $this->data["$property"] = substr( $value, 0, 70 ); 77 80 break; 81 case "reference": 82 $this->data["$property"] = substr( $value, 0, 35 ); 83 break; 84 case "purposecode": 85 $this->data["$property"] = strtoupper(substr( $value, 0, 4 )); 86 break; 87 case "isclickable": 88 $this->data["$property"] = floatval($value); 89 break; 78 90 default: 79 91 $this->data["$property"] = $value; … … 85 97 public function getGoogleUrl() { 86 98 // https://developers.google.com/chart/infographics/docs/qr_codes 87 99 // this function is currently not in use 88 100 $nl = chr(13) . chr(10); 89 101 … … 109 121 $qrdata .= $this->iban . $nl; // IBAN of beneficiary 110 122 $qrdata .= "EUR" . $this->amount . $nl; // amount in EUR 111 $qrdata .= $nl; // purpose code 112 $qrdata .= $this->purpose; // remittance information unstructured 123 $qrdata .= $this->purposecode . $nl; // purpose code 124 $qrdata .= $this->reference . $nl; // remittance (reference), beginning with RF 125 // one can use either purpose or reference, reference overrules purpose 126 if ($this->reference == "") { 127 $qrdata .= $this->purpose . $nl; // remittance (text), unstructured 128 } else { 129 $qrdata .= "" . $nl; 130 } 131 132 $qrdata .= "nvc:trash@halli-online.de"; // information (beneficiary to originator information) 113 133 114 134 return $qrdata; … … 156 176 157 177 $img_src = "index.php?sepa-girocode=show-code&key=" . $key; 158 $output .= "<div><img src='$img_src'></img><div>"; 178 $click_url = "index.php?sepa-girocode=get-codefile&key=" . $key; 179 180 if ($sgc->isclickable == 1) { 181 $output .= "<div><a href='$click_url' target='_blank'><img src='$img_src'></a></img></div>"; 182 } else { 183 $output .= "<div><img src='$img_src'></img></div>"; 184 } 185 186 187 159 188 160 189 … … 167 196 // only process requests with "halli-girocode=show-code" 168 197 require_once("includes/phpqrcode/qrlib.php"); 198 169 199 if (array_key_exists('sepa-girocode', $wp->query_vars) && $wp->query_vars['sepa-girocode'] == 'show-code') { 170 QRcode::png( get_transient($wp->query_vars['key']) ); 171 } 200 $key = $wp->query_vars['key']; 201 QRcode::png( get_transient($key, $level=QR_ECLEVEL_M) ); 202 } 203 204 if (array_key_exists('sepa-girocode', $wp->query_vars) && $wp->query_vars['sepa-girocode'] == 'get-codefile') { 205 $key = $wp->query_vars['key']; 206 header("Content-Type: application/octet-stream"); 207 header("Content-Disposition: attachment; filename=\"$key.girocode\""); 208 echo get_transient($key); 209 exit; 210 } 211 172 212 } 173 213
Note: See TracChangeset
for help on using the changeset viewer.