PHPackages                             kazin8/elopage-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. kazin8/elopage-php

ActiveLibrary[API Development](/categories/api)

kazin8/elopage-php
==================

Elopage API php wrapper

1.0.9(4y ago)02.1k1MITPHPPHP ^5.3 || ^7.0 || ^8.0

Since Jan 20Pushed 4y agoCompare

[ Source](https://github.com/kazin8/elopage-php)[ Packagist](https://packagist.org/packages/kazin8/elopage-php)[ RSS](/packages/kazin8-elopage-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)DependenciesVersions (11)Used By (0)

Elopage
=======

[](#elopage)

Elopage API php wrapper

**NOTE:**

Attention!

Api service is not standardized, returns errors in different formats, does not rely on the returned server codes and so on. Some attempts have been made in this library to standardize responses, but this does not always work correctly. Especially in terms of translation.

I apologize for the unstable work.

Install
-------

[](#install)

```
composer require kazin8/elopage

```

What can you do?
----------------

[](#what-can-you-do)

### Authenticate

[](#authenticate)

Authenticate your account by using your secret API key in the request. You can create or renew your API keys in your dashboard settings. Keep your API and secret keys secret. Please do not share your API keys publicly on Github and so forth.

On production you must create requests over HTTPS, otherwise calls will fail. Sandbox requests can be with HTTP.

### Sandbox and payments credentials

[](#sandbox-and-payments-credentials)

You can use api in stage mode (for testing).

Credentials for test payments will not work on the production environment. For now, we don’t have the option to test payments on production except for real payments.

##### Credit Card

[](#credit-card)

The following credit card numbers can be used to test Visa or Mastercard payments.

ParameterValueCVVAny 3 digitsDateany date in the future, before 2030Number5017670000005900
5017670000006700
5017670000007500
5017670000008300##### Sofort Überweisung (Klarna)

[](#sofort-überweisung-klarna)

The following online banking and account credentials can be used to test Sofort Überweisung (Klarna) payments.

ParameterValueCountry of your bankGermanySort code or BIC88888888Account number234567PIN12345TAN12345##### SEPA

[](#sepa)

Please use the following payment information to test both instant successful and failed payments. Be aware that the initial payment takes 5 days to process. During that time the payment will have the “pending” status. SEPA payments are available for reseller-type-accounts.

DescriptionIBANTo do an instant successful transactionDE89370400440532013000To do an instant failed transactionDE62370400440532013001##### Paypal

[](#paypal)

Please use the following Paypal credentials to test payments on staging. Beware that you do not have an option to check the payment status on a Paypal account (by logging in to Paypal) unless you connect your own Paypal account on production.

ParameterValueUsernamePassword123elopage### Create API instance

[](#create-api-instance)

```
$api = new ElopageApi($apiKey, $secret, $testMode = false);

```

- apiKey - api key from your dashboard
- secret - secret key from your dashboard
- testMode - **false**|true use in test mode

### Set errors language

[](#set-errors-language)

The library supports two language versions - **English (en)** and German (de).

English version is selected by default.

You can set another language:

```
$api->setLanguage($api::LANG_DE);

```

### Response objects

[](#response-objects)

All methods return a universal response object. (instance of **ResponseDto** class).

If an error occurs, the **ErrorDto** class object is returned.

This object has several methods that will help you in working with api.

```
/* Get the list of products */
$response = $api->get('products');

```

#### Verify the success of the request

[](#verify-the-success-of-the-request)

```
if ($response->isSuccess()) {
    // do something;
}

```

#### Get response data

[](#get-response-data)

```
if ($response->isSuccess()) {
    $data = $response->getData();
} else {
    $error = $response->getError();
}

```

#### Errors and exceptions

[](#errors-and-exceptions)

The error class has the following methods:

MethodDescriptiongetMessageReturns the contents of the error in the selected languagegetCodeReturns the internal library error codegetCurlCodeReturns the http error code (if it exists)API errors list

CodeDescriptionERROR\_UNKNOWNUnknown errorERROR\_CURLHttp call error reported by curl (#%s - %s)ERROR\_UNAUTHORIZEDAuth errorERROR\_NOT\_FOUNDAPI action not foundERROR\_BAD\_SERVER\_RESPONSEReturned if the action was performed incorrectly and the server returned an error.The library has its own exception, which you can throw in case of an error.

```
if ($response->isSuccess()) {
    $data = $response->getData();
} else {
    throw new ElopageApiException($response->getError()->getMessage(), $response->getError()->getCode());
}

```

Api methods
-----------

[](#api-methods)

For more information about input parameters and response structure, read the documentation: [Elopage api documentation](http://apidoc.elopage.com/)

### Product

[](#product)

##### Get product

[](#get-product)

```
$response = $api->get('products', $id);

```

##### Get products list

[](#get-products-list)

```
$response = $api->get('products');

```

##### Create product

[](#create-product)

```
$payload = [
  'name' => 'product name',
  'success_url' => 'elopage.com',
  'cancel_url' => 'elopage.com',
  'error_url' => 'elopage.com',
  'webhook_url' => 'elopage.com',
  'pricing_plans' => [
    [
      'form' => 'one_time',
      'preferences' => [
        'price' => '199.9',
        'old_price' => '200',
      ],
    ],
  ],
  'authors' => [
    [
      'id' => 4,
      'custom_commission_enabled' => true,
      'commission' => 10,
    ],
  ],
  'success_email' => [
    'subject_de' => 'test',
    'body_de' => 'Hallo %{first_name} %{last_name},\n\nvielen Dank f&uuml;r die Bestellung.\n\nProduktname: %{product_name}\nBetrag: %{amount}\nZahlung: %{recurring_type}\n\nBitte jetzt hier klicken:\n%{next_button}\n\nSch&ouml;ne Gr&uuml;&szlig;e,',
    'subject_en' => 'test',
    'body_en' => 'Hello %{first_name} %{last_name},\n\nthanks for your order.\n\nProduct name: %{product_name}\nAmount: %{amount}\nPlan: %{recurring_type}\n\nNow click here:\n%{next_button}\nBest regards,',
  ],
];

$response = $api->post('products', $payload);

```

##### Update product

[](#update-product)

```
$id = 1;

$payload = [
  'name' => 'product name',
  'success_url' => 'elopage.com',
  'cancel_url' => 'elopage.com',
  'error_url' => 'elopage.com',
  'webhook_url' => 'elopage.com',
  'pricing_plans' => [
    [
      'id' => 1340,
      'form' => 'one_time',
      'preferences' => [
        'price' => '220',
        'old_price' => '200.0',
      ],
    ],
  ],
  'success_email' => [
    'subject_de' => 'test',
    'body_de' => 'Hallo %{first_name} %{last_name},\n\nvielen Dank für die Bestellung.\n\nProduktname: %{product_name}\nBetrag: %{amount}\nZahlung: %{recurring_type}\n\nBitte jetzt hier klicken:\n%{next_button}\n\nSchöne Grüße,',
    'subject_en' => 'test',
    'body_en' => 'Hello %{first_name} %{last_name},\n\nthanks for your order.\n\nProduct name: %{product_name}\nAmount: %{amount}\nPlan: %{recurring_type}\n\nNow click here:\n%{next_button}\nBest regards,',
  ],
];

$response = $api->put('products', $payload, $id);

```

### Publishers

[](#publishers)

##### Get publishers list

[](#get-publishers-list)

```
$response = $api->get('publishers');

```

##### Enroll publisher to program

[](#enroll-publisher-to-program)

```
$payload = [
  'affiliate_program_id' => 1
];

$response = $api->post("publishers/{$id}/enroll", $payload);

```

##### Unenroll publisher from program

[](#unenroll-publisher-from-program)

```
$payload = [
  'affiliate_program_id' => 1
];

$response = $api->post("publishers/{$id}/unenroll", $payload);

```

### Pricing plans

[](#pricing-plans)

##### Get pricing plan

[](#get-pricing-plan)

```
$response = $api->get('pricing_plans', $id);

```

##### Create pricing plan

[](#create-pricing-plan)

```
$payload = [
    'sales_page_id' => 1087,
    'pricing_plan' =>
        [
            'form' => 'split',
            'preferences' => [
                'p_count' => 2,
                'first_amount' => 0.5,
                'next_amount' => 2,
            ],
        ],
];

$response = $api->post('pricing_plans', $payload);

```

##### Delete pricing plan

[](#delete-pricing-plan)

```
$response = $api->delete('pricing_plans', $id);

```

### Payments

[](#payments)

##### Get payment info

[](#get-payment-info)

```
$response = $api->get('payments', $id);

```

### Refunds

[](#refunds)

##### Get refund info

[](#get-refund-info)

```
$response = $api->get('payments', $id);

```

##### Create a refund

[](#create-a-refund)

```
$paymentId = 1;
$payload = [];

$response = $api->post("payments/{$paymentId}/refund", $payload);

```

Contributing
------------

[](#contributing)

When contributing to this repository, please first discuss the change you wish to make via issue before making a pull request.

Authors
-------

[](#authors)

Vladimir Vasyukov - [kazin8](https://github.com/kazin8)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](https://github.com/kazin8/elopage-php/blob/master/LICENSE.md) file for details

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

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 ~129 days

Recently: every ~199 days

Total

10

Last Release

1503d ago

PHP version history (2 changes)1.0.0PHP ^5.3 || ^7.0

1.0.9PHP ^5.3 || ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/61c0a1a956d1cbe01d26520f3bfd1bae139478b36dbbc2a301c8c01e86323d16?d=identicon)[kazin8](/maintainers/kazin8)

---

Top Contributors

[![kazin8](https://avatars.githubusercontent.com/u/44418782?v=4)](https://github.com/kazin8 "kazin8 (10 commits)")[![andrey57r](https://avatars.githubusercontent.com/u/6594976?v=4)](https://github.com/andrey57r "andrey57r (2 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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