PHPackages                             papersky/pingyo - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. papersky/pingyo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

papersky/pingyo
===============

v1.1(10y ago)0262BSDPHPPHP &gt;=5.3.2

Since Jun 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Papersky/pingyo)[ Packagist](https://packagist.org/packages/papersky/pingyo)[ Docs](https://github.com/papersky/pingyo)[ RSS](/packages/papersky-pingyo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

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

[](#installation)

Application uses [Composer](http://getcomposer.org) to install and update:

```
curl -s http://getcomposer.org/installer | php
php composer.phar require papersky/pingyo:1.*

```

Usage
-----

[](#usage)

Enum fields will be converted to integer automatically. Dates will be converted to JS Date objects automatically.

Step 1. Create Source Details object

```
$source_details = new PingYo\SourceDetails();
$source_details->address = 'asd';
$source_details->clientuseragent = 'asd';
$source_details->creationurl = 'http://www.url.com';
```

Step 2. Create Application Details object

```
$application_details = new PingYo\ApplicationDetails();

$application_details->title = TitleTypes::MR;
$application_details->firstname = "John";
$application_details->lastname = "Smith";
$application_details->dateofbirth = "1994-09-01";
$application_details->email = "johnsmith@domain.com";
$application_details->homephonenumber = "+12345678900";
$application_details->mobilephonenumber = "07123456789";
$application_details->workphonenumber = "+12345678900";

$application_details->employername = "Test Corp";
$application_details->jobtitle = "Construction Worker";
$application_details->employmentstarted = "2014-09-01";
$application_details->employerindustry = PingYo\EmployerIndustryTypes::ConstructionManufacturing;
$application_details->incomesource = PingYo\IncomeSourceTypes::EmployedFullTime;
$application_details->payfrequency = PingYo\PayFrequencyTypes::LastWorkingDayMonth;
$application_details->payamount = 100;
$application_details->incomepaymenttype = PingYo\IncomePaymentTypes::RegionalDirectDeposit;
$application_details->nextpaydate = "2014-10-01";
$application_details->followingpaydate = "2014-10-10";
$application_details->loanamount = 10000;
$application_details->nationalidentitynumber = null;
$application_details->nationalidentitynumbertype = PingYo\NationalIdentityNumberTypes::NationalInsurance;
$application_details->consenttocreditsearch = true;
$application_details->consenttomarketingemails = true;
$application_details->residentialstatus = PingYo\ResidentialStatusTypes::HomeOwner;

$application_details->housenumber = "122";
$application_details->housename = null;
$application_details->addressstreet1 = "Test Street";
$application_details->addresscity = "Test City";
$application_details->addresscountrycode = "GB";
$application_details->addresscounty = "County Test";
$application_details->addressmovein = "2014-08-01";
$application_details->addresspostcode = "BT602EW";

$application_details->bankaccountnumber = "12345678";
$application_details->bankcardtype = PingYo\BankCardTypes::VisaDebit;
$application_details->bankroutingnumber = "123456";
$application_details->monthlymortgagerent = 600;
$application_details->monthlycreditcommitments = 100;
$application_details->otherexpenses = 250;
$application_details->minimumcommissionamount = 0;
$application_details->maximumcommissionamount = 0;
$application_details->applicationextensions = ["x"=>"hello","y"=>"world"];
```

Step 3. Create Application object and attach ApplicationDetails and SourceDetails objects

```
$application = new PingYo\Application();
$application->affiliateid = 'TEST';
$application->timeout = 120;
$application->testonly = true;
$application->setApplicationDetails($application_details);
$application->setSourceDetails($source_details);
```

Step 4. Validate

```
$validation_result = $application->validate();
if($validation_result)
{
	//prevalidation OK
	//next step
}
else
{
	var_dump($validation_result);
	//$validation_result contains validation problems
}
```

Step 5. Send Application

```
$application_status = $application->send();
if($application_status===false)
{
	//validation problems
	//step 4 missed?
}
else
{
	//next step
}
```

Step 6. Check Application Result

```
if($application_status->httpcode=202)
{
	//all fine, server validation passed
	//next step
}
else
{
	//check problems
	var_dump($application_status->errors);
	var_dump($application_status->message);
}
```

Step 7. Take Redirect Url. You can wait for result in loop or use async requests

```
while ($application_status->percentagecomplete!=100)
{
	$application_status->refresh();
	sleep(2);
}
$final_status = $application_status->status;
switch($final_status){
	case 'LenderMatchFound':
		$redirect_location = $application_status->redirectionurl;
	break;
	case 'Unknown':
		//some action
	break;
	case 'Resurrecting':
		//some action
	break;
	case 'Processing':
		//some action
	break;
	case 'LenderMatchFound':
		//some action
	break;
	case 'ConditionalLenderMatchFound':
		//some action
	break;
	case 'NoLenderMatchFound':
		//some action
	break;
	case 'Rejected':
		//some action
	break;
	case 'Withdrawn':
		//some action
	break;
	case 'Erred':
		//some action
	break;
}
```

Or Async method:

```
//get and save correlationid for async requests
$corrid = $application_status->correlationid;

//....
//async requests code
$application_status=PingYo\Status::CreateFromCorrelationId($corrid);
$application_status->refresh();
if($application_status->percentagecomplete==100)
{
	//action
}
else
{
	//do nothing, next request can take action
	//or read problems
	$status = $application_status->status;
	$problem = $application_status->message;
}
```

LOGGER SUPPORT
--------------

[](#logger-support)

Install Monolog Logger () or any other Psr3 logger

```
$logger = new Logger("PingYo");
$logger->pushHandler(new StreamHandler("pingyo.log"));

$application = new PingYo\Application();
$application->attachLogger($logger);

//...
//for async requests
$application_status=PingYo\Status::CreateFromCorrelationId($corrid,$logger);
```

RUNNING TESTS
-------------

[](#running-tests)

phpunit.phar --bootstrap tests/Bootstrap.php tests/PingYo/basictest

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

3991d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88e25423dd6d210129937fb93926b6ea7b36fb4f92637f17ee76269e8282df41?d=identicon)[brazilnut](/maintainers/brazilnut)

---

Tags

pingyo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/papersky-pingyo/health.svg)

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

###  Alternatives

[odolbeau/phone-number-bundle

Integrates libphonenumber into your Symfony application

24910.3M11](/packages/odolbeau-phone-number-bundle)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[log1x/acf-phone-number

A real ACF phone number field.

12072.5k](/packages/log1x-acf-phone-number)[serendipity_hq/component-value-objects

A set of value objects to manage simple and composite values

20558.6k4](/packages/serendipity-hq-component-value-objects)[rynpsc/craft-phone-number

International phone number field.

2265.9k](/packages/rynpsc-craft-phone-number)

PHPackages © 2026

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