Previous Topic

Next Topic

Locate topic in Contents

Example of Test Code for create_offline_payment Function

#!/usr/bin/perl

use strict;

use SOAP::Lite;

use Data::Dumper;

my $client = SOAP::Lite

->proxy('https://hspc_mn_server_name/hspc/xml-api')

->on_fault(sub {die 'Fault: '.$_[1]->faultstring.' '.$_[1]->faultcode.' '.$_[1]->faultdetail});

my $sid = $client->ns('HSPC/API/1.0')->session_open(

{

email => 'someuser@somehost', password => 'somepassword'

}

)->result->{session_id};

$client->transport->http_request->header('HSPC-SID' => $sid);

my %h = (

amount => 5,

account_id => 2,

ref_num => 'test offline payment',

doc_list => [103],

adjust_error_fatal => 1,

);

my $obj = $client->ns('HSPC/API/Billing/1.0')->create_offline_payment(%h)->result;

print "\nResult: " . Dumper($obj);

$client->ns('HSPC/API/1.0')->session_close;

Please send us your feedback on this help page