使用下面的博客文章,我可以手動在may服務器上配置braintree支付網關庫。
http://www.loneshooter.com/zend-framework-2-how-to-use-facebook-php-sdk/
1)在此,我需要在autoload_classmap.php添加像lib下面參考。
<?php
return array(
'Braintree' => 'vendor/< path to Braintree >/Braintree.php',
);
2)在Module.php文件的功能getAutoloaderConfig添加ClassMapAutoloader部,如果它不以從autoload_classmap.php文件加載構型存在。該功能應該,因爲它遵循:
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
3)的變化,我可以在你的控制器使用布倫特裏庫後:
$Braintree = new \Braintree\Configuration();
$Braintree::merchantId('your_merchant_id');
$Braintree::publicKey('your_public_key');
$Braintree::privateKey('your_private_key');
[PHP的死亡白屏]的可能的複製(HTTP:/ /stackoverflow.com/questions/1475297/phps-white-screen-of-death) – Maks3w
@ Maks3w它與白屏不相關,不允許將braintree支付網關添加到我的zf2應用程序 –
@ Maks3w檢查我更新的問題。我知道什麼是錯誤。它的braintree類沒有找到。 –