in reply to PayPal Adaptive SOAP request?

Couldn't you use Business::PayPal::API?

Also https://developer.paypal.com/docs/classic/adaptive-payments/gs_AdaptivePayments/ gives examples in JSOn not SOAP , so I'd chose JSON :)

  • Comment on Re: PayPal Adaptive SOAP request? (JSON)

Replies are listed 'Best First'.
Re^2: PayPal Adaptive SOAP request? (JSON)
by ultranerds (Hermit) on Apr 01, 2014 at 10:07 UTC
    Thanks for the reply. I have actually tried that module already, but it doesn't work with the parallel payments AFAIK.

    For the JSON - thanks, I'll take a look into that. I would also prefer that method, as its much easier to make a hashref, then convert it using JSON.pm into a JSON string.

    Thanks!
Re^2: PayPal Adaptive SOAP request? (JSON)
by ultranerds (Hermit) on Apr 01, 2014 at 11:26 UTC
    Thanks, its getting there :)

    my $user = 'xxxx'; my $password = 'xxx'; my $signature = 'xxx'; my $application_id = 'APP-80W284485P519543T'; my $url = 'https://svcs.sandbox.paypal.com/AdaptivePayments +/Pay'; my $ua = LWP::UserAgent->new(); my $headers = HTTP::Headers->new( 'X-PAYPAL-SECURITY-USERID' => $user, 'X-PAYPAL-SECURITY-PASSWORD' => $password, 'X-PAYPAL-SECURITY-SIGNATURE' => $signature, 'X-PAYPAL-APPLICATION-ID' => $application_id, 'X-PAYPAL-DEVICE-IPADDRESS' => $ENV{REMOTE_ADDR}, 'X-PAYPAL-REQUEST-DATA-FORMAT' => 'JSON', 'X-PAYPAL-RESPONSE-DATA-FORMAT' => 'JSON' ); my $json_var = { requestEnvelope => { detailLevel => "ReturnAll", errorLanguage => "en_US", }, actionType => "PAY", currencyCode => "USD", receiverList => { receiver => [ { amount => 5, email => 'andy.newby@gmail.com', totalShipping => 10 }, { amount => 15, email => 'foobar@gmail.com' } ], }, returnUrl => 'http://paypal.angelleye.com/paypal/class/1.2/Pay +_Return.php', cancelUrl => 'http://paypal.angelleye.com/paypal/class/1.2/Pay +_Cancel.php' }; use JSON; my $new_json = JSON::to_json($json_var); # print "FOO: $new_json \n\n"; my $request = HTTP::Request->new( 'POST', $url, $headers, $new_json ) +; my $response = $ua->request( $request ); #print $response->status_line, "\n"; my $json_returned = decode_json($response->decoded_content); print qq|Location: https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ +ap-payment&paykey=$json_returned->{payKey} \n\n|;
    The only thing I can't figure out now, is how to get a shipping price in per person. I guess I could just add it into the total cost, but I think people would prefer to see it as a separate field.

    Any ideas on that one? (not sure how familiar you are with this payment system)