diff --git a/app/Livewire/BillingPortal/Authentication/Register.php b/app/Livewire/BillingPortal/Authentication/Register.php index 0bed4bdfda99..6e85cbc62201 100644 --- a/app/Livewire/BillingPortal/Authentication/Register.php +++ b/app/Livewire/BillingPortal/Authentication/Register.php @@ -59,7 +59,6 @@ class Register extends Component public function register(array $data) { - nlog($data); $service = new ClientRegisterService( company: $this->subscription->company, @@ -68,13 +67,8 @@ class Register extends Component $rules = $service->rules(); - nlog($rules); - $data = Validator::make($data, $rules)->validate(); - nlog("validated data"); - nlog($data); - $client = $service->createClient($data); $contact = $service->createClientContact($data, $client); diff --git a/app/PaymentDrivers/Authorize/AuthorizeTransaction.php b/app/PaymentDrivers/Authorize/AuthorizeTransaction.php index ec55465d6015..88b6c47d4739 100644 --- a/app/PaymentDrivers/Authorize/AuthorizeTransaction.php +++ b/app/PaymentDrivers/Authorize/AuthorizeTransaction.php @@ -147,7 +147,7 @@ class AuthorizeTransaction if($tresponse->getResponseCode() == "4"){ //notify user that this transaction is being held under FDS review: - FDSReview::dispatch((string)$tresponse->getTransId(), $this->authorize->payment_hash, $this->authorize->company_gateway->company->db); + FDSReview::dispatch((string)$tresponse->getTransId(), $this->authorize->payment_hash, $this->authorize->company_gateway->company->db); } } else { diff --git a/app/PaymentDrivers/Authorize/ChargePaymentProfile.php b/app/PaymentDrivers/Authorize/ChargePaymentProfile.php index 2e242f1326de..551d5b30f3a3 100644 --- a/app/PaymentDrivers/Authorize/ChargePaymentProfile.php +++ b/app/PaymentDrivers/Authorize/ChargePaymentProfile.php @@ -13,14 +13,15 @@ namespace App\PaymentDrivers\Authorize; use App\Models\Invoice; -use App\PaymentDrivers\AuthorizePaymentDriver; use App\Utils\Traits\MakesHash; -use net\authorize\api\contract\v1\CreateTransactionRequest; -use net\authorize\api\contract\v1\CustomerProfilePaymentType; -use net\authorize\api\contract\v1\ExtendedAmountType; +use App\PaymentDrivers\Authorize\FDSReview; use net\authorize\api\contract\v1\OrderType; +use App\PaymentDrivers\AuthorizePaymentDriver; +use net\authorize\api\contract\v1\ExtendedAmountType; use net\authorize\api\contract\v1\PaymentProfileType; use net\authorize\api\contract\v1\TransactionRequestType; +use net\authorize\api\contract\v1\CreateTransactionRequest; +use net\authorize\api\contract\v1\CustomerProfilePaymentType; use net\authorize\api\controller\CreateTransactionController; /** @@ -109,6 +110,12 @@ class ChargePaymentProfile nlog(' Code : '.$tresponse->getMessages()[0]->getCode()); nlog(' Description : '.$tresponse->getMessages()[0]->getDescription()); nlog(print_r($tresponse->getMessages()[0], 1)); + + if($tresponse->getResponseCode() == "4") { + //notify user that this transaction is being held under FDS review: + FDSReview::dispatch((string)$tresponse->getTransId(), $this->authorize?->payment_hash, $this->authorize->company_gateway->company->db); + } + } else { nlog('Transaction Failed '); if ($tresponse->getErrors() != null) { diff --git a/app/PaymentDrivers/Authorize/FDSReview.php b/app/PaymentDrivers/Authorize/FDSReview.php index bf35b4201715..91f7401449a9 100644 --- a/app/PaymentDrivers/Authorize/FDSReview.php +++ b/app/PaymentDrivers/Authorize/FDSReview.php @@ -17,7 +17,7 @@ use App\Services\Email\Email; use Illuminate\Bus\Queueable; use App\Services\Email\EmailObject; use Illuminate\Support\Facades\App; -use Symfony\Component\Mime\Address; +use Illuminate\Mail\Mailables\Address; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; @@ -50,21 +50,18 @@ class FDSReview implements ShouldQueue $invoices_string = \implode(', ', collect($this->payment_hash->invoices())->pluck('invoice_number')->toArray()) ?: ''; - $body = "Transaction {$this->transaction_reference} has been held for your review in Auth.net based on your Fraud Detection Settings.\n We have marked invoices {$invoices_string} as paid in Invoice Ninja.\n Please review these transaction in your auth.net account, and authorize them if they are correct to ensure the transactions are processed as expected. If these charges need to be cancelled, you will need to delete the payments that have been created in Invoice Ninja to reverse those payments."; + $body = "Transaction {$this->transaction_reference} has been held for your review in Auth.net based on your Fraud Detection Settings.\n\n\nWe have marked invoices {$invoices_string} as paid in Invoice Ninja.\n\n\nPlease review this transaction in your auth.net account, and authorize if correct to ensure the transaction is finalized as expected.\n\n\nIf these charges need to be cancelled, you will need to delete the payments that have been created in Invoice Ninja."; $mo = new EmailObject(); $mo->subject = "Transaction {$this->transaction_reference} held for review by auth.net"; - $mo->body = $body; + $mo->body = nl2br($body); $mo->text_body = $body; $mo->company_key = $company->company_key; $mo->html_template = 'email.template.generic'; $mo->to = [new Address($company->owner()->email, $company->owner()->present()->name())]; - // $mo->email_template_body = 'nordigen_requisition_body'; - // $mo->email_template_subject = 'nordigen_requisition_subject'; Email::dispatch($mo, $company); - } }