PHP Classes

File: example-submit.php

Recommend this page to a friend!
  Classes of Kristo Vaher   Estonian e-payments solution   example-submit.php   Download  
File: example-submit.php
Role: Example script
Content type: text/plain
Description: This is example file, which generates the form that submits order data to gateway and gateway then submits it to the bank.
Class: Estonian e-payments solution
Submit payments to Estonian and Finnish banks
Author: By
Last change: Version number update
Date: 13 years ago
Size: 2,278 bytes
 

Contents

Class file image Download
<?php

   
// Estonian e-payments system 1.4
    // Kristo Vaher 2011 http://www.waher.net
    // Licensed under LGPL http://www.gnu.org/licenses/lgpl-3.0.txt
    // Published http://waher.net/archives/852
   
    //This is an example payment submit page.
    //Please note that this e-payment system assumes that website is modern and characters are encoded in UTF-8
   
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="et">
    <head>
        <title>Example Payment Submit Page</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    </head>
    <body>
        <?php
           
require('class.epay.php'); //it is not necessary to include configuration file in this initial page, but it is needed for return page
   
            //required configurations
           
$config['payment-type']='seb-est'; //this is based on the profile in configuration and defined also in payments class
           
$config['gateway-url']='http://www.example.com/gate.epay.php'; //gateway URL, used to submit data to, can be local URL, but is recommended to be absolute
           
$config['return-url']='http://www.example.com/example-return.php'; //Page that parses the return data, this must be an ABSOLUTE url. Using Swedbank, this should be below ~60 symbols.
           
$config['order']=1; //unique order code
           
$config['amount']=1; //amount of money to transfer
           
            //optional configurations
           
$config['language']='estonian'; //language of the bank link (if supported), defaults to 'english'
           
$config['currency']='EUR'; //currency to transfer in, defaults to 'EUR'
           
$config['message']='Testime ÕÄÖÜ'; //subject/explanation field in payment, defaults to 'Order #[order-code]'
           
$config['form-name']='epay-form'; //form name, if you need to access it with Javascript, defaults to 'epay-form'
           
$config['form-id']='epay-form'; //form id, if you need to access it with Javascript, defaults to 'epay-form'
           
$config['submit-button']='<input type="submit" value="go to bank"/>'; //If you need a custom submit button, defaults to default button 'Pay'
           
           
$banklink=new Payment($config);
            echo
$banklink->returnForm(); //this prints out the submit form
       
?>
</body>
</html>