diff --git a/.travis.yml b/.travis.yml index 7111012..24f877f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ php: - 7.4 - 8.0 - 8.1 + - 8.2 + - 8.3 before_script: - composer install -n --dev --prefer-source diff --git a/README.md b/README.md index 6fc95de..67e0956 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,9 @@ [![Build Status](https://app.travis-ci.com/dercoder/omnipay-webmoney.svg?branch=master)](https://app.travis-ci.com/github/dercoder/omnipay-webmoney) [![Coverage Status](https://coveralls.io/repos/dercoder/omnipay-webmoney/badge.svg?branch=master&service=github)](https://coveralls.io/github/dercoder/omnipay-webmoney?branch=master) -[![Latest Stable Version](https://poser.pugx.org/dercoder/omnipay-webmoney/v/stable.png)](https://packagist.org/packages/dercoder/omnipay-webmoney) -[![Total Downloads](https://poser.pugx.org/dercoder/omnipay-webmoney/downloads.png)](https://packagist.org/packages/dercoder/omnipay-webmoney) -[![Latest Unstable Version](https://poser.pugx.org/dercoder/omnipay-webmoney/v/unstable.png)](https://packagist.org/packages/dercoder/omnipay-webmoney) -[![License](https://poser.pugx.org/dercoder/omnipay-webmoney/license.png)](https://packagist.org/packages/dercoder/omnipay-webmoney) +[![Latest Stable Version](https://img.shields.io/packagist/v/dercoder/omnipay-webmoney)](https://packagist.org/packages/dercoder/omnipay-webmoney) +[![Total Downloads](https://img.shields.io/packagist/dt/dercoder/omnipay-webmoney)](https://packagist.org/packages/dercoder/omnipay-webmoney) +[![License](https://img.shields.io/packagist/l/dercoder/omnipay-webmoney)](https://packagist.org/packages/dercoder/omnipay-webmoney) [Omnipay](https://github.com/omnipay/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 7.0+. This package implements [WebMoney](https://www.webmoney.az) support for Omnipay. @@ -21,7 +20,7 @@ to your `composer.json` file: ```json { "require": { - "dercoder/omnipay-webmoney": "~4.0" + "dercoder/omnipay-webmoney": "^5.0" } } ``` diff --git a/src/Message/AbstractRequest.php b/src/Message/AbstractRequest.php index 19a4356..af2e6b2 100644 --- a/src/Message/AbstractRequest.php +++ b/src/Message/AbstractRequest.php @@ -251,8 +251,22 @@ public function getCurrencyByPurse($purse) return 'BYR'; case 'X': return 'BTC'; + case 'T': + return 'USDT'; default: return null; } } + + public function getCurrencies() + { + if ($this->currencies === null) { + $this->currencies = new \Money\Currencies\AggregateCurrencies([ + new \Money\Currencies\CryptoCurrencies(), + new \Money\Currencies\ISOCurrencies(), + ]); + } + + return $this->currencies; + } } diff --git a/tests/Message/PurchaseRequestTest.php b/tests/Message/PurchaseRequestTest.php index 388a012..97e7bab 100644 --- a/tests/Message/PurchaseRequestTest.php +++ b/tests/Message/PurchaseRequestTest.php @@ -87,6 +87,7 @@ public function testGetCurrencyByPurse() $this->assertSame('UZS', $this->request->getCurrencyByPurse('Y123428476799')); $this->assertSame('BYR', $this->request->getCurrencyByPurse('B123428476799')); $this->assertSame('BTC', $this->request->getCurrencyByPurse('X123428476799')); + $this->assertSame('USDT', $this->request->getCurrencyByPurse('T123428476799')); $this->assertNull($this->request->getCurrencyByPurse('A123428476799')); }