PHPackages                             epayco/epayco-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. epayco/epayco-php

ActiveSdk[API Development](/categories/api)

epayco/epayco-php
=================

Epayco API client for PHP

v1.9.0(9mo ago)25201.7k↓19%22[26 issues](https://github.com/epayco/epayco-php/issues)[3 PRs](https://github.com/epayco/epayco-php/pulls)3MITPHPPHP &gt;=5.3.0|&gt;=8.1CI failing

Since Nov 8Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/epayco/epayco-php)[ Packagist](https://packagist.org/packages/epayco/epayco-php)[ Docs](https://github.com/epayco/epayco-php)[ RSS](/packages/epayco-epayco-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (2)Versions (31)Used By (3)

Epayco
======

[](#epayco)

PHP wrapper for Epayco API

Description
-----------

[](#description)

API to interact with Epayco

### Dependencias

[](#dependencias)

```
* PHP 5.3+

```

Installation
------------

[](#installation)

```
composer require epayco/epayco-php
```

Add `autoload` to composer

```
require 'vendor/autoload.php';
```

### From GitHub

[](#from-github)

```
$ git clone https://github.com/epayco/epayco-php.git
```

Usage
-----

[](#usage)

```
$epayco = new Epayco\Epayco(array(
    "apiKey" => "YOU_PUBLIC_API_KEY",
    "privateKey" => "YOU_PRIVATE_API_KEY",
    "lenguage" => "ES",
    "test" => true
));
```

### Create Token

[](#create-token)

```
$token = $epayco->token->create(array(
    "card[number]" => '4575623182290326',
    "card[exp_year]" => "2017",
    "card[exp_month]" => "07",
    "card[cvc]" => "123",
    "hasCvv" => true //hasCvv: validar codigo de seguridad en la transacción
));
```

### Customers

[](#customers)

#### Create

[](#create)

```
$customer = $epayco->customer->create(array(
    "token_card" => $token->id,
    "name" => "Joe",
    "last_name" => "Doe", //This parameter is optional
    "email" => "joe@payco.co",
    "default" => true,
    //Optional parameters: These parameters are important when validating the credit card transaction
    "city" => "Bogota",
    "address" => "Cr 4 # 55 36",
    "phone" => "3005234321",
    "cell_phone"=> "3010000001",
));
```

#### Retrieve

[](#retrieve)

```
$customer = $epayco->customer->get("id_client");
```

#### List

[](#list)

```
$customer = $epayco->customer->getList([
    "page"=>6,
    "perPage"=>10
]);
```

#### Update

[](#update)

```
$customer = $epayco->customer->update("id_client", array('name' => 'julianc'));
```

#### Delete Customer's token

[](#delete-customers-token)

```
$customer = $epayco->customer->delete(array(
    "franchise"  => "visa",
    "mask" => "457562******0326",
    "customer_id"=>"id_client"
    ));
```

#### Add new token default to card existed

[](#add-new-token-default-to-card-existed)

```
  $customer = $epayco->customer->addDefaultCard(array(
     "customer_id"=>"id_client",
     "token" => "**********zL4gFB",
     "franchise"=> "american-express",
     "mask"=> "373118*****7642"
 ));
```

#### Add new token to customer existed

[](#add-new-token-to-customer-existed)

```
    $customer = $epayco->customer->addNewToken(array(
    "token_card" => "HyjnY3pBSjFtiQBRT",
    "customer_id"=>"id_client"
));
```

### Plans

[](#plans)

#### Create

[](#create-1)

```
$plan = $epayco->plan->create(array(
     "id_plan" => "coursereact",
     "name" => "Course react js",
     "description" => "Course react and redux",
     "amount" => 30000,
     "currency" => "cop",
     "interval" => "month",
     "interval_count" => 1,
     "trial_days" => 30,
     "ip" => "127.0.0.1",
     "iva" => 5700,
     "ico" => 0,
     "planLink" => "https://github.com/epayco",
     "greetMessage" => "discounted react and redux course",
     "linkExpirationDate" => "2025-03-11",
     "subscriptionLimit"=> 10, #Subscription limit between 0 and 10000
      "imgUrl"=>"https://epayco.com/wp-content/uploads/2023/04/logo-blanco.svg",
      "discountValue"=>5000, #discount value
      "discountPercentage"=>19, #discount percentage
      "transactionalLimit"=> 2, #transactional Limit
      "additionalChargePercentage"=>0.0, #Additional charge percentage limit
      "firstPaymentAdditionalCost"=>45700  #Installation Cost
));
```

#### Retrieve

[](#retrieve-1)

```
$plan = $epayco->plan->get("coursereact");
```

#### List

[](#list-1)

```
$plan = $epayco->plan->getList();
```

#### Upadte

[](#upadte)

```
$plan = $epayco->plan->update("coursereact",array(
        "name" => "Course react js",
        "description" => "Course react and redux",
        "amount" => 35700,
        "currency" => "cop",
        "interval" => "month",
        "interval_count" => 1,
        "trial_days" => 30,
        "ip"=> "127.0.0.1",
        "iva" => 1900,
        "ico" => 0,
        "transactionalLimit"=> 3,
        "additionalChargePercentage"=>0.0,
        "afterPayment"=>"message after paying"
));
```

#### Remove

[](#remove)

```
$plan = $epayco->plan->remove("coursereact");
```

### Subscriptions

[](#subscriptions)

#### Create

[](#create-2)

```
$sub = $epayco->subscriptions->create(array(
  "id_plan" => "coursereact",
  "customer" => "id_client",
  "token_card" => "id_token",
  "doc_type" => "CC",
  "doc_number" => "5234567",
   //Optional parameter: if these parameter it's not send, system get ePayco dashboard's url_confirmation
   "url_confirmation" => "https://ejemplo.com/confirmacion",
   "method_confirmation" => "POST"
));
```

#### Retrieve

[](#retrieve-2)

```
$sub = $epayco->subscriptions->get("id_subscription");
```

#### List

[](#list-2)

```
$sub = $epayco->subscriptions->getList();
```

#### Cancel

[](#cancel)

```
$sub = $epayco->subscriptions->cancel("id_subscription");
```

#### Pay Subscription

[](#pay-subscription)

```
$sub = $epayco->subscriptions->charge(array(
  "id_plan" => "coursereact",
  "customer" => "id_client",
  "token_card" => "id_token",
  "doc_type" => "CC",
  "doc_number" => "5234567",
  "address" => "cr 44 55 66",
  "phone"=> "2550102",
  "cell_phone"=> "3010000001",
  "ip" => "190.000.000.000",  // This is the client's IP, it is required
  "idSubscription" => "idSubscription"
));
```

### PSE

[](#pse)

#### Listar bancos

[](#listar-bancos)

```
$test = true; // opcional, tiene que ser true o false o no enviarse
$bancos = $epayco->bank->pseBank($test);
//$bancos representa un object con toda la lista de bancos disponibles para transacciones con PSE
```

#### Create

[](#create-3)

```
$pse = $epayco->bank->create(array(
        "bank" => "1022",
        "invoice" => "1472050778",
        "description" => "Pago pruebas",
        "value" => "10000",
        "tax" => "0",
        "tax_base" => "0",
        "currency" => "COP",
        "type_person" => "0",
        "doc_type" => "CC",
        "doc_number" => "numero_documento_cliente",
        "name" => "PRUEBAS",
        "last_name" => "PAYCO",
        "email" => "no-responder@payco.co",
        "country" => "CO",
        "city" => "Bogota",
        "cell_phone" => "3010000001",
        "ip" => "190.000.000.000",  // This is the client's IP, it is required
        "url_response" => "https://ejemplo.com/respuesta.html",
        "url_confirmation" => "https://ejemplo.com/confirmacion",
        "metodoconfirmacion" => "GET",

        //Los parámetros extras deben ser enviados tipo string, si se envía tipo array generara error.
        "extra1" => "",
        "extra2" => "",
        "extra3" => "",
        "extra4" => "",
        "extra5" => "",
        "extra6" => "",
        "extra7" => "",
));
```

#### Retrieve

[](#retrieve-3)

```
$pse = $epayco->bank->get("ticketId");
```

#### Split Payments

[](#split-payments)

Previous requirements:

#### Split payment

[](#split-payment)

use the following attributes in case you need to do a dispersion with one or multiple providers

```
$split_pay = $epayco->bank->create(array(
    //Other customary parameters...
    "splitpayment" => "true",
    "split_app_id" => "P_CUST_ID_CLIENTE APPLICATION",
    "split_merchant_id" => "P_CUST_ID_CLIENTE COMMERCE",
    "split_type" => "02",
    "split_primary_receiver" => "P_CUST_ID_CLIENTE APPLICATION",
    "split_primary_receiver_fee"=>"0",
    "split_rule"=>'multiple', //sí se envía este campo el split_receivers se vuelve un campo obligatorio
    "split_receivers" => json_encode(array(
    		array('id'=>'P_CUST_ID_CLIENTE 1 RECEIVER','total'=>'58000','iva'=>'8000','base_iva'=>'50000','fee' => '10'),
    		array('id'=>'P_CUST_ID_CLIENTE 2 RECEIVER','total'=>'58000','iva'=>'8000','base_iva'=>'50000','fee' => '10')
    	 )) // Campo obligatorio sí se envía el campo split_rule
));
```

### Cash

[](#cash)

#### Create

[](#create-4)

```
$cash = $epayco->cash->create("efecty", array(
    "invoice" => "1472050778",
    "description" => "pay test",
    "value" => "20000",
    "tax" => "0",
    "tax_base" => "0",
    "currency" => "COP",
    "type_person" => "0",
    "doc_type" => "CC",
    "doc_number" => "numero_documento_cliente",
    "name" => "testing",
    "last_name" => "PAYCO",
    "email" => "test@mailinator.com",
    "cell_phone" => "3010000001",
    "country" => "CO",
    "city" => "Bogota",
    "end_date" => "data_max_5_days", // yy-mm-dd
    "ip" => "190.000.000.000",  // This is the client's IP, it is required
    "url_response" => "https://ejemplo.com/respuesta.html",
    "url_confirmation" => "https://ejemplo.com/confirmacion",
    "metodoconfirmacion" => "GET",

    //Los parámetros extras deben ser enviados tipo string, si se envía tipo array generara error.
    "extra1" => "",
    "extra2" => "",
    "extra3" => "",
    "extra4" => "",
    "extra5" => "",
    "extra6" => "",
    "extra7" => "",
));
```

#### list

[](#list-3)

```
$cash = $epayco->cash->create("efecty", array());
$cash = $epayco->cash->create("gana", array());
$cash = $epayco->cash->create("baloto", array());//expiration date can not be longer than 30 days
$cash = $epayco->cash->create("redservi", array());//expiration date can not be longer than 30 days
$cash = $epayco->cash->create("puntored", array());//expiration date can not be longer than 30 days
```

#### Retrieve

[](#retrieve-4)

```
$cash = $epayco->cash->transaction("id_transaction");
```

#### Split Payments

[](#split-payments-1)

Previous requirements:

#### Split Payment:

[](#split-payment-1)

use the following attributes in case you need to do a dispersion with one or multiple providers

```
$split_pay = $epayco->cash->create(array(
    //Other customary parameters...
    "splitpayment" => "true",
    "split_app_id" => "P_CUST_ID_CLIENTE APPLICATION",
    "split_merchant_id" => "P_CUST_ID_CLIENTE COMMERCE",
    "split_type" => "02",
    "split_primary_receiver" => "P_CUST_ID_CLIENTE APPLICATION",
    "split_primary_receiver_fee"=>"0",
    "split_rule"=>'multiple', // si se envía este parámetro el campo split_receivers se vuelve obligatorio
    "split_receivers" => json_encode(array(
    		array('id'=>'P_CUST_ID_CLIENTE 1 RECEIVER','total'=>'58000','iva'=>'8000','base_iva'=>'50000','fee' => '10'),
    		array('id'=>'P_CUST_ID_CLIENTE 2 RECEIVER','total'=>'58000','iva'=>'8000','base_iva'=>'50000','fee' => '10')
    	 )) // Campo obligatorio sí se envía split_rule
));
```

### Payment

[](#payment)

#### Create

[](#create-5)

```
$pay = $epayco->charge->create(array(

    //required
    "token_card" => $token->id,
    "customer_id" => $customer->data->customerId,
    "doc_type" => "CC",
    "doc_number" => "numero_documento_cliente",
    "name" => "John",
    "last_name" => "Doe",
    "email" => "example@email.com",
    "value" => "116000",
    "currency" => "COP",

    // optional
    "bill" => "OR-1234",
    "description" => "Test Payment",
    "tax" => "16000",
    "tax_base" => "100000",
    "dues" => "12",
    "address" => "cr 44 55 66",
    "city" => "Medellín",
    "country" => "CO",
    "phone"=> "2550102",
    "cell_phone"=> "3010000001",
    "ip" => "190.000.000.000",  // This is the client's IP, it is required
    "url_response" => "https://tudominio.com/respuesta.php",
    "url_confirmation" => "https://tudominio.com/confirmacion.php",
    "method_confirmation" => "GET",
    "use_default_card_customer" => true,  // if the user wants to be charged with the card that the customer currently has as default = true
    // Los parámetros "extras" deben ser enviados como cadenas de texto (string). Aunque se agrupen dentro de un array, cada parámetro individual debe ser un string. Si se envían como otro tipo de datos, como arrays anidados, se generará un error.
	 "extras"=> array(
        "extra1" => "data 1",
        "extra2" => "data 2",
        "extra3" => "data 3",
        "extra4" => "data 4",
        "extra5" => "data 5"
    )
));
```

#### Retrieve

[](#retrieve-5)

```
$pay = $epayco->charge->transaction("id_transaction");
```

#### Split Payments

[](#split-payments-2)

Previous requirements:

#### Split payment:

[](#split-payment-2)

use the following attributes in case you need to do a dispersion with one or multiple providers

```
$split_pay = $epayco->charge->create(array(
    //Other customary parameters...
    "splitpayment" => "true",
    "split_app_id" => "P_CUST_ID_CLIENTE APPLICATION",
    "split_merchant_id" => "P_CUST_ID_CLIENTE COMMERCE",
    "split_type" => "02",
    "split_primary_receiver" => "P_CUST_ID_CLIENTE APPLICATION",
    "split_primary_receiver_fee"=>"0",
    "split_rule"=>'multiple', // sí se envía este parámetro el campo split_receivers se vuelve obligatorio
    "split_receivers" => array(
    		array('id'=>'P_CUST_ID_CLIENTE 1 RECEIVER','total'=>'58000','iva'=>'8000','base_iva'=>'50000','fee' => '10'),
    		array('id'=>'P_CUST_ID_CLIENTE 2 RECEIVER','total'=>'58000','iva'=>'8000','base_iva'=>'50000','fee' => '10')
    	 ) //Campo obligatorio sí se envía split_rule
));
```

### Daviplata

[](#daviplata)

#### Create

[](#create-6)

```
$pay = $epayco->daviplata->create(array(
    "doc_type" => "CC",
    "document" => "1053814580414720",
    "name" => "Testing",
    "last_name" => "PAYCO",
    "email" => "exmaple@epayco.co",
    "ind_country" => "CO",
    "phone" => "314853222200033",
    "country" => "CO",
    "city" => "bogota",
    "address" => "Calle de prueba",
    "ip" => "189.176.0.1",
    "currency" => "COP",
    "description" => "ejemplo de transaccion con daviplata",
    "value" => "100",
    "tax" => "0",
    "tax_base" => "0",
    "method_confirmation" => "POST",
    "url_confirmation" => "https://tudominio.com/respuesta.php",
    "url_response" => "https://tudominio.com/respuesta.php",
    "extra1" => "data 1",
    "extra2" => "data 2",
    "extra3" => "data 3",
    "extra4" => "data 4",
    "extra5" => "data 5"
));
```

#### Confirm

[](#confirm)

```
$pay = $epayco->daviplata->confirm(array(
    "ref_payco" => "45508846", // It is obtained from the create response
    "id_session_token" => "45081749", // It is obtained from the create response
    "otp" => "2580"
));
```

### Safetypay

[](#safetypay)

#### Create

[](#create-7)

```
$sp = $epayco->safetypay->create(array(
    "cash" => "1",
    "end_date" => "2022-08-05",
    "doc_type" => "CC",
    "document" => "123456789",
    "name" => "Jhon",
    "last_name" => "doe",
    "email" => "gerson.vasquez@epayco.com",
    "ind_country" => "57",
    "phone" => "3003003434",
    "country" => "CO",
    "invoice" => "fac-01",
    "city" => "N/A",
    "address" => "N/A",
    "ip" => "192.168.100.100",
    "currency" => "COP",
    "description" => "Thu Jun 17 2021 11:37:01 GMT-0400 (hora de Venezuela)",
    "value" => 100,
    "tax" => 0,
    "ico" => 0,
    "tax_base" => 0,
    "method_confirmation" => "POST",
    "url_confirmation" => "https://tudominio.com/respuesta.php",
    "url_response" => "https://tudominio.com/respuesta.php",
    "extra1" => "data 1",
    "extra2" => "data 2",
    "extra3" => "data 3",
    "extra4" => "data 4",
    "extra5" => "data 5"
));
```

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance58

Moderate activity, may be stable

Popularity46

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~214 days

Recently: every ~322 days

Total

11

Last Release

284d ago

PHP version history (2 changes)v1.3.0PHP &gt;=5.3.0

v1.7.0PHP &gt;=5.3.0|&gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/146432344?v=4)[juanMarulanda](/maintainers/juanMarulanda)[@juanmarulanda](https://github.com/juanmarulanda)

---

Top Contributors

[![RicardoSaldarriagaPayco](https://avatars.githubusercontent.com/u/40249987?v=4)](https://github.com/RicardoSaldarriagaPayco "RicardoSaldarriagaPayco (75 commits)")[![Gerson-epayco](https://avatars.githubusercontent.com/u/81260148?v=4)](https://github.com/Gerson-epayco "Gerson-epayco (41 commits)")[![juanhurtadopayco](https://avatars.githubusercontent.com/u/48524250?v=4)](https://github.com/juanhurtadopayco "juanhurtadopayco (27 commits)")[![JuanEstebanGarciaV](https://avatars.githubusercontent.com/u/176440303?v=4)](https://github.com/JuanEstebanGarciaV "JuanEstebanGarciaV (15 commits)")[![prismaymedia](https://avatars.githubusercontent.com/u/8210561?v=4)](https://github.com/prismaymedia "prismaymedia (14 commits)")[![danielquiroz87](https://avatars.githubusercontent.com/u/24234519?v=4)](https://github.com/danielquiroz87 "danielquiroz87 (12 commits)")[![devepayco](https://avatars.githubusercontent.com/u/34689646?v=4)](https://github.com/devepayco "devepayco (11 commits)")[![felipemesa14](https://avatars.githubusercontent.com/u/23562754?v=4)](https://github.com/felipemesa14 "felipemesa14 (7 commits)")[![Dayancmm](https://avatars.githubusercontent.com/u/83416039?v=4)](https://github.com/Dayancmm "Dayancmm (7 commits)")[![JuanFelMesa](https://avatars.githubusercontent.com/u/50674820?v=4)](https://github.com/JuanFelMesa "JuanFelMesa (7 commits)")[![andres-duque](https://avatars.githubusercontent.com/u/66030396?v=4)](https://github.com/andres-duque "andres-duque (4 commits)")[![dayan0101](https://avatars.githubusercontent.com/u/16102814?v=4)](https://github.com/dayan0101 "dayan0101 (4 commits)")[![ePaycoManager](https://avatars.githubusercontent.com/u/96743485?v=4)](https://github.com/ePaycoManager "ePaycoManager (2 commits)")[![YeisonTapia](https://avatars.githubusercontent.com/u/10624544?v=4)](https://github.com/YeisonTapia "YeisonTapia (1 commits)")[![alejo9424](https://avatars.githubusercontent.com/u/48483048?v=4)](https://github.com/alejo9424 "alejo9424 (1 commits)")[![m2payco](https://avatars.githubusercontent.com/u/42282973?v=4)](https://github.com/m2payco "m2payco (1 commits)")[![roberto-epayco](https://avatars.githubusercontent.com/u/71656688?v=4)](https://github.com/roberto-epayco "roberto-epayco (1 commits)")[![romedu](https://avatars.githubusercontent.com/u/32285662?v=4)](https://github.com/romedu "romedu (1 commits)")[![Alejinho](https://avatars.githubusercontent.com/u/8833919?v=4)](https://github.com/Alejinho "Alejinho (1 commits)")

---

Tags

apiepayco

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/epayco-epayco-php/health.svg)

```
[![Health](https://phpackages.com/badges/epayco-epayco-php/health.svg)](https://phpackages.com/packages/epayco-epayco-php)
```

###  Alternatives

[razorpay/razorpay

Razorpay PHP Client Library

2045.4M60](/packages/razorpay-razorpay)[pubnub/pubnub

This is the official PubNub PHP SDK repository.

1335.4M17](/packages/pubnub-pubnub)[culqi/culqi-php

Cliente Culqi API para PHP

41370.5k1](/packages/culqi-culqi-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
