mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 16:34:35 -04:00
Minor fixes
This commit is contained in:
parent
699d5d39f0
commit
ebc58a18bb
@ -26,7 +26,10 @@ class ValidAmount implements Rule
|
|||||||
*/
|
*/
|
||||||
public function passes($attribute, $value)
|
public function passes($attribute, $value)
|
||||||
{
|
{
|
||||||
return trim($value, '-1234567890.,') === '';
|
return is_numeric((string)$value);
|
||||||
|
//return filter_var((string)$value, FILTER_VALIDATE_FLOAT);
|
||||||
|
// return preg_match('^(?=.)([+-]?([0-9]*)(\.([0-9]+))?)$^', (string)$value);
|
||||||
|
// return trim($value, '-1234567890.,') === '';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,6 +221,19 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
{
|
{
|
||||||
$this->confirmGatewayFee();
|
$this->confirmGatewayFee();
|
||||||
|
|
||||||
|
/*Never create a payment with a duplicate transaction reference*/
|
||||||
|
if(array_key_exists('transaction_reference', $data)){
|
||||||
|
|
||||||
|
$_payment = Payment::where('transaction_reference', $data['transaction_reference'])
|
||||||
|
->where('client_id', $this->client->id)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if($_payment)
|
||||||
|
return $_payment;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$payment = PaymentFactory::create($this->client->company->id, $this->client->user->id);
|
$payment = PaymentFactory::create($this->client->company->id, $this->client->user->id);
|
||||||
$payment->client_id = $this->client->id;
|
$payment->client_id = $this->client->id;
|
||||||
$payment->company_gateway_id = $this->company_gateway->id;
|
$payment->company_gateway_id = $this->company_gateway->id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user