简体   繁体   中英

installing Merchant SDK for Express Checkout API on Paypal

As the title goes, I am trying to install Merchant SDK for Express Checkout API on Paypal.

composer.json

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

And when I run composer update , here is the error I get:

Loading composer repositories with package information
Updating 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 min
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.

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

I tried installing another package, the button manager SDK. And that required me to change the last line in "require" to "paypal/buttonmanager-sdk-php":"v3.6.106" And that worked.

I have no idea why does it search for version 1.0.0 in case of merchant SDK and reports an error that it can't find it.

I am taking my instructions from the official page here

Please provide an insight into my problem, and do ask for any additional information if required.

In your composer.json keep only the required stuffs. If you only creating a component / package which need to be installed via composer, you need to define the name, description, keywords etc.

So for your project to need any package just keep the package name and version name. So your composer.json will look like

{
    "require": {
         "paypal/merchant-sdk-php": "3.6.106"
    }
}

Alternatively you can do via composer require paypal/merchant-sdk-php and giving the version name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM