Linked Questions

Popular Questions

How do I call Transpact API using PHP code within Wordpress

Asked by At

This maybe a bit of a noob question, but I have searched and come up short. I have a website where I want to use Transpact.com as the payment method. My site uses woocommerce but creating a separate gateway doesn’t seem to be an option. I have received communication from Transpact that the calling of their API is simple, a single line of php code and they have sent me the following code, but while I can edit it for the bits I need, I’m struggling to see where to start with this. Here’s what they sent;

An example of PHP code to use the Transpact.com API might be to use something like:

$ap_param = array(
    'Username'=>[email protected]', 
    'Password'=>**, 
    'CreateType'=>"3", 
    'MoneySenderEmail'=>" [email protected] ", 
    'MoneyRecipientEmail'=>" [email protected] ", 
    'Amount'=>2000, 'Currency'=>"EUR", 
    'NatureOfTransaction'=>7, 
    'SenderFee'=>0, 
    'RecipientFee'=>0, 
    'OriginatorFee'=> 6.98, 
    'NameReferee'=>"Fred Smith", 
    'EmailReferee'=>"[email protected]", 
    'TranspactNominatedReferee'=>False, 
    'MaxDaysDisputePayWait'=>14, 
    'Conditions'=>"PeterPiper picked a peck of pickled peppers. So what",
    'ConditionsConsumerClause'=>True,
    'CanTransactorsChangeConditions'=>False,
    'OriginatorFixedCommisionOnSendToAll'=>25
);

$client = new SoapClient("https://www.transpact.com/securepartner/partner.asmx?WSDL");

$result = $client->__call("CreateTranspact", array($ap_param));

Can anyone advise me where to start. It seems quite incomplete as an instruction and they can’t help further. I’d appreciate any pointers.

edit --- I've now found this tutorial https://www.sitepoint.com/building-a-woocommerce-payment-extension/ So I'm going to follow that and see how I get on. Hopefully if I manage it, I can add the files so others can use it. I'm sure I'll have to ask for specific help on here who I get stuck.

Related Questions