xendit / xendit-php

Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services, xenPlatforms
https://developers.xendit.co/api-reference/
MIT License
153 stars 76 forks source link

Install error #65

Closed stevanhoo closed 4 years ago

stevanhoo commented 4 years ago

saya sudah install dengan composer dan muncul folder vendor

lalu next stepnya, saya buka di localhost http://localhost/xendit/vendor/xendit/xendit-php/tests/TestCase.php

keluar eror Fatal error: Uncaught Error: Class 'PHPUnit\Framework\TestCase' not found in C:\xampp\htdocs\xendit\vendor\xendit\xendit-php\tests\TestCase.php:25 Stack trace: #0 {main} thrown in C:\xampp\htdocs\xendit\vendor\xendit\xendit-php\tests\TestCase.php on line 25

boleh tolong ??

ellennugroho commented 4 years ago

Halo, saya coba bantu jawab ya.

Untuk mengecek apabila library sudah terinstall dan berjalan dengan baik, pastikan di file composer.json sudah ada require xendit/xendit-php. Dicek juga apakah sudah ada file autoload nya atau belum. Kemudian, buat file baru di directory C:\xampp\htdocs\xendit\tes.php (bila dilihat dari directory anda), filenya bisa diisi dengan,

<?php

use Xendit\Xendit;

require 'vendor/autoload.php';

Xendit::setApiKey('api-key-anda'); // ganti API key dengan milik anda

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);

Cuplikan kode di atas adalah untuk mengecek saldo akun Xendit anda. Jalankan file tes.php tersebut. Bila library sudah terinstall dengan baik, maka saldo akan muncul ketika anda menjalankan file tersebut.

bektigalan commented 4 years ago

image

halo, saya coba integrasikan xendit ke CI3, muncul error begini @ellennugroho

bektigalan commented 4 years ago

{ "require": { "symfony/dotenv": "^4.4", "xendit/xendit-php": "^1.4" } } ini isi composer.json folder root

{ "name": "xendit/xendit-php-clients", "description": "PHP clients for xendit api version 2", "keywords": ["xendit"], "homepage": "https://github.com/xendit/xendit-php-clients", "type": "library", "minimum-stability": "stable", "require": { "php": ">=5.4.0" }, "autoload": { "psr-4": { "XenditClient\\": "src/" } } } ini isi composer.json xendit/xendit-php

stanleynguyen commented 4 years ago

Hi @bektigalan , to use Xendit class, you have to install v2 of the library. I would recommend latest ^2.4

stanleynguyen commented 4 years ago

Stale

edwinyoyada commented 2 years ago

halo @tahaluindo, bisa jelasin proses installnya?

fandiananta commented 10 months ago

sama eror nya

zetooan commented 4 months ago

C:\laravel\only-artperience>composer require xendit/xendit-laravel You are running Composer with SSL/TLS protection disabled.

In PackageDiscoveryTrait.php line 376:

Could not find a matching version of package xendit/xendit-laravel. Check the package spelling, your version constr aint and that the package is available in a stability which matches your minimum-stability (dev).

zetooan commented 4 months ago

kennapa ya

Zidanpnd123 commented 1 month ago

Type: Error

Message: Class "Xendit\Xendit" not found

Filename: C:\xampp\htdocs\sarangwayang\application\controllers\Dashboard.php

Line Number: 229

Backtrace:

File: C:\xampp\htdocs\sarangwayang\index.php Line: 315 Function: require_once