[Zope-dev] Passing form-data to an external Method

Joachim Schmitz js@aixtraware.de
Tue, 27 Jun 2000 19:51:33 +0200 (CEST)


Hi,

I wrote an external method, to authorize  Creditcardpayments with the
POSH-Service of the german Cybercash GmbH. This works now with fixed data
in the external method. Now I have extended the method as follows:

def GetAuth(self,REQUEST=None):
    "simple Transaction"
    if REQUEST:
        fo=REQUEST.form
        kw = {}
        kw ["orderid"] = strftime("%d%m%y%H%M%S",localtime(time()))
        kw ["creditc"] = fo["creditc"]
        kw ["expdat"] = fo["expdat"]
    else:
        return HTMLFile(mydir+"authform.dtml",globals(),vars())()
 
authform.dtml

<form action="GetAuth" method="POST">
    <table border="0">
        <tr>
            <th align="left" valign="top">Creditkartennummer</th>
            <td valign="top"><input type="text" size="40"
            name="creditc"> </td>
and so on..
 

So that, when call from an URL, the form is displayed, and when the form
is submitted, the authorisation is done with the form-data.

What happens is this:

only the form is displayed, so REQUEST is always None. If I leave off the
"=None". I get:

Error Type: Type Error
Erro Value: not enough arguments; expected 2 got 1

What's the solution for this ?



Mit freundlichen Grüßen

Joachim Schmitz  

          
Email:   js@aixtraware.de              
Telefon: +49-2464-8851                     
FAX:     +49-2464-905163