PHPackages                             likebtn/referralcandy - 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. likebtn/referralcandy

ActiveProject

likebtn/referralcandy
=====================

LikeBtn / ReferralCandy

6201PHP

Since Jan 27Pushed 8y ago1 watchersCompare

[ Source](https://github.com/likebtn/referralcandy)[ Packagist](https://packagist.org/packages/likebtn/referralcandy)[ RSS](/packages/likebtn-referralcandy/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ReferralCandy PHP API Client
============================

[](#referralcandy-php-api-client)

ReferralCandy PHP API Client by [LikeBtn.com](https://likebtn.com "Like Button For Website")

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

[](#installation)

```
require_once("ReferralCandy.php");

```

Usage
-----

[](#usage)

### Signup Method

[](#signup-method)

Sign an advocate up at ReferralCandy and retrieve the advocate's Referral Link code and Portal Sharing Page code.

```
$params = array(
    'first_name' => 'Mike',
    'last_name' => 'Button,
    'email' => 'mikebutton@likebtn.com'
);

$rc = new ReferralCandy('access_id', 'secret_key');
$result = $rc->request('signup', $params);

if ($result['success'] && ($result['response']['message'] == Referralcandy::MESSAGE_SUCCESS || $result['response']['message'] == 'Contact already signed up.')) {
	// Advocate has been successfully registered at ReferralCandy
    $link_code = preg_replace("/.*\/([^\/]+)/", '$1', $result['response']['referral_link']);
    $portal_code = preg_replace("/.*\/([^\/]+)/", '$1', $result['response']['referralcorner_url']);
}

```

### Purchase Method

[](#purchase-method)

Register a new purchase at ReferralCandy.

```
$params = array(
    'first_name' => 'Mike',
    'last_name' => 'Button,
    'email' => 'mikebutton@likebtn.com',
    'locale' => 'en',
    'accepts_marketing' => 'false',
    'order_timestamp' => time(),
    'browser_ip' => $_SERVER["REMOTE_ADDR"] ,
    'user_agent' => $_SERVER ['HTTP_USER_AGENT'],
    'invoice_amount' => 7.99,
    'currency_code' => 'USD',
    'external_reference_id' => 123
);

$rc = new ReferralCandy('access_id', 'secret_key');
$result = $rc->request('purchase', $params);

if ($result['success'] && $result['response']['message'] == Referralcandy::MESSAGE_SUCCESS) {
	// Purchase has been successfully registered at ReferralCandy
}

```

### Unsubscribed Method

[](#unsubscribed-method)

Unsubscribe a contact at ReferralCandy.

```
$params = array(
    'email' => 'mikebutton@likebtn.com',
    'unsubscribed' => 'true'
);

$rc = new ReferralCandy('access_id', 'secret_key');
$rc->request('unsubscribed', $params);

```

Documentation
-------------

[](#documentation)

[ReferralCandy API Documentation](http://www.referralcandy.com/api)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a06bc74f2033bea52fca093cba322cf532d3649d6aaabba46c0e85041616d35c?d=identicon)[LikeBtn](/maintainers/LikeBtn)

---

Top Contributors

[![likebtn](https://avatars.githubusercontent.com/u/8167133?v=4)](https://github.com/likebtn "likebtn (9 commits)")[![Harumaro](https://avatars.githubusercontent.com/u/1568363?v=4)](https://github.com/Harumaro "Harumaro (2 commits)")

### Embed Badge

![Health badge](/badges/likebtn-referralcandy/health.svg)

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

PHPackages © 2026

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