| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | trait HandlesYandexCheckout |
||
| 18 | { |
||
| 19 | public function yandexCheckouts(): MorphMany |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param CreatePaymentRequestInterface|array $paymentRequest |
||
| 26 | * @param string|null $idempotenceKey |
||
| 27 | * @return YandexCheckout |
||
| 28 | */ |
||
| 29 | public function createPayment($paymentRequest, ?string $idempotenceKey = null): YandexCheckout |
||
| 30 | { |
||
| 31 | /** @var YandexCheckoutService $yandexCheckout */ |
||
| 32 | $yandexCheckout = Container::getInstance()->make(YandexCheckoutService::class); |
||
| 33 | |||
| 34 | return $yandexCheckout->createPayment( |
||
| 35 | $this, |
||
| 36 | $paymentRequest, |
||
| 37 | $idempotenceKey ?? $this->yandexCheckoutIdempotenceKey() |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function yandexCheckoutIdempotenceKey(): ?string |
||
| 44 | } |
||
| 45 | } |
||
| 46 |