Closed code-quantum closed 6 years ago
Hi, we've added all available status codes which can be returned from SPP you should no longer get an exceptions like that. But your response code - 2064 - APG: vTid not subscribed means that there is something wrong with your SPP account or you have given wrong username during library initialization. Example:
SwedbankPaymentPortal::init(new ServiceOptions(
new CommunicationOptions(
$processingUrl
),
new Authentication(
$username,
$password
)
));
I try to use banklink and get exception: ` $purchaseRequest = (new PurchaseBuilder()) ->setDescription("Invoice №$invoice->doc_id") ->setAmountValue($purchaseAmount) // 10000 (100 евро) ->setAmountExponent(1) ->setAmountCurrencyCode($currency_code) // 978 - это для евро ->setConsumerEmail($email_row) // customer@email.com ->setServiceType(ServiceType::ltvBank()) ->setPaymentMethod(PaymentMethod::swedbank()) ->setSuccessUrl($this->callback_domain . 'payments/bank_link/confirm?way=confirmed&order_id=' . $merchantReferenceId) ->setFailureUrl($this->callback_domain . 'payments/bank_link/confirm?way=cancelled&order_id=' . $merchantReferenceId) ->setMerchantReference($merchantReferenceId) // 1091904-181 ->setLanguage("ru") ->setPageSetId(1) ->getPurchaseRequest();
$response = $spp->getBankLinkGateway()->initPayment( $purchaseRequest, new Swedbank_Ordering_Handler_PaymentCompletedCallback( $merchantReferenceId ) ); <---— тут ошибка
RuntimeException: Unknown value '2064' was given for enum SwedbankPaymentPortal\SharedEntity\Type\PurchaseStatus in /var/www/lk_intergaz/vendor/swedbank-spp/swedbank-payment-portal/src/SharedEntity/Type/AbstractEnumerableType.php:159 Stack trace:
0 /var/www/lk_intergaz/vendor/swedbank-spp/swedbank-payment-portal/src/SharedEntity/Type/PurchaseStatus.php(239): SwedbankPaymentPortal\SharedEntity\Type\AbstractEnumerableType->assignId(2064)
1 /var/www/lk_intergaz/vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php(239): SwedbankPaymentPortal\SharedEntity\Type\PurchaseStatus->deserialize(Object(JMS\Serializer\XmlDeserializationVisitor), Object(SimpleXMLElement), Object(JMS\Serializer\DeserializationContext))
2 /var/www/lk_intergaz/vendor/jms/serializer/src/JMS/Serializer/XmlDeserializationVisitor.php(295): JMS\Serializer\GraphNavigator->accept(Object(SimpleXMLElement), Array, Object(JMS\Serializer\DeserializationContext))
3 /var/www/lk_intergaz/vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php(261): JMS\Serializer\XmlDeserializationVisitor->visitProperty(Object(JMS\Serializer\Metadata\PropertyMetadata), Object(SimpleXMLElement), Object(JMS\Serializer\DeserializationContext))