|
| 1 | +<?php |
| 2 | +/* |
| 3 | + * NOTICE OF LICENSE |
| 4 | + * |
| 5 | + * This source file is subject to the MIT License |
| 6 | + * It is available through the world-wide-web at this URL: |
| 7 | + * https://tldrlegal.com/license/mit-license |
| 8 | + * If you are unable to obtain it through the world-wide-web, please send an email |
| 9 | + * to support@buckaroo.nl so we can send you a copy immediately. |
| 10 | + * |
| 11 | + * DISCLAIMER |
| 12 | + * |
| 13 | + * Do not edit or add to this file if you wish to upgrade this module to newer |
| 14 | + * versions in the future. If you wish to customize this module for your |
| 15 | + * needs please contact support@buckaroo.nl for more information. |
| 16 | + * |
| 17 | + * @copyright Copyright (c) Buckaroo B.V. |
| 18 | + * @license https://tldrlegal.com/license/mit-license |
| 19 | + */ |
| 20 | + |
| 21 | +declare(strict_types=1); |
| 22 | + |
| 23 | +namespace Buckaroo\PaymentMethods\Banking; |
| 24 | + |
| 25 | +use Buckaroo\Models\Model; |
| 26 | +use Buckaroo\PaymentMethods\Banking\Models\InstantPaymentOrder; |
| 27 | +use Buckaroo\PaymentMethods\Banking\Models\PaymentOrder; |
| 28 | +use Buckaroo\PaymentMethods\Banking\Models\PaymentOrderPayload; |
| 29 | +use Buckaroo\PaymentMethods\Banking\Service\ParameterKeys\PaymentOrderAdapter; |
| 30 | +use Buckaroo\PaymentMethods\PayablePaymentMethod; |
| 31 | +use Buckaroo\Transaction\Response\TransactionResponse; |
| 32 | + |
| 33 | +class Banking extends PayablePaymentMethod |
| 34 | +{ |
| 35 | + /** |
| 36 | + * @var string |
| 37 | + */ |
| 38 | + protected string $paymentName = 'Banking'; |
| 39 | + |
| 40 | + /** |
| 41 | + * @return TransactionResponse |
| 42 | + */ |
| 43 | + public function paymentOrder(?Model $model = null): TransactionResponse |
| 44 | + { |
| 45 | + $paymentOrderPayload = new PaymentOrderPayload($this->payload); |
| 46 | + |
| 47 | + $this->request->setPayload($paymentOrderPayload); |
| 48 | + |
| 49 | + $this->setServiceList('PaymentOrder', $model ?? new PaymentOrderAdapter(new PaymentOrder($this->payload))); |
| 50 | + |
| 51 | + return $this->postRequest(); |
| 52 | + } |
| 53 | + |
| 54 | + /** |
| 55 | + * @return TransactionResponse |
| 56 | + */ |
| 57 | + public function instantPaymentOrder(?Model $model = null): TransactionResponse |
| 58 | + { |
| 59 | + $paymentOrderPayload = new PaymentOrderPayload($this->payload); |
| 60 | + |
| 61 | + $this->request->setPayload($paymentOrderPayload); |
| 62 | + |
| 63 | + $this->setServiceList('InstantPaymentOrder', $model ?? new PaymentOrderAdapter(new InstantPaymentOrder($this->payload))); |
| 64 | + |
| 65 | + return $this->postRequest(); |
| 66 | + } |
| 67 | +} |
0 commit comments