Merge pull request #22 from ndeet/allow-any-currency
Allow any currency symbol via overloaded class.
This commit is contained in:
commit
3b161c5d00
@ -121,7 +121,7 @@ class Client implements ClientInterface
|
||||
->setBtcPrice(array_key_exists('btcPrice', $data) ? $data['btcPrice'] : '')
|
||||
->setPrice($data['price'])
|
||||
->setTaxIncluded($data['taxIncluded'])
|
||||
->setCurrency(new \Bitpay\Currency($data['currency']))
|
||||
->setCurrency(new \Bitpay\CurrencyUnrestricted($data['currency']))
|
||||
->setOrderId(array_key_exists('orderId', $data) ? $data['orderId'] : '')
|
||||
->setInvoiceTime($invoiceTime)
|
||||
->setExpirationTime($expirationTime)
|
||||
|
||||
16
src/Bitpay/CurrencyUnrestricted.php
Normal file
16
src/Bitpay/CurrencyUnrestricted.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Bitpay;
|
||||
|
||||
class CurrencyUnrestricted extends Currency
|
||||
{
|
||||
/**
|
||||
* Overrides the parent method to allow any currency symbol to be set.
|
||||
*/
|
||||
public function setCode($code)
|
||||
{
|
||||
$this->code = $code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user