473,609 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

post form data to worldpay using c#

Hi all,

I am just trying to set up a form post to worldppay and finding it
surprisingly difficult.. What i would like is to gather all of the
variables needed in c# codebehind and then send them along to worldpay
along with the user.. Basically i dont want the user to have to submit
a button it will do it automatically..

I have followed this code and i think it posts the data but wont take
the user to the worldpay page as well

Please help as this is really annoying me

Cheers
Anr
............... ............... ............... ....

string lcUrl = "https://select.worldpay .com/wcc/purchase";

HttpWebRequest loHttp =
(HttpWebRequest ) WebRequest.Crea te(lcUrl);

// *** Send any POST data

string lcPostData =

"instId=" + HttpUtility.Url Encode("1") +
"&cartId=" + HttpUtility.Url Encode("Myteste r") +
"&amount=" + HttpUtility.Url Encode("1000") +
"&currency= " + HttpUtility.Url Encode("GBP") +
"&desc=" + HttpUtility.Url Encode("Myteste r Products")+
"&testMode= " + HttpUtility.Url Encode("100")
;

loHttp.Method=" POST";
byte [] lbPostBuffer = System.Text.
Encoding.GetEnc oding(1252).Get Bytes(lcPostDat a);
loHttp.ContentL ength = lbPostBuffer.Le ngth;
Stream loPostData = loHttp.GetReque stStream();
loPostData.Writ e(lbPostBuffer, 0,lbPostBuffer. Length);
loPostData.Clos e();

HttpWebResponse loWebResponse = (HttpWebRespons e)
loHttp.GetRespo nse();
StreamReader loResponseStrea m =
new StreamReader(lo WebResponse.Get ResponseStream( ));

string lcHtml = loResponseStrea m.ReadToEnd();
loWebResponse.C lose();
loResponseStrea m.Close();
Nov 18 '05 #1
0 3214

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1508
by: vanstory | last post by:
So I've created an ASP form which submits information to a mySQL database table. This information will be downloaded via ODBC on a daily basis. Now some of this information is stuff like credit card numbers. What are my options as far as securing the form submission? We will also be looking for a hosting company, so any suggestions of a company that would work with us on getting this setup, would also be helpful. Thanks a lot!
15
3118
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST. When I find is that if I send the value by the GET method, response.write("From QueryString: " & Request.QueryString("usernamefromform") & "<br><br>")
2
1522
by: Paul H | last post by:
My customer has an ecommerce store. He receives approx 600 orders per month. Worldpay.com handles the credit card transactions and sends my customer an email for each order containing the information exactly as shown below. We need to get the Shoppers details, Shipping details and the product details out of Outlook and into Access. I can take care of the database construction, but I just need some advice on how best to format the Worldpay...
0
1090
by: Rudi Ahlers | last post by:
Has anyone used Worldpay for E-Commerce usage before? And if so, what experiences have you had with them, integrating it into your / a client's website? I need to setup an E-commerce website for a client, and they came highly recommended. Any comments would be appreciated -- Kind Regards Rudi Ahlers
0
1632
by: Andy Everett via .NET 247 | last post by:
Has anybody had experience of integrating with WorldPay using C#please? I have rewritten the example asp code in C#/ASP.NET. Every aspect of this has been a success except one. Whencalling the produce method on the WorldPay object I am asked tosupply an object parameter . Obviouslythis does not happen within ASP. I have tried passing both'new' and 'null' objects neither works. In the case of 'null'it appears as if the WorldPay DLL has been...
2
12546
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser <form action="display.aspx" method="post" target="_blank"> will submit the form data and open display.asp in a new browser
2
1657
by: Richard Brooks | last post by:
Is anyone using a payment routine withing their own php site ? I'd assume a MySql database is needed to remember days paid for and a date/time counter against cost per day but are there more specific details that one can learn before paying for an account ? I've tried emailing WorldPay for more specific details so that I can get my routines such as redirections worked out properly but they don't seem to reply and their tutorials are...
2
1509
by: Aggelos | last post by:
Hello, I can't get my head around form mail scripts and people injecting extra code in there. I don't know if they actually achieve anything or not. I am using a script from Web4Future Easiest Form2Mail (GPL). Copyright (C) 1998-2005 Web4Future.com All Rights Reserved. http://www.Web4Future.com/ Does anyone know if that script is supposed to be secure. ? Anyway... my point is not that much just the formmail script but any
1
2015
by: sajit | last post by:
Hi folks, Currently I am developing a shopping cart in which i need worldpay integartion. I also want customer to be redirected to my web site after transaction. Worldpay also provide default pages for that purpose but i need a customized page on which customer will be redirected after transaction. So do any one have a code snippet which can assist me in integration. Any help is appreciated.
0
8127
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8527
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8398
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5509
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2529
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.