Fixes for ACH

This commit is contained in:
David Bomba 2021-07-22 08:44:03 +10:00
parent 10db97d17f
commit c6ed151813
5 changed files with 19 additions and 9 deletions

View File

@ -87,10 +87,10 @@ class Gateway extends StaticModel
case 20:
case 56:
return [GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true],
GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable']],
GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable','charge.succeeded']],
GatewayType::ALIPAY => ['refund' => false, 'token_billing' => false],
GatewayType::APPLE_PAY => ['refund' => false, 'token_billing' => false],
GatewayType::SOFORT => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable']]]; //Stripe
GatewayType::SOFORT => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']]]; //Stripe
break;
case 39:
return [GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true]]; //Checkout

View File

@ -105,7 +105,7 @@ class ACH
$this->stripe->init();
$bank_account = Customer::retrieveSource($request->customer, $request->source, $this->stripe->stripe_connect_auth);
$bank_account = Customer::retrieveSource($request->customer, ['source' => $request->source], $this->stripe->stripe_connect_auth);
try {
$bank_account->verify(['amounts' => request()->transactions]);

View File

@ -24,6 +24,7 @@ use App\Models\Task;
use App\Models\Timezone;
use App\Models\Vendor;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
/**
* Class GeneratesCounter.
@ -343,17 +344,24 @@ trait GeneratesCounter
{
$check = false;
$check_counter = 1;
do {
$number = $this->padCounter($counter, $padding);
$number = $this->applyNumberPattern($entity, $number, $pattern);
$number = $this->prefixCounter($number, $prefix);
$check = $class::whereCompanyId($entity->company_id)->whereNumber($number)->withTrashed()->first();
$check = $class::whereCompanyId($entity->company_id)->whereNumber($number)->withTrashed()->exists();
$counter++;
$check_counter++;
if($check_counter > 100)
return $number . "_" . Str::random(5);
} while ($check);
return $number;
@ -364,7 +372,7 @@ trait GeneratesCounter
public function checkNumberAvailable($class, $entity, $number) :bool
{
if ($entity = $class::whereCompanyId($entity->company_id)->whereNumber($number)->withTrashed()->first())
if ($entity = $class::whereCompanyId($entity->company_id)->whereNumber($number)->withTrashed()->exists())
return false;
return true;

View File

@ -14,9 +14,11 @@ class ChangeEnglishLanguagesTables extends Migration
*/
public function up()
{
$language = Language::find(1);
$language->name = 'English - United States';
$language->save();
if($language = Language::find(1))
{
$language->name = 'English - United States';
$language->save();
}
}
/**

View File

@ -24,7 +24,7 @@ class LanguageSeeder extends Seeder
// https://www.loc.gov/standards/iso639-2/php/code_list.php
$languages = [
['id' => 1, 'name' => 'English', 'locale' => 'en'],
['id' => 1, 'name' => 'English - United States', 'locale' => 'en'],
['id' => 2, 'name' => 'Italian', 'locale' => 'it'],
['id' => 3, 'name' => 'German', 'locale' => 'de'],
['id' => 4, 'name' => 'French', 'locale' => 'fr'],