Question

I have some problem when i integrate PayPal with SOAP API.

Now, This my code

// Set paypal
// Include NuSOAP
$url_nusoap                 = "xxx/nusoap/nusoap.php";
include($url_nusoap);

$wsdl_URL = "https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl";
$s_URL  = "https://api-3t.sandbox.paypal.com/2.0/";
$s_Ver  = "94.0";

$header = "";
$header .= "<RequesterCredentials xmlns='urn:ebay:api:PayPalAPI' xsi:type='ebl:CustomSecurityHeaderType'>";
$header .= "<Credentials xmlns='urn:ebay:apis:eBLBaseComponents' xsi:type='ebl:UserIdPasswordType'>";
$header .= "<Username>@api_username@</Username>";
$header .= "<Password>@api_password@</Password>";
$header .= "<Signature>@api_signature@</Signature>";
$header .= "</Credentials>";
$header .= "</RequesterCredentials>";

$s  = new soap_client($wsdl_URL, true);
$err = $s->getError();
if ($err) die("Soap client constructor err.. check wsdl url");

//set end point
$s->setEndpoint($s_URL);

$s->setHeaders($header);

$bodyReq = "?"
$result = $s->call("?", $bodyReq);

And my problem is i don't know what should i call API in "$bodyReq" and $s->call(); ? This my situation : In my site can select pay method

  1. Paypal
  2. xxx
  3. xxx

When i choose "1 Paypal" and submit - Redirect to "pay_checker" if pay_method == "Paypal" redirect to "PAYPAL SOAP API Page" (if pay_method == "xxx" redirect it to some API in other pay services)

I need if i select "PayPal method" and redirect to "PAYPAL SOAP API" page it's call some API to pass $amount ,$product_name and redirect to PAYPAL Billing page

somebody help me please

Thank you.

Edit ------ Now i learn "ExpressCheckout" but i don't know where point to learn it

Was it helpful?

Solution

What you currently have is building your credentials only, which would then get included in your actual XML request, which is where $bodyReq would come into play.

PayPal provides plenty of documentation for Express Checkout, including this document specific to the SOAP API. Chapter 6 covers Express Checkout.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top