2014-12-08 86 views
2

我正在嘗試在我的網站中添加一個捐贈按鈕。 這個想法是允許用戶從他們的賬戶向管理員賬戶匯款。 我用Paypal REST SDK發錢,但我發現管理員帳戶是由交易費用支付的,這取決於用戶的國家。使用Paypal php匯款錢其他SDK

     $payer = new Payer(); 
         $payer->setPaymentMethod('paypal'); 

         $amount = new Amount(); 
         $amount->setCurrency('EUR') 
           ->setTotal($money); 

         $transaction = new Transaction(); 
         $transaction->setAmount($amount) 

         ->setDescription('donation'); 

         $redirect_urls = new RedirectUrls(); 
         $redirect_urls->setReturnUrl(URL::route('funding.status')) 

           ->setCancelUrl(URL::route('funding.status')); 


         $payment = new Payment(); 
         $payment->setIntent('Sale') 
           ->setPayer($payer) 
           ->setRedirectUrls($redirect_urls) 
           ->setTransactions(array($transaction)); 

我不賣任何product.I只想一個project.Is基金有什麼辦法讓收到的錢由管理員帳戶的故事嗎?我可以收取用戶的交易費用嗎?

回答

1

在REST/Classic API中,接收方會產生交易費是正常的。 您正在查看的模型是「自適應付款」,您可以決定誰想要支付費用。

Read

基本上在Adaptive付款,如果你希望的人who sends money should pay the fee,您可以在Adaptive Payments.For情況下做到這一點,你可以在Pay API操作使用一個名爲feesPayer = SENDER變量。

P.S您將需要在apps.paypal.com上創建一個應用程序,以利用PayPal中的自適應付款功能。

+0

有沒有關於如何在laravel項目中使用paypal自適應付款的任何教程? – 2014-12-08 14:36:18

+0

沒關係,我發現這個:https://devtools-paypal.com/guide/ap_chained_pa​​yment/php?env = sandbox#credentialsModal – 2014-12-08 14:54:14