Skip to content

Commit

Permalink
[CC-1576] Preauth: Remove preauth methods from payment service.
Browse files Browse the repository at this point in the history
- Adjust wording in PhpDoc
  • Loading branch information
Ryouzanpaku committed Oct 30, 2024
1 parent 2dbcdad commit 74b3de7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
2 changes: 1 addition & 1 deletion src/Resources/TransactionTypes/PreAuthorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use UnzerSDK\Adapter\HttpAdapterInterface;

/**
* This represents the authorization transaction.
* This represents the pre-authorization transaction.
*
* @link https://docs.unzer.com/
*
Expand Down
32 changes: 0 additions & 32 deletions src/Services/PaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,38 +104,6 @@ public function updateAuthorization($payment, Authorization $authorization): Aut
return $authorization;
}

public function performPreAuthorization(
Authorization $authorization,
$paymentType,
$customer = null,
Metadata $metadata = null,
Basket $basket = null
): Authorization
{
$payment = $this->createPayment($paymentType);
$paymentType = $payment->getPaymentType();
$authorization->setSpecialParams($paymentType !== null ? $paymentType->getTransactionParams() : []);

$payment->setAuthorization($authorization)->setCustomer($customer)->setMetadata($metadata)->setBasket($basket);

$this->getResourceService()->createResource($authorization);
return $authorization;
}

/**
* {@inheritDoc}
*
* @param Authorization $payment
*/
public function updatePreAuthorization($payment, Authorization $authorization): Authorization
{
$authorization->setId(null);
$paymentResource = $this->getResourceService()->getPaymentResource($payment);
$authorization->setPayment($paymentResource);
$this->getResourceService()->patchResource($authorization);
return $authorization;
}

/**
* {@inheritDoc}
*/
Expand Down

0 comments on commit 74b3de7

Please sign in to comment.