2013-01-01 149 views
0

當我將PayPal與SOAP API集成時,我遇到了一些問題。如何將Paypal與SOAP API集成?

現在,這是我的代碼

// 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>@[email protected]</Username>"; 
$header .= "<Password>@[email protected]</Password>"; 
$header .= "<Signature>@[email protected]</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); 

而我的問題是,我不知道我怎麼稱呼中的 「$ bodyReq」 API和$ S->()調用; ? 這是我的情況: 在我的網站可以選擇付費方式

  1. XXX
  2. XXX

當我選擇 「1貝寶」,並提交 - 重定向到 「pay_checker」 如果pay_method ==「貝寶」重定向到「PAYPAL SOAP API頁面」(如果pay_method ==「xxx」將其重定向到其他付費服務中的某些API)

我需要如果我選擇「Pa yPal法」,並重定向到‘PAYPAL SOAP API’頁是調用一些API通過$金額,$ PRODUCT_NAME和重定向到PayPal結算頁面

有人幫助我,請

謝謝。

編輯------現在我學「ExpressCheckout」但我不知道在哪裏點,以瞭解它

回答

0

什麼,你現在有隻建立您的憑據,那麼這將存在於你的實際XML請求,這是$ bodyReq將發揮作用的地方。

貝寶提供了大量的documentation for Express Checkout,包括this document specific to the SOAP API。第6章介紹Express Checkout。

+0

謝謝你,最後我用了Express Checkout(Set,Get,Do),沒關係!我可以使用SOAP和XML重定向到結算頁面,而不是「paypal button」 感謝您的建議 – Guzzilar