http://dynamic.macromedia.com/bin/MM/software/trial/hwswrec.jsp?product=cfmx
_updater

Maybe try the MM forums

Also have a go at <cfprocessingdirective in url below as you know there is a
locale problem with your OS and WorlPay url charcter encoding info, maybe
try that instead of your own code and see if it begins to get the info you
need.

http://www.macromedia.com/support/coldfusion/internationalization/internatio
nalization_cfmx/internationalization_cfmx3.html

rgds


Colm



Colm Brazel MA
CB Publications

www.cbweb.net <http://www.cbweb.net>
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>





-----Original Message-----
From: Giles Roadnight [mailto:[EMAIL PROTECTED]]
Sent: 14 October 2002 18:30
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] MX upgrade


Don't know how familiar you are with worldpay. What happens is you
submit a load of stuff to worldpay through a form like the price,
currency name and so on. The user then enters their card info and the
items are paid for. If you want you can then set up your worldpay
account to call back a page on your server to update your DB that the
order has been paid for or cancelled. This also allows you to control
the look of the page and e-mail yourself and the customer.

The problem I had was that even though form variables were being
submitted to CFMX my page was not seeing them because they were in the
wrong character encoding. The code I used to get around this is:

<!--- get form variables --->
<cfset formVariables = GetHttpRequestData()>
<cfloop list="#formVariables.content#" delimiters="&"
index="currentVariable">
        <cfset request.variableName =
left(currentVariable,find("=",currentVariable)-1)>
        <cfif len(currentVariable) - find("=",currentVariable) is not 0>
                <cfset request.variablevalue =
right(currentVariable,len(currentVariable) - find("=",currentVariable))>
        <cfelse>
                <cfset request.variablevalue = "">
        </cfif>
        <cfset "form.#request.variablename#" =
urldecode(request.variablevalue)>
</cfloop>

I did run the code compatibility wizard and the only problem it came up
with was the use of monitor error type in my error page which I got rid
of. It did not find this though as it did not know that the info was
coming from worldpay. Don't know about the cfoutput looping thing
either. That was really weird.

The rest of my confirmation page is listed below. The form.TRANSSTATUS
returns a y if the order went through or a c if it was cancelled.
form.mc_customerid and any other mc_ variables are variables that the
merchant can specify that are passed through the worldpay system and are
spat out the other end.

Thanks for all of your help.


<!--- get form variables --->
<cfset formVariables = GetHttpRequestData()>
<cfloop list="#formVariables.content#" delimiters="&"
index="currentVariable">
        <cfset request.variableName =
left(currentVariable,find("=",currentVariable)-1)>
        <cfif len(currentVariable) - find("=",currentVariable) is not 0>
                <cfset request.variablevalue =
right(currentVariable,len(currentVariable) - find("=",currentVariable))>
        <cfelse>
                <cfset request.variablevalue = "">
        </cfif>
        <cfset "form.#request.variablename#" =
urldecode(request.variablevalue)>
</cfloop>

<!--- not come from worldpay - goto index --->
<cfif not Isdefined('form.cartid')>
        <cflocation url="index.cfm?#session.urltoken#" addtoken="No">
</cfif>

<cfparam name="form.mc_cftoken" default="">
<cfparam name="form.mc_cfid" default="">
<cfparam name="form.mc_customerid" default="">

<cfset request.cftokens =
"cftoken=#form.mc_cftoken#&amp;cfid=#form.mc_cfid#">

<cfset request.loggedin = true>
<cfset request.customerid = form.mc_customerid>
<cfset request.ordernumber = form.cartid>
<cfset request.basketContents = 0>
<cfset request.trackerid = form.mc_trackerid>

<cfquery name="order" datasource="goldcockerel">
        SELECT  Orders.DatePlaced, Orders.Outcome, orders.ordernumber,
Orders.Shipping, Orders.TotalPrice, Orders.ShippingPrice,
Orders.OrderCurrency, Orders.Reminder, Orders.Worldpay, Orders.Sent,
Orders.exchange,
                        OrderContents.BookNumber,
OrderContents.Quantity, OrderContents.Price,
                        customers.name, customers.address1,
customers.address2, customers.town, customers.county,
customers.postcode, customers.tel, customers.fax, customers.email,
                        Exchange.Symbol, Books.Title,
