[ic] SOAP in a payment module - help requested

Josh Lavin josh at perusion.com
Fri Dec 20 15:55:14 UTC 2013


Quoting Stefan Hornburg (Racke) (racke at linuxia.de):
> On 12/20/2013 02:45 PM, Glenn McCalley wrote:
> > Greetings,
> > 
> > The client for one of our stores requires us to use a "non-standard" payment service
> > that provides them with some reporting on sales.  We have processed these payments
> > using an IC payment module hacked from the authorizenet module for several years.
> > 
> > Now, the payment processor has rewritten their system under Windows and is
> > requiring a SOAP / XML type transaction.  (-I- think somebody must have gone
> > to a Micro$oft road show...).
> > 
> > My usual approach is to write a program run from the command line with dummy
> > data just to get a transaction to process.  When that succeeds, integrate the core
> > code from that program into an IC Payment module and there we are.  This time
> > I just can't get the durn thing to work AT ALL - can't even get a response from
> > the server like "invalid card".  All I can get is "Object reference not set to an
> > instance of an object".  Having not worked with SOAP, and finding Google entries
> > for that message equally obtuse I am floundering and out of time.
> > 
> > SO!  If there is someone out there who knows of a working SOAP payment module
> > I can hack up or wwho has relevant experience who would like to take a crack at this
> > compensation is available.
> > 
> 
> We developed this year a payment module for Ipayment, which is based on XML::Compile::SOAP
> (better suited for SOAP than old crufty SOAP::Lite).

There are currently two Interchange payment modules that use SOAP (via
SOAP::Lite), CyberSource and PaypalExpress.

I am also developing a payment module using SOAP/XML, but found both of
those examples to be pretty complicated.

Here is a snippet from my module in-progress, which is the SOAP call and
response, simplified for me... 

    my $host = charge_param('test') ? 'staging.merchantware.net' : 'ps1.merchantware.net';

	## the query hash is the stuff you are sending.
    my @parms;
    while (my ($k,$v) = each %query) {
        push @parms, SOAP::Data->name($k => $v);
    }
    my $soap = SOAP::Lite->new( proxy => "https://$host/Merchantware/ws/RetailTransaction/v4/Credit.asmx" );
    $soap->default_ns('http://schemas.merchantwarehouse.com/merchantware/40/Credit/');
    $soap->on_action( sub { join '', @_ } );  # make it ok for .NET
    my $reply = $soap->call($method, @parms);

#::logDebug("mw result: $reply");
#::logDebug("mw: ".  uneval($reply) );

    my $reply_hash;
    if ($reply->fault) {
		## not handled yet
    }
    else {
        $reply_hash = $reply->valueof('Body/' . $method . 'Response/' .  $method . 'Result');
    }

Maybe that will help you along. You can find support from many
consultants, including Perusion at http://www.perusion.com.

-- 
Josh Lavin
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
... ask me about job opportunities ...



More information about the interchange-users mailing list