News:

Looking for documentation? Take a look on our wiki

Main Menu

Please help - not exactly a payment processor but almost

Started by 2eazy, November 30, 2005, 22:26:39 PM

Previous topic - Next topic

2eazy

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";
}

Richard

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?

jdam

I'm also working on this kreditor. I'm doing trial and error. stay tune.

-Jd
Web identity solutions bridge humanities and technologies for a better future!

-www.jdam.us

Sophie


jdam

It doesn't work on VM 1.1.2, STEP 4 has different line
of code.

-Jd
Web identity solutions bridge humanities and technologies for a better future!

-www.jdam.us

Sophie

Ok, I guess I won't upgrade then... Please let us know how you're doing with the "upgraded" module!

Scar