我正在整合贝宝到我的网上商店,其中有多个商家销售商品。每当一个商人进入一个好的系统,系统将要求他的贝宝电子邮件,以收到付款从买家。我现在被困在把Paypal和我的商店整合起来了:
请建议我的API从贝宝,我应该使用。我正在使用PHP,如果它是需要信息。
亲切的问候
发布于 2013-10-09 07:57:01
PayPal所需要的是构建一个具有正确参数的表单:amount、business、currency、item_name等。
如果商家在您的网站上有某种形式的个人资料,那么您可以将他们的PayPal地址存储在其中,当有人在您的网站上签出“他们的”商店时,可以使用该值作为business参数(付款发送到的地方)。
希望这能帮你弄清楚。
发布于 2013-10-09 16:20:21
您可以使用CakePHP PayPal组件将站点与PayPal:https://github.com/robmcvey/cakephp-paypal集成。
但是要在任何地方使用PayPal API,PayPal帐户必须是Pro帐户。您还必须获得每个帐户的API用户名、密码和签名(来自PayPal -> Profile -> 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);
}
}阅读组件类中的组件文档和代码注释,以熟悉详细信息。
https://stackoverflow.com/questions/19263409
复制相似问题