• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Openpay LIBRARY

#1
Hi! Im trying to use Openpay library in CI4 but I don't have success, I don't know if im doing right,
Im new using this framewwork, can any one help me?  Huh

This is my code

//controller
PHP Code:
<?php namespace App\Controllers;

use 
Codeigniter\Controller;
use 
App\Libraries\LibreriaPago;

class 
Demo extends BaseController
{
public function 
index(){


$api = new LibreriaPago;
}


//library
PHP Code:
<?php namespace App\Libraries;

require_once 
APPPATH.'/libraries/openpay/Openpay.php';




class 
LibreriaPago extends Openpay
{
public function 
__construct()
    {
        parent::__construct();
    }


// and content of library looks like

PHP Code:
<?php 


if (!function_exists('curl_init')) {
throw new 
Exception('CURL PHP extension is required to run Openpay client.');
}
if (!
function_exists('json_decode')) {
throw new 
Exception('JSON PHP extension is required to run Openpay client.');
}
if (!
function_exists('mb_detect_encoding')) {
throw new 
Exception('Multibyte String PHP extension is required to run Openpay client.');
}

require(
dirname(__FILE__) . '/data/OpenpayApiError.php');
require(
dirname(__FILE__) . '/data/OpenpayApiConsole.php');
require(
dirname(__FILE__) . '/data/OpenpayApiResourceBase.php');
require(
dirname(__FILE__) . '/data/OpenpayApiConnector.php');
require(
dirname(__FILE__) . '/data/OpenpayApiDerivedResource.php');
require(
dirname(__FILE__) . '/data/OpenpayApi.php');

require(
dirname(__FILE__) . '/resources/OpenpayBankAccount.php');
require(
dirname(__FILE__) . '/resources/OpenpayCapture.php');
require(
dirname(__FILE__) . '/resources/OpenpayCard.php');
require(
dirname(__FILE__) . '/resources/OpenpayCharge.php');
require(
dirname(__FILE__) . '/resources/OpenpayCustomer.php');
require(
dirname(__FILE__) . '/resources/OpenpayFee.php');
require(
dirname(__FILE__) . '/resources/OpenpayPayout.php');
require(
dirname(__FILE__) . '/resources/OpenpayPlan.php');
require(
dirname(__FILE__) . '/resources/OpenpayRefund.php');
require(
dirname(__FILE__) . '/resources/OpenpaySubscription.php');
require(
dirname(__FILE__) . '/resources/OpenpayTransfer.php');
require(
dirname(__FILE__) . '/resources/OpenpayWebhook.php');
require(
dirname(__FILE__) . '/resources/OpenpayToken.php');
require(
dirname(__FILE__) . '/resources/OpenpayPse.php');
?>
Reply

#2
What is not working? Do you have an error message?
Test your translation files with Translation Tester
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.