Shipping.ShippingDescription, countrylist.country
        FROM    (Shipping INNER JOIN ((((Orders LEFT JOIN OrderContents
ON Orders.OrderNumber = OrderContents.OrderNumber) LEFT JOIN Books ON
OrderContents.BookNumber = Books.BookNumber) INNER JOIN Customers ON
Orders.CustomerId = Customers.CustomerId) INNER JOIN Exchange ON
Orders.OrderCurrency = Exchange.Currency) ON Shipping.ShippingType =
Orders.Shipping) INNER JOIN countrylist ON Customers.Country =
countrylist.CountryCode         WHERE   Orders.OrderNumber
=#request.ordernumber#
        AND             Exchange.Currency like '#form.currency#%'
        ORDER   BY Orders.OrderNumber, Orders.DatePlaced;
</cfquery>

<cfset client.customername = order.name>
<cfset client.customeremail = order.email>


<cfif form.TRANSSTATUS is "Y">
        <cfquery name="updateOrder" datasource="goldcockerel">
                update  orders
                set             outcome = 'Finished',
                                worldpay = '#form.transid#',
                                datePlaced = #now()#
                where   ordernumber = #request.ordernumber#
        </cfquery>

        <!--- Get Tracker ID --->
        <cfquery name="currentTrackerRecord" datasource="tracker">
                select  max(id) as maxid
                from    tracker
                where   trackerid = #form.mc_trackerid#
        </cfquery>

        <!--- Update Tracker Record --->
        <cfquery name="updateTracker" datasource="tracker">
                Update  tracker
                                set income = (income +
#order.totalprice#)
                where   id = #currentTrackerRecord.maxid#
        </cfquery>

        <cfset request.symbol = order.symbol>
        <cfif request.symbol is "&##8364;"><cfset request.symbol =
"�"></cfif>
        <cfmail To="#order.email#"
From="[EMAIL PROTECTED]" Subject="Gold Cockerel Books -
Thank you for your order">
Thank you for your order. It has been received by us on
#dateformat(order.dateplaced)# at #timeformat(order.dateplaced)#
and will normally be shipped within 24 hours.

Your order consists of:
<cfloop query="order">
#Order.title##Chr(13)##Chr(10)#Quantity: #order.quantity# Price:
#request.symbol##decimalformat(evaluate(order.price *
order.exchange))##Chr(13)##Chr(10)##chr(13)##chr(10)#
</cfloop>
Shipping: #order.shippingdescription#
Price: #request.symbol##decimalformat(evaluate(order.shippingPrice *
order.exchange))#

Total: #request.symbol##decimalformat(evaluate(order.totalprice *
order.exchange))#

The order will be sent to:

#order.name##Chr(13)##Chr(10)##order.address1##Chr(13)##Chr(10)#<cfif
Len (order.address2) greater than
1>#order.address2##Chr(13)##Chr(10)#</cfif>#order.town##Chr(13)##Chr(10)
#<cfif Len (order.county) greater than
1>#order.county##Chr(13)##Chr(10)#</cfif>#order.postcode##Chr(13)##Chr(1
0)##order.country##Chr(13)##Chr(10)#<cfif Len (order.tel) greater than
1>Telephone Number: #order.tel##Chr(13)##Chr(10)#</cfif><cfif Len
(order.fax) greater than 1>Fax Number: #order.fax#</cfif>

------------------------------------------------------------------------
-----
http://www.GoldCockerelBooks.co.uk
------------------------------------------------------------------------
-----
        </cfmail>

        <cfmail
To="[EMAIL PROTECTED];michael.roberts@goldcockerelbooks.
co.uk" From="[EMAIL PROTECTED]" query="order"
group="ordernumber" Subject="Order #order.ordernumber# -
�#decimalformat(order.totalPrice)# - #order.recordcount# books"
Type="HTML">
                <cfmailparam name="MIME-Version" value="1.0">
                <table border="0" cellspacing="1" cellpadding="5">
                <tr>
                        <td colspan=2>
                                <span class="bodybold">Order Number
#order.ordernumber#</span><br>
                                <br>
                                #order.name# <a
href="mailto:#order.email#";>#order.email#</a> has ordered these books:
                        </td>
                </tr>

                <tr>
                        <td valign="top"><span
class="bodybold">Books</span></td>
                        <td>
                                <table cellpadding=2 cellspacing=0>
                                <cfoutput>
                                        <tr>
                                                <td class="bodynormal"
width=250>#order.title#</td>
                                                <td
class="bodynormal">#order.quantity#</td>
                                                <td
