Welcome Guest, Not a member yet? Register   Sign In
CoinpaymentsAPI
#4

(01-12-2022, 12:24 AM)iRedds Wrote:
PHP Code:
use App\Libraries\coinpayments\src\CoinpaymentsAPI
This means that the class not only needs to be in this path, but also has a corresponding namespace.

It looks like you are using an official API wrapper.
You need to use loading via classmap.
PHP Code:
    public $classmap = [
        'CoinpaymentsAPI' => APPPATH 'Libraries/coinpayments/src/CoinpaymentsAPI.php',
    ]; 

PHP Code:
use  CoinpaymentsAPI;
....
new 
CoinpaymentsAPI(...); 


question to upload to localhost works without problem but when uploading from a server it throws an error Class 'CoinpaymentsAPN' not found


public $classmap = [
        'CoinpaymentsAPN' => APPPATH .'Libraries\coinpayments\src\CoinpaymentsAPI.php'
    ];


<?php

namespace App\Controllers;
use App\Controllers\BaseController;
use CoinpaymentsAPN;

Error
Class 'Coinpaymentsapn' not found
APPPATH/Controllers/Dashboard.php at line 300


Code:
300                         $cps_api = new Coinpaymentsapn($private_key, $public_key, 'json');

Reply


Messages In This Thread
CoinpaymentsAPI - by Z4K7 - 01-11-2022, 07:36 PM
RE: CoinpaymentsAPI - by iRedds - 01-12-2022, 12:24 AM
RE: CoinpaymentsAPI - by Z4K7 - 01-17-2022, 02:00 PM
RE: CoinpaymentsAPI - by Z4K7 - 02-08-2022, 05:36 PM
RE: CoinpaymentsAPI - by luckmoshy - 02-08-2022, 11:13 PM
RE: CoinpaymentsAPI - by iRedds - 02-08-2022, 08:08 PM
RE: CoinpaymentsAPI - by Z4K7 - 02-08-2022, 08:16 PM
RE: CoinpaymentsAPI - by iRedds - 02-09-2022, 03:40 AM
RE: CoinpaymentsAPI - by Z4K7 - 02-10-2022, 03:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB