Plugin Directory

Changeset 1459748


Ignore:
Timestamp:
07/24/2016 11:35:19 AM (10 years ago)
Author:
mhallmann
Message:

sync for release of 0.3

Location:
sepa-girocode/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sepa-girocode/trunk/readme.txt

    r1455701 r1459748  
    2727* bic: Bank Identifier Code, facultative for participants of the European Economic Area
    2828* beneficiary: Name of the beneficiary
    29 * amount: Amount of money transfer in EUR
     29* amount: Amount of money to transfer in EUR
    3030* 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
    3134
    3235= Come on, show me an example ... =
    3336
    3437OK, 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"]
    3639
    3740= Which apps do support Girocode? =
     
    4750
    4851== 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
    4957= 0.2 =
    5058* Changed QR-Code-Enginge from google api to local lib (http://phpqrcode.sourceforge.net/)
  • sepa-girocode/trunk/sepa-girocode.php

    r1455705 r1459748  
    88Plugin URI:  http://www.halli-online.de/sepa-girocode/
    99Description: Create EPC-Codes (in Germany known as Girocode) for money transfer | Girocode-Barcode für SEPA-Überweisungen erstellen
    10 Version:     0.2
     10Version:     0.3
    1111Author:      Michael Hallmann
    1212Author URI:  http://www.halli-online.de/
     
    3939    $this->data['purpose'] = "";
    4040    $this->data['amount'] = 0;
     41    $this->data['isclickable'] = 0;
     42    $this->data['purposecode'] = '';
     43    $this->data['reference'] = '';
    4144}
    4245
     
    7679            $this->data["$property"] = substr( $value, 0, 70 );
    7780            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;
    7890        default:
    7991            $this->data["$property"] = $value;
     
    8597public function getGoogleUrl() {
    8698    // https://developers.google.com/chart/infographics/docs/qr_codes
    87    
     99    // this function is currently not in use
    88100    $nl = chr(13) . chr(10);
    89101
     
    109121    $qrdata .= $this->iban . $nl;  // IBAN of beneficiary
    110122    $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)
    113133
    114134    return $qrdata;
     
    156176
    157177    $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     
    159188   
    160189     
     
    167196    // only process requests with "halli-girocode=show-code"
    168197    require_once("includes/phpqrcode/qrlib.php");
     198   
    169199    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   
    172212}
    173213
Note: See TracChangeset for help on using the changeset viewer.