VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Payment Modules => Topic started by: 2eazy on November 30, 2005, 22:26:39 PM

Title: Please help - not exactly a payment processor but almost
Post by: 2eazy on November 30, 2005, 22:26:39 PM
Hi,

I would like to know if it is possible to convert my current "payment" solution "Kreditor" (Swedish) to VM. "Kreditor" works like this:

Before a purchase is made Kreditor make a online credit check on everybody who choose "invoice" as payment and if the credit report is good the purchase goes throu and the processor (Kreditor) takes care of generating an invoice - else the customer gets a message that tells them why they weren't approved and is returned to the payment option page. I get my money from "Kreditor" when the invoice has been paid.

The thing is that it has to communicate with a server prior to approving the order - similar to a credit card processor - so I guess it should be possible to find a solution for this since VirtuaMart has such payment solutions. The problem is that I'm not a very good php-programmer and I'm new to the whole Joomla and VM API.  :-\ I have a working setup with OsCommerce - but personally I don't understand why anyone uses osCommerce anymore - it is terrible to work with and I want to change to VM!
:)
If anyone could help me with this - at least to get me started an point me the right direction I will be very grateful.
I have attached the basic code that "Kreditor" has provided me with (note: this is not the code used for osCommerce processing - this is the most fundamental code necessary to process a credit inquiery).
:)
1. Please explain to me wich metod I should use to setup this solution.
2. Please give me info about what db inquieries should go where since I'm a bit lost on the whole Joomla and VM db structure.


include "kreditor.php";
$eid = 2;
$estoreUser = $_GET["estore_user"];
$secret = "lakrits";
$estoreOrderNo = $_GET["estore_order_no"];
$goodsList =
    array(mk_goods(intval($_GET["qty0"]), $_GET["artno0"], $_GET["desc0"],
   intval($_GET["price0"])*100, 25, 0),
  mk_goods(intval($_GET["qty1"]), $_GET["artno1"], $_GET["desc1"],
   intval($_GET["price1"])*100, 25, 0),
  mk_goods(intval($_GET["qty2"]), $_GET["artno2"], $_GET["desc2"],
   intval($_GET["price2"])*100, 25, 0));
$shipmentfee = 1200;
$shipmenttype = $NORMAL_SHIPMENT;
$handlingfee = 0;
$pno = $_GET["pno"];
$fname = $_GET["fname"];
$lname = $_GET["lname"];
$street = $_GET["street"];
$postno = $_GET["postno"];
$city = $_GET["city"];
$addr = mk_addr("", $street, $postno, $city, "", "", "");
$passwd = "";
$clientIp = $_SERVER["REMOTE_ADDR"];
$newPasswd = "";

if ($_GET["auto"] == "yes")
    $flags = $KRED_AUTO_ACTIVATE;
else
    $flags = 0;

if ($_GET["pre"] == "yes")
    $flags |= $KRED_PRE_PAY;

$comment = "?nnu ett k?p!";
$ready_date = "";
$rand_string = "";
$status =
     add_invoice($eid, $estoreUser, $secret, $estoreOrderNo,  $goodsList,
                 $shipmentfee, $shipmenttype, $handlingfee, $pno, $fname,
                 $lname, $addr, $passwd, $clientIp, $newPasswd, $flags,
                 $comment, $ready_date, $rand_string, $result);

switch ($status) {
case 0:
      echo "Invoice number" . $result . " created.";
      echo "Back";     
      break;
case -99:
      echo "Internal error: " . $result . "";
      echo "Back";
      break;
default:
      echo "Error code: " . $status . "";
      echo "Reason: " . strerror($result) . "";
      echo "Back";
}
Title: Re: Please help - not exactly a payment processor but almost
Post by: Richard on December 18, 2006, 13:39:49 PM
I have the same problem. Don't know how to make the system check if a person pass the control before the order is stored. (Before the order confirmation page).

Is there anyone who has succesfully integrated Kreditor's system into Virtuemart?
Title: Re: Please help - not exactly a payment processor but almost
Post by: jdam on October 09, 2008, 03:45:25 AM
I'm also working on this kreditor. I'm doing trial and error. stay tune.

-Jd
Title: Re: Please help - not exactly a payment processor but almost
Post by: Sophie on October 09, 2008, 10:21:45 AM
... but I think Kreditor already has developed such a module themselves - look here in the swedish forum:
http://virtuemart.se/index.php?option=com_joomlaboard&Itemid=3&func=view&id=31&catid=5
Title: Re: Please help - not exactly a payment processor but almost
Post by: jdam on October 10, 2008, 13:45:09 PM
It doesn't work on VM 1.1.2, STEP 4 has different line
of code.

-Jd
Title: Re: Please help - not exactly a payment processor but almost
Post by: Sophie on October 31, 2008, 13:06:21 PM
Ok, I guess I won't upgrade then... Please let us know how you're doing with the "upgraded" module!
Title: Re: Please help - not exactly a payment processor but almost
Post by: Scar on November 10, 2008, 23:30:32 PM
I'm also interested in this. How is it going, jdam?