class="bodynormal">�#decimalformat(order.price)#</td>
                                        </tr>
                                </cfoutput>
                                </table>
                        </td>
                </tr>
                <cfif order.shippingDescription is not "">
                <tr>
                        <td><span class="bodybold">Shipping</span></td>
                        <td><p>#order.shippingDescription#
                        <cfif order.shippingPrice is not
"">(�#decimalformat(order.shippingPrice)#)</cfif>
                        </p>
                        </td>
                </tr>
                </cfif>
                <cfif order.totalPrice is not "">
                <tr>
                        <td><span class="bodybold">Total</span></td>

<td><p>�#decimalformat(order.totalPrice)#</p></td>
                </tr>
                <tr>
                        <td colspan=2>
                        To print this order and all other waiting orders
click this link:<br>
                        <a
href="http://www.goldcockerelbooks.co.uk/update/unsentOrders.cfm";>Get
Unsent Orders</a><br>
                        </td>
                </tr>
                </cfif>
                </table>
        </cfmail>
<cfelseif form.TRANSSTATUS is "C">
        <cfquery name="updateOrder" datasource="goldcockerel">
                update  orders
                set             outcome = 'cancelled'
                where   ordernumber = #request.ordernumber#
        </cfquery>
</cfif>

<cfoutput>
<cf_bodycontent name="confirmationPage">
        <cfmodule template="custom/top.cfm" title="Order Confirmation">
        <table width="520" border="0" cellspacing="0" cellpadding="2"
align="center">
        <tr>
                <td>
                        <h1>Checkout</h1>
                </td>
        </tr>
        <tr>
                <td align="center">
                        <!-- Start of table for Steps -->
                        <table border="0" cellspacing="0"
cellpadding="0">
                        <tr>
                                <td><img src="images/step01_off.gif"
width="119" height="74" border="0" alt="Step 1: Delivery &amp; Billing
Details"></td>
                                <td><img src="images/step02_off.gif"
width="99" height="74" border="0" alt="Step 2: Confirmation"></td>
                                <td><img src="images/step03_off.gif"
width="116" height="74" border="0" alt="Step 3: Payment Details"></td>
                                <td><img src="images/step04_on.gif"
width="117" height="74" border="0" alt="Step 4: Order Processed"></td>
                        </tr>
                        </table><br>
                        <!-- End of table -->
                        <wpdisplay item=banner>
                </td>
        </tr>
        </table>
        <cfmodule template="custom/bottom.cfm">

</cf_bodycontent>

<cfset request.confirmationPage =
replacenocase(request.confirmationPage,"#chr(34)#images/","#chr(34)#/i/5
9671/","all")>
<cfset request.confirmationPage =
replacenocase(request.confirmationPage,"href=#chr(34)#","href=#chr(34)#h
ttp://#cgi.server_name#/","all")>

#request.confirmationpage#
</cfoutput>


Giles Roadnight
http://giles.roadnight.name


-----Original Message-----
From: Stephen Moretti [mailto:[EMAIL PROTECTED]]
Sent: 14 October 2002 17:58
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] MX upgrade

Hmmm...

Can you expand on that?

Does the information get submitted to WorldPay?
Do you get anything at all back from WorldPay?
Have you looked at the full debug output from CF?
How do you send and receive information to and from WorldPay? (code?)

Regards

Stephen

----- Original Message -----
From: "Giles Roadnight" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 14, 2002 5:32 PM
Subject: RE: [ cf-dev ] MX upgrade


> The man says that it is a problem with cfmx not using industry
standard
> something or other. Also they use 16 bit character sets and this may
be
> the problem. Does CFMX understand 16 bit char sets?
>
> The code is:
>
> <cfset request.ordernumber = form.cartid>
>
> fails as it cannot find any form attributes.
>
>
> Giles Roadnight
> http://giles.roadnight.name
>
>
> -----Original Message-----
> From: Taz -=TT=- [mailto:[EMAIL PROTECTED]]
> Sent: 14 October 2002 17:30
> To: [EMAIL PROTECTED]
> Subject: Re: [ cf-dev ] MX upgrade
>
> Could do with seeing some code.
>
> Taz
>
>
> > Firstly MX seems to try to loop through <cfoutput query="whatever">
> even
> > when whatever returns no records. This seems a little strange,
anyone
> > else found this?
> >
> > Secondly and more annoyingly my worldpay callback page keeps
reporting
> > an error in that form variables are not sent to the page. All
> variables
> > are e-mailed to me and there are no form variables in there at all.
I
> > have phoned worldpay and they say it is all working ok at their end
> and
> > it was working fine on CF 5. can anyone think what might be causing
> > this?
> >
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
>


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]



--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to