我想集成一种方法,访客也可以从该方法在我的网站上付款。因此,我正在实现这个贝宝SDK。需要安装编译器并运行它的依赖关系。因此,我运行了此命令以在示例文件夹中安装composer.phar文件

curl -sS https://getcomposer.org/installer | php -- --install-dir=/var/www/html/app/paypaltest/samples


然后要安装作曲家,我运行了以下命令:

php composer.phar install


但是它显示错误为

Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package paypal/merchant-sdk-php 1.0.0 could not be found.

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
  see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.


不知道为什么当我明确定义版本号即v3.8.107时会出现版本1.0.0的错误
这是我正在使用的composer.json文件。谁能帮助我知道问题出在哪里,为什么我不能正确安装作曲家。我有什么想念的吗?

{
"name": "paypal/merchant-sdk-php",
"description": "PayPal Merchant SDK for PHP",
"keywords": ["paypal", "php", "sdk"],
"homepage": "https://developer.paypal.com",
"license": "Apache2",
"authors": [
    {
        "name": "PayPal",
        "homepage": "https://github.com/paypal/merchant-sdk-php/contributors"
    }
],
"require": {
    "paypal/merchant-sdk-php":"v3.8.107"
},
"autoload": {
    "psr-0": {
        "PayPal\\Service": "lib/",
        "PayPal\\CoreComponentTypes": "lib/",
        "PayPal\\EBLBaseComponents": "lib/",
        "PayPal\\EnhancedDataTypes": "lib/",
        "PayPal\\PayPalAPI": "lib/"
    }
}
}

最佳答案

在您的composer.json中尝试以下操作:

{
    "require": {
        "paypal/merchant-sdk-php": "v3.8.107"
    }
}

08-27 22:37
查看更多