Steuerberater Modul tax
This commit is contained in:
parent
0f82fea88a
commit
245c281541
22 changed files with 1489 additions and 139 deletions
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Cron;
|
||||
|
||||
use App\Http\Controllers\Pay\PayoneController;
|
||||
use App\Models\PaymentTransaction;
|
||||
use App\Models\ShoppingOrder;
|
||||
use App\Models\ShoppingOrderItem;
|
||||
use App\Models\UserAbo;
|
||||
|
|
@ -74,6 +75,7 @@ class UserMakeOrder
|
|||
$this->pay->setAboPayment($this->userAbo, $amount, 'EUR');
|
||||
$this->pay->setPersonalData();
|
||||
$response = $this->pay->onlyPaymentResponse();
|
||||
$this->recordPaymentTransaction($response);
|
||||
\Log::info('Response: '.json_encode($response));
|
||||
// $response = $this->pay->ResponseData(true);
|
||||
|
||||
|
|
@ -86,6 +88,33 @@ class UserMakeOrder
|
|||
}
|
||||
}
|
||||
|
||||
private function recordPaymentTransaction(mixed $response): void
|
||||
{
|
||||
$shoppingPayment = $this->getShoppingPayment();
|
||||
if (! $shoppingPayment) {
|
||||
return;
|
||||
}
|
||||
|
||||
$responseData = is_object($response) ? (array) $response : $response;
|
||||
if (! is_array($responseData) || ! isset($responseData['status'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
PaymentTransaction::create([
|
||||
'shopping_payment_id' => $shoppingPayment->id,
|
||||
'request' => 'authorization',
|
||||
'txid' => $responseData['txid'] ?? 0,
|
||||
'userid' => $responseData['userid'] ?? $this->userAbo->payone_userid ?? 0,
|
||||
'status' => $responseData['status'],
|
||||
'txaction' => $responseData['txaction'] ?? null,
|
||||
'transmitted_data' => $responseData,
|
||||
'errorcode' => $responseData['errorcode'] ?? null,
|
||||
'errormessage' => $responseData['errormessage'] ?? null,
|
||||
'customermessage' => $responseData['customermessage'] ?? null,
|
||||
'mode' => $shoppingPayment->mode,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getShoppingPayment()
|
||||
{
|
||||
Log::info('Rufe Zahlungsinformationen ab für UserAbo ID: '.$this->userAbo->id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue