2013-10-09 44 views
2

我將貝寶與我的網上商店進行整合,該網上商店有多個商家銷售商品。只要商家進入系統,系統就會要求他的Paypal電子郵件接收買家的付款。 我現在陷在我的店鋪整合貝寶:貝寶與多家商家的網上商店

  1. 哪些API我可以用它來讓買家直接付款給商家Paypal帳戶(不需要通過我的應用程序發送)?
  2. 商家是否需要在其Paypal帳戶中進行任何配置(例如啓用API訪問或類似的功能)?當我的商家沒有很好的IT技能時,這對我來說將是一個巨大的問題。他們不知道API是什麼意思。

請給我建議從PayPal API,我應該使用。如果需要信息,我正在使用PHP。

親切的問候

+0

任何人,請幫助! – user2858370

+0

請參閱https://developer.paypal.com/webapps/developer/docs/api/。每個API都有示例php代碼。 PayPal沒有cakphp插件。你必須用php編寫。 – nithin

+0

事實上,CakePHP有一個PayPal組件。我在我的回答中寫到了它。 –

回答

0

所有貝寶需要的是你建立一個形式正確的參數:amountbusinesscurrencyitem_name

如果商家有某種形式的輪廓在您的網站,那麼你可以將他們的PayPal地址存儲在其中,並且當有人在您的網站上查看「他們的」商店時,將該值用作business參數(付款發送到的地方)。

希望這可以爲你解決問題。

0

您可以使用CakePHP PayPal組件將您的網站與PayPal集成: https://github.com/robmcvey/cakephp-paypal

但是要在任何地方使用PayPal API,PayPal賬戶必須是Pro賬戶。您還需要爲每個帳戶(從PayPal - > Profile - > API Settings - > Signature)獲取API用戶名,密碼和簽名並將其放入您的代碼中。

在控制器的樣本代碼可能是這樣的:

class SomeController extends AppController { 
    public $components = array('Paypal'); 

    public function payWithPaypal() { 
     $this->Paypal->config['password'] = 'your paypal password'; 
     $this->Paypal->config['email'] = 'your paypal email'; 
     $this->Paypal->config['signature'] = 'your paypal signature'; 
     $this->Paypal->sandboxMode = false; 

     $this->Paypal->amount = 100; 
     $this->Paypal->itemName = 'some item'; 
     $this->Paypal->quantity = 1; 
     $this->Paypal->localeCode = 'GB'; 
     $this->Paypal->currencyCode = 'EUR'; 
     $this->Paypal->returnUrl = 'some url'; 
     $this->Paypal->cancelUrl = 'some url'; 
     $paypal_url = $this->Paypal->expressCheckout(); 
     $this->redirect($paypal_url); 
    } 
} 

閱讀組件文檔和代碼註釋的組件類裏面熟悉的細節。