Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Use <form metheod = "post" action to send data


Recommended Posts

Posted

My payment gateway doesn't want me sending credit card information directly to them, they want to have it processed on their page, using the following code.

 

<form method = "post" action =

"https://merchants.firstatlanticcommerce.com/order.cfm">

 

<input type = "hidden" name = "id" value = merchant ID">

<input type = "hidden" name = "amount" value = "total amount of sale">

 

<input type = "hidden" name = "item1" value = "name of first item">

<input type = "hidden" name = "qty1" value = "quantity of first item">

 

<input type = "hidden" name = "item2" value = "name of second item">

<input type = "hidden" name = "qty2" value = "quantity of second item">

 

<input type = "hidden" name = "item3" value = "name of third item">

<input type = "hidden" name = "qty3" value = "quantity of third item">

 

<input type = "submit" value = "submit order">

<?form>

 

This is a fairly straightforward piece of HTML but unfortunately I am not so up on the php - I need to assign my vairables to make this work and idealy would like to make it into a full working module. NOW... I don't want to have to get the php manual out and code it all from the start - anyone know what is the closest module that I can interfere with or change to get mine to work?

peteman

Posted

To be honest I don't have a lot of choice. I live in Bermuda.

I have almost got it sorted though. I am just trying to work out how to process the returned variables.

I am using the SECpay module as a template. Taking a lot of stuff out - adding a few bits in. Any input will still be appreciated though.

(apart from the slagging off of Bermuda - not very constructive!) :angry:

Cheers

peteman

Posted

I would start with something like the PayPal module and modify the process_button function to include the hidden variables you need. Then you need to modify the before_process function to catch the gateway's response.

 

Hth,

Matt

Always back up before making changes.

  • 6 months later...
Posted

Hi this is my first post. I am trying to do something similar but after payment confirmation, customer goes back to the log in page.

 

Then you need to modify the before_process function to catch the gateway's response.

 

Hth,

Matt

 

Matt, can you be more specific? This is the responce code from my bank (WinBank):

in case of success:

 

<%

 

? Get output parameters

Dim transactionid

transactionid= Request.Form("transactionid")

 

Dim merchantreference

merchantreference = Request.Form("merchantreference")

 

Dim responsecode

Responsecode = Request.Form("responsecode")

 

Dim responsedescription

responsedescription = Request.Form("responsedescription")

 

Dim retrievalref

retrievalref = Request.Form("retrievalref")

 

Dim approvalcode

approvalcode = Request.Form("approvalcode")

 

Dim errorcode

errorcode = Request.Form("errorcode ")

 

Dim errordescription

errordescription = Request.Form("errordescription")

 

Dim amount

Amount = Request.Form("amount")

 

Dim installments

Installments = Request.Form("installments")

 

Dim cardtype

cardtype = Request.Form("cardtype")

 

Dim langid

Langid = Request.Form("langid")

 

Dim parameters

Parameters = Request.Form("parameters")

 

 

?Respond to user

 

Response.write ?Η πληρωμή ολοκληρώθηκε επιτυχώς. Αριθμός πληρωμής: ? & transactionid

 

? Log in local database all output parameters

 

%>

 

in case of failure:

 

<%

 

? Get output parameters

Dim transactionid,

transactionid= Request.Form("transactionid")

 

Dim merchantreference

merchantreference = Request.Form("merchantreference")

 

Dim responsecode

Responsecode = Request.Form("responsecode")

 

Dim responsedescription

responsedescription = Request.Form("responsedescription")

 

Dim retrievalref

retrievalref = Request.Form("retrievalref")

 

Dim approvalcode

approvalcode = Request.Form("approvalcode")

 

Dim errorcode

errorcode = Request.Form("errorcode ")

 

Dim errordescription

errordescription = Request.Form("errordescription")

 

Dim amount

Amount = Request.Form("amount")

 

Dim installments

Installments = Request.Form("installments")

 

Dim cardtype

cardtype = Request.Form("cardtype")

 

Dim langid

Langid = Request.Form("langid")

 

Dim parameters

Parameters = Request.Form("parameters")

 

 

? Check output parameters ? Respond to user

 

If errorcode <> 0 then

Response.write ?Λάθος κατά την εκτέλεση της πληρωμής: ? & errordescription

Else

Response.write ?Η πληρωμή απέτυχε: ? & responsedescription

End If

 

? Log in local database all output parameters

 

%>

 

Any ideas would be more than apreciated

 

Thanks in advance

Posted

Help anyone?

 

All i need is some directions on how to put the above variables in function before_process.

 

thanks again

 

Patmanx

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...