Closed JanisE closed 6 months ago
I found the bug.
You need to setPhone
, not setMobile
on this line: https://github.com/mijora/omniva-woocommerce/blob/25f8c0d5bcebd8b777c1da1bb77fbf56824aa2da/omniva-woocommerce/core/class-api-xml.php#L140
Hello,
Omniva allows to register shipments only by specifying mobile phone numbers, as the SMS message with shipment informations must be sent. As we know, the format of Latvian mobile phones is +3712xхxxxxx, so only this phone number format is allowed. The mobile phone number must be specified for both the recipient and the sender. Also, the error message is returned by the Omniva server, not the plugin, so there's nothing you can do about it from the plugin side.
The mobile phone number must be specified for both the recipient and the sender.
This may be true for the regular, individual clients, but we are a company (as probably most of the users of this plugin) with an agreement with Omniva (which is required to use the API at all), and the phone number for a company is what it is.
We were sending out Omniva shipments fine with our phone number until this new plugin upgrade. Previously, the plugin set it as a regular phone, and everything worked.
The Omniva configuration page has a note at the shop phone field:
Required mobile phone number if want use service "Delivery confirmation SMS to sender".
We do not want to receive the confirmation SMS about the delivery, but that is not a reason for the actual shipment to not work. I couldn't find such "Delivery confirmation SMS to sender" option though, so I'm not sure if it's enabled or disabled for our shop.
You can see that in version 1.14, the plugin set the mobile phone only if additional services were used and required the mobile phone: https://github.com/mijora/omniva-woocommerce/blob/0b3baa498db8aac64bbadca6fab2a44254644e77/omniva-woocommerce/core/class-api.php#L82
And the shop's phone was always added just as a regular phone: https://github.com/mijora/omniva-woocommerce/blob/0b3baa498db8aac64bbadca6fab2a44254644e77/omniva-woocommerce/core/class-api.php#L133
In version 1.15 you're trying to send shop's phone as a mobile phone for all cases.
Hello,
After thinking about the situation you described, it would actually be possible to make 2 phone fields, one of which would be for receiving SMS messages (added as an element "mobile"), and the other for a contact (added as an element "phone"). Please contact Omniva regarding this issue.
Thank you, the sender's phone works all right now. And the receiver's phone number is checked during the checkout if "Check phone format" is enabled.
After updating Omniva plugin (1.12.3 => 1.15.5), the label generation ends with an error "ITEMNR1 - - shipment.senderAddressee.contactMobile - Invalid mobile phone number"
I tried entering the same phone number that had a label successfully generated for – a few days ago with the old plugin version, and I tried to paste it as the shipping phone number and as the billing phone number and regenerate. I also tried prepending "+371" onto the number. But I'm still getting the same error.
This is a request example by
Mijora\Omniva\Request\call
to https://edixml.post.ee/epmx/services/messagesService.wsdl (specific data obscured):This is the response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns3:businessToClientMsgResponse xmlns:ns3="http://service.core.epmx.application.eestipost.ee/xsd"><partner>7.....5</partner><prompt>ERROR</prompt><savedPacketInfo/><faultyPacketInfo><barcodeInfo><clientItemId>ITEMNR1</clientItemId><message>shipment.senderAddressee.contactMobile - Invalid mobile phone number</message></barcodeInfo></faultyPacketInfo></ns3:businessToClientMsgResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>