Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Payment Plugin


oscommrookie

Recommended Posts

Hi,

 

I want to implement a new payment plugin, because my payment provider isn't supported by any module yet.

It should be pretty easy, all I need to do is to send some fields to the payment page of my provider using HTTP GET.

 

But I'm kinda new to php and even http.

 

So, here's the information I got:

 

I need to forward following fields to the payment page:

- CustomerID

- Checksum

- ReferenceNumber

- TransType

- Amount

- Currency

- MerchantInfo

- RedirectURL

 

This fields should be put into a redirection string:

 

$CustomerID = "yourcustomerID";
$ReferenceNumber = "ABC";
$Amount = "10.00"
$secretKey = "yourSecret"
$checksum = md5($CustomerID.$ReferenceNumber.$Amount.$secretkey);

$URL  = "CustomerID".$CustomerID;
$URL .= "&Checksum= ".$checksum;
$URL .= "&TransType=auth";
$URL .= "&ReferenceNumber=".$ReferenceNumber;
$URL .= "&MerchantInfo=www.shop.com;[email protected] ";
$URL .= "&Amount=".Amount;
$URL .= "&Currency=EUR";

$HOST		 = https://securexxxxx/xxx/transaction.php
$REDIRECT LINK = $HOST."?".$URL";

Header("Location: $REDIRECT_LINK");

 

So my question is, how do I build a plugin (php file to put in \includes\languages\xxx\modules\payment or \includes\modules\payment) which does forward the URL when the customer presses the "Next" button during the checkout process.

Especially I have to know how to get the CustomerID and the Amount of the processed basket and which methods I have to implement to build a proper plugin.

The payment page provides an AUTH (allocates the enquired amount on a credit cards line) and a SETTLE function (does the actual settlement).

So I guess I have to use AUTH after the customer chose his payment method and the SETTLE when the customer confirms his order.

 

After the URL was posted correctly, I will get a result from my payment providers payment page which I can use to redirect to the next step.

 

Can someone please provide me with a piece of skeleton code I could put this in?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...