PHPackages                             and/w1-api - 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. and/w1-api

ActiveLibrary[API Development](/categories/api)

and/w1-api
==========

W1 API

v0.5(11y ago)030BSD-2-ClausePHPPHP &gt;=5.4.0

Since Jan 18Pushed 11y ago1 watchersCompare

[ Source](https://github.com/logical-and/w1-api)[ Packagist](https://packagist.org/packages/and/w1-api)[ Docs](https://github.com/logical-and/w1-api)[ RSS](/packages/and-w1-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

W1 API helper
=============

[](#w1-api-helper)

The workflow constists from 2 steps:

1. Redirect user to W1 payment page
2. Check the payment

Here is code samples for each step:

1-st step:

```
$api = new W1\PaymentAPI('merchantId', 'secretKey');
echo $api->getFormHTMLDocument($api->createPaymentForm()
	->setPaymentId(uniqid())
	->setCultureId('ru' == $this->getLastLocale() ?
  	  W1\Form\PaymentForm::LANG_RU :
  	  W1\Form\PaymentForm::LANG_EN
	 )
	->setAmount(2.99)
	->setCurrencyId(W1\Form\PaymentForm::CURRENCY_USD)
	->setDescription('Оплата за что-то')
	->setSuccessUrl($this->get_page_url('buy_method_w1_callback')) // to redirect user
	->setFailUrl($this->get_page_url('')) // to redirect user
```

2-nd step:

```
$api = new W1\PaymentAPI('merchantId', 'secretKey');
if (!empty($_POST))
{
	if (!$api->createPaymentForm()->isPaymentAccepted($_POST))
	{
		$this->logger()->log_exception('Error:W1', 'Wrong confirmation: ' . json_encode($_POST), __FILE__, __LINE__);
		echo $api->getRetryResponse('Wrong confirmation');
	}
	else
	{
		$this->buy_dlc_finalize();
		echo $api->getSuccessResponse();
	}
}
else $this->redirect_to_relative('buy_method_w1');
```

And that's all! You're wonderful! :)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

4135d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0499fdd6338e1520be3ab6776948652c429291c08b79504a2eec2315d73787ab?d=identicon)[And](/maintainers/And)

---

Top Contributors

[![logical-and](https://avatars.githubusercontent.com/u/1403109?v=4)](https://github.com/logical-and "logical-and (1 commits)")

---

Tags

apipaymentw1

### Embed Badge

![Health badge](/badges/and-w1-api/health.svg)

```
[![Health](https://phpackages.com/badges/and-w1-api/health.svg)](https://phpackages.com/packages/and-w1-api)
```

###  Alternatives

[everypay/everypay-php

1742.0k](/packages/everypay-everypay-php)

PHPackages © 2026

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