my $expresspaymentresponse = $response->valueof('//SetExpressCheckoutResponse/Token');
####
[CODE]#!/usr/bin/perl
## Allow test from browser
print "Content-type: text/html\n\n";
use SOAP::Lite +trace;
use Data::Dumper;
$ENV{HTTPS_CERT_FILE} = '/hsphere/local/home/cgi-bin/test/ppcal_data/cert_key_pem.txt';
$ENV{HTTPS_KEY_FILE} = '/hsphere/local/home/cgi-bin/test/ppcal_data/cert_key_pem.txt';
*SOAP::XMLSchema2001::Deserializer::as_token = \&SOAP::XMLSchema1999::Deserializer::as_string;
# Set the version
my $version = "1.0";
# Retrieve the username, password, and transaction ID from the command line
my $api_username = "999_api1.mail.com";
my $api_password = "pass";
my $ordertotal = "10.99";
my $returnurl = 'http://www.zzz.com';
my $cancelurl = 'http://www.zzz.com';
# The base namespace
my $xmlns = 'urn:ebay:api:PayPalAPI';
# Create the SOAP call.
# https://api.sandbox.paypal.com/wsdl/PayPalSvc.wsdl
my $service = SOAP::Lite
->proxy('https://api.sandbox.paypal.com/2.0/')
->readable(1)
->outputxml(1)
->uri('urn:ebay:api:PayPalAPI')
->on_action(sub{ sprintf "%s%s", @_ });
my $request = SOAP::Data->name( "SetExpressCheckoutRequest" =>
\SOAP::Data->value(
SOAP::Data->name(
"Version" => $version
)->attr(
{xmlns=>"urn:ebay:apis:eBLBaseComponents"}
)->type(""),
SOAP::Data->name( "SetExpressCheckoutRequestDetails" =>
\SOAP::Data->value(
SOAP::Data->name(
"OrderTotal" => $ordertotal
)->attr({"currencyID"=>"USD"})->type(""),
SOAP::Data->name(
"ReturnURL" => $returnurl
)->type(""),
SOAP::Data->name(
"CancelURL" => $cancelurl
)->type(""),
)
)->attr(
{xmlns=>"urn:ebay:apis:eBLBaseComponents"}
)
)
);
# Create the Security Header
my $header = SOAP::Header->name("RequesterCredentials" =>
\SOAP::Header->value(
SOAP::Data->name("Credentials" =>
\SOAP::Data->value(
SOAP::Data->name("Username" => $api_username)->type(""),
SOAP::Data->name("Password" => $api_password)->type(""),
SOAP::Data->name("Subject")->type("")
)
)->attr({xmlns=>"urn:ebay:apis:eBLBaseComponents"})
)
)->attr({xmlns=>$xmlns})->mustUnderstand("1");
# Create the Method
my $method = SOAP::Data
->name('SetExpressCheckoutReq')
->attr({xmlns=>$xmlns});
*SOAP::Deserializer::typecast = sub {shift; return shift};
# Execute the call
my $response = $service->call($header, $method => $request);
my $expresspaymentresponse = $response->valueof('//SetExpressCheckoutResponse/Token');
my $teststring = Data::Dumper->Dump([$expresspaymentresponse] , ['*expresspaymentresponse']);
print "$teststring";
exit;
####
2005-09-10T04:32:10ZSuccessNotSet1.0000001.0006EC-1K6559638C886540F