Skip to content

Commit

Permalink
refactor code, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
konradkozaczenko committed May 10, 2024
1 parent e49cd71 commit 4f82750
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ $gateway->execute($captureRequest);

### Missing features

* `OrderRequest` params `cardOnFile`, `recurring`, `mcpData`, `threeDsAuthentication`, `credit`
* `OrderRequest` params `recurring`, `mcpData`, `threeDsAuthentication`, `credit`
* ...
2 changes: 1 addition & 1 deletion src/Action/CaptureAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private function prepareOrderRequest(Capture $request, TokenInterface $token, Mo
$model->additionalDescription(),
$model->visibleDescription(),
$model->statementDescription(),
$model->cardOnFile()?->value
$model->cardOnFile()
);
}

Expand Down
5 changes: 3 additions & 2 deletions src/ValueObject/Request/OrderRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Answear\Payum\PayU\ValueObject\Request;

use Answear\Payum\PayU\Enum\AuthType;
use Answear\Payum\PayU\Enum\CardOnFileEnum;
use Answear\Payum\PayU\Enum\RecurringEnum;
use Answear\Payum\PayU\ValueObject\Buyer;
use Answear\Payum\PayU\ValueObject\Product;
Expand Down Expand Up @@ -35,7 +36,7 @@ public function __construct(
public readonly ?string $additionalDescription = null,
public readonly ?string $visibleDescription = null,
public readonly ?string $statementDescription = null,
public ?string $cardOnFile = null,
public ?CardOnFileEnum $cardOnFile = null,
public ?string $recurring = null,
) {
Assert::notEmpty($this->products);
Expand Down Expand Up @@ -63,7 +64,7 @@ public function toArray(string $merchantPosId): array
'buyer' => $this->buyer?->toArray(),
'products' => array_map(static fn(Product $product) => $product->toArray(), $this->products),
'payMethods' => null === $this->payMethod ? null : ['payMethod' => $this->payMethod->toArray()],
'cardOnFile' => $this->cardOnFile,
'cardOnFile' => $this->cardOnFile?->value,
'recurring' => $this->recurring,
];
}
Expand Down

0 comments on commit 4f82750

Please sign in to comment.