Post by hannesk » Fri Jul 24, 2009 2:08 am

Hi folks
i've recently dl-ed and installed the latest release of opencart, it seems i will hav to write a custom payment module because i need to use it with http://www.mygate.co.za. i have used it in custom built php sites but since i'm a opencart noob i'm not fimiliar with how to implement the code i have. here is a look at simple php script that interfaces with mygate:

Code: Select all

<?php

$client = new SoapClient("https://www.mygate.co.za/enterprise/4x0x0/ePayService.cfc?wsdl"); //gateway adr.
$arrResults = $client->fProcess(
'21',                                                            	//Gateway
'79958a8d-0c7b-4038-8e2e-8948e1d678e1',  	//MerchantID
'4b775479-a264-444c-b774-22d5521852d8', 	//ApplicationID
'1',		                                                //Action
'',			                                //TransactionIndex
'Website',	                                                                //Terminal
'0',		                                                //Mode
'TST123',	                                                                //MerchantReference
'654.76',	                                                                //Amount
'ZAR',		                                                //Currency
'',			                                //CashBackAmount		
'4',		                                                //CardType
'',			                                //AccountType
'4111111111111111',		                                //CardNumber
'Joe Soap',	                                                                //CardHolder
'123',		                                                //CCVNumber
'12',		                                                //ExpiryMonth
'2007',		                                                //ExpiryYear
'0',		                                                //Budget
'',			                                //BudgetPeriod
'',			                                //AuthorizationNumber
'',			                                //PIN
'',			                                //DebugMode
'06',		                                                //eCommerceIndicator			
'',			                                //verifiedByVisaXID
'',			                                //verifiedByVisaCAFF
''			                                //secureCodeUCAF
);
foreach ($arrResults as $result)
{
	print_r(explode('||', $result));
	echo("<br />");	
}
			
?>

Note that the comments are the VARS that can be used with mygate, however, the ones that are empty (ie. '';) doesnt need to be used for creditcards.

Please help me out here, if we can a module going, i'll submit it to MyGate, which i'm sure will be a good thing for everyone in south africa using or looking to use opencart with mygate as mygate is the most popular payment system here in terms of usability. other than that, opencart is by far my fav ecom platform :)
I look forward to a reply.

Newbie

Posts

Joined
Fri Jul 24, 2009 1:45 am

Post by hannesk » Fri Jul 24, 2009 2:18 am

sorry that code looks bad, heres a working example of interfacing to mygate:

Code: Select all

<html>
<head>
</head>
<body>

<br><br><b>MyGate Enterprise Webservice Intregration Example - PHP</b><br><br><br>
<!--

T R O U B L E  S H O O T I N G  H I N T S

	*	All parameters are accepted as type string and therefore should be entered as strings.
	*	All parameters must be passed through IN THE CORRECT SEQUENCE even when string is empty.
	*	The MerchantID and ApplicationID have been set up by MyGate for testing purposes. 
		Please that you have a MerchantID and ApplicationID set up with MyGate, 
		and that all integration requirements (as specified in the support documentation) have been met.
	*	Please inform MyGate of the URL (eg 192.168.34.23) from which you will be connecting to the webservice,
		as MyGate needs to enable this URL for use against the webservice.
	*	Please consult the MyGate Enterprise User Manual (retievable from the www.mygate.co.za website) for 
		definitions of all parameters expected by the webservice, as well as permissible values for these parameters.
	*	Please contact MyGate (details available off website) if you have any integration problems.
	
-->

<?php

$client = new SoapClient("https://www.mygate.co.za/enterprise/4x0x0/ePayService.cfc?wsdl");
$arrResults = $client->fProcess(
'21', 	//Gateway
'79958a8d-0c7b-4038-8e2e-8948e1d678e1',  	//MerchantID
'4b775479-a264-444c-b774-22d5521852d8', 	//ApplicationID
'1',		//Action
'',			//TransactionIndex
'Website',	//Terminal
'0',		//Mode
'TST123',	//MerchantReference
'654.76',	//Amount
'ZAR',		//Currency
'',			//CashBackAmount		
'4',		//CardType
'',			//AccountType
'4111111111111111',		//CardNumber
'Joe Soap',	//CardHolder
'123',		//CCVNumber
'12',		//ExpiryMonth
'2007',		//ExpiryYear
'0',		//Budget
'',			//BudgetPeriod
'',			//AuthorizationNumber
'',			//PIN
'',			//DebugMode
'06',		//eCommerceIndicator							
'',			//verifiedByVisaXID
'',			//verifiedByVisaCAFF
''			//secureCodeUCAF
);

foreach ($arrResults as $result)
{
	print_r(explode('||', $result));
	echo("<br />");	
}
			
?>

<body>
</body>
</html>


Newbie

Posts

Joined
Fri Jul 24, 2009 1:45 am

Post by Daniel » Fri Jul 24, 2009 6:37 pm

this look very easy todo.
do you have a link to the manual?

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by hannesk » Fri Jul 24, 2009 6:50 pm

I don't have a link to the manual no.
i spoke the mygate, they've agreed to have a module for opencart on their site.
i'm just still trying to work out how it's supposed to interact with the other VAR's.
sorry if i'm not making much sense but without code comments it feels like i'm looknig for a haystack in a needle, can you perhaps asist me or point me in the right direction?

Newbie

Posts

Joined
Fri Jul 24, 2009 1:45 am

Post by tsoogoo » Mon Nov 15, 2010 12:00 pm

Class 'SoapClient' not found in error

Newbie

Posts

Joined
Mon Nov 15, 2010 11:57 am

Post by Qphoria » Mon Nov 15, 2010 1:08 pm


Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 1 guest