Hi,
I'm trying to extend active merchant to support the RBS worldpay
global gateway (formerly known as Bibit).
My first question is : Has anyone implemented this yet ?
if not. I'm having some trouble and hoping someone can shed some light
to it. For your information BiBit only supoprts an XML API.
It says in the bibit documentations
"To submit the XML order you have to set up an HTTP(S) connection to
the Payment Service. How you create a connection with another RBS
WorldPay server depends on the specifications of your platform...When
setting up the connection, use your merchant code (always in capitals)
as the login and your XML password as the password...Once you have set
up the connection to the Payment Service, your system has to post the
XML order.
Make sure the HTTP content type is ”text/xml”!... "
Now the problem is all the gateways which support SOAP API in Active
Merchant, they take the username and password as xml elements. But
there is not the case with BiBit. There is so provision for supplying
passwords in the XML DTD.
They have provided me with a sample php code which has this entry
----------------------------------------------------------------------
function Bibitstart($debug) {
$this->debug = $debug;
if($this->debug)
$this->url = "https://" . $this->merchantCode . ":" . $this-
>merchantPassword . "@
secure-test.bibit.com/jsp/merchant/xml/
paymentService.jsp";
else
$this->url = "https://" . $this->merchantCode . ":" . $this-
>merchantPassword . "@
secure.bibit.com/jsp/merchant/xml/
paymentService.jsp";
}
function CreateConnection() {
$ch = curl_init ($this->url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->xml); //$xml is the
xml string
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/
xml"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
// echo "ch: $ch<HR>" ;
$result = curl_exec ($ch); // result will contain XML reply from
Bibit
curl_close ($ch);
if ( $result == false )
print "Curl could not retrieve page '$this->url', curl_exec
returns false";
return $result;
}
----------------------------------------------------
I have built the gateway on the basis on PayPal gateway and for
authentication just used
TEST_URL = "https://<username>:<password>@
secure-test.bibit.com/jsp/
merchant/xml/paymentService.jsp"
Is this enough or am i missing something? I'm getting authentication
error..
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>401 Authorization Required</TITLE>
</HEAD><BODY>
<H1>Authorization Required</H1>
This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.<P>
</BODY></HTML>
ActiveMerchant::ResponseError: Failed with 401 Authorization Required
The username and password is correct , cause they work with the sample
php code.
Is there any other way to "establish a connection" before posing xml
in Active Merchant?
Quick reply would be appreciated.
Thanks
A.K