Code Monkey home page Code Monkey logo

Comments (7)

abolabo avatar abolabo commented on July 18, 2024

did you tried this? #8 (comment)

from ups-php.

crazyj9 avatar crazyj9 commented on July 18, 2024

Yes, no luck.

from ups-php.

abolabo avatar abolabo commented on July 18, 2024

ups-php.zip
try this

from ups-php.

crazyj9 avatar crazyj9 commented on July 18, 2024

That didn't work. Here's my controller with the code. Maybe I did something wrong?

`namespace App\Http\Controllers;
require DIR . '/../../../vendor/autoload.php';

use Illuminate\Http\Request;

class UPSSaturdayDelivery extends Controller
{
public function SatCheck(Request $request)
{
//YOUR ACCOUNT NUMBER (6 characters)
$accNumber = env('UPS_ACCOUNT_NUMBER', false);
//UPS API Credentials (obtain after APP creation)
$clientId = env('UPS_API_CLIENT_ID', false);
$password = env('UPS_API_PASSWORD', false);

    $config = \UPS\OAuthClientCredentials\Configuration::getDefaultConfiguration()
        ->setUsername($clientId)
        ->setPassword($password);

    $apiInstance = new \UPS\OAuthClientCredentials\Request\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
        new \GuzzleHttp\Client(),
        $config
    );
    $grant_type = "client_credentials"; // string |
    $x_merchant_id = $accNumber; // string | Client merchant ID

    try {
        $result = $apiInstance->createToken($grant_type, $x_merchant_id);
        print_r($result);
    } catch (Exception $e) {
        echo 'Exception when calling DefaultApi->generateToken: ', $e->getMessage(), PHP_EOL;
    }
}

}`

from ups-php.

abolabo avatar abolabo commented on July 18, 2024

debug include path.
var_dump( is_file(DIR . '/../../../vendor/autoload.php'));

from ups-php.

crazyj9 avatar crazyj9 commented on July 18, 2024

Thank you for the suggestion. The path is correct. Result is true. Could it be something in my autoload.php file then?

from ups-php.

abolabo avatar abolabo commented on July 18, 2024

Thank you for the suggestion. The path is correct. Result is true. Could it be something in my autoload.php file then?

Unfortunately, i cannot to resolve issue with composer-merge-plugin.
It works different when you install this package via composer require shell command.
It builds autoupload file without dependencies from subdirectories.

If you plan to use all APIs of UPS you should to download code from git and run composer install command to build common vendor directory for all UPS APIs.

from ups-php.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.