File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1010use Ypmn \Billing ;
1111use Ypmn \ApiRequest ;
1212use Ypmn \PaymentException ;
13+ use Ypmn \PaymentPageOptions ;
1314use Ypmn \Product ;
1415use Ypmn \Std ;
1516
111112$ payment ->addProduct ($ product2 );
112113// Установим валюту
113114$ payment ->setCurrency ('RUB ' );
114- // Создадим и установим авторизацию по типу платежа
115- $ payment ->setAuthorization (new Authorization ('CCVISAMC ' ,true ));
115+
116+ // Создадим авторизацию по типу платежа
117+ $ authorization = new Authorization ('CCVISAMC ' ,true );
118+ // Можно установить лимит времени для оплаты заказа (в секундах)
119+ $ authorization ->setPaymentPageOptions (new PaymentPageOptions (600 ));
120+ // Назначим авторизацию для нашего платежа
121+ $ payment ->setAuthorization ($ authorization );
122+
116123// Установим номер заказа (должен быть уникальным в вашей системе)
117124$ payment ->setMerchantPaymentReference ('primer_nomer__ ' . time ());
118125// Установим адрес перенаправления пользователя после оплаты
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public function __construct($timeoutSeconds)
2222 }
2323
2424 /** @inheritDoc */
25- public function setOrderTimeout (int $ timeoutSeconds ): paymentPageOptionsInterface
25+ public function setOrderTimeout (int $ timeoutSeconds ): self
2626 {
2727 if ($ timeoutSeconds < self ::MIN_ORDER_TIMEOUT_SECONDS ) {
2828 throw new PaymentException ($ timeoutSeconds . ' -- слишком маленькое время для оплаты заказа (в секундах) ' );
You can’t perform that action at this time.
0 commit comments