czech_post_b2b_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +40 -0
- data/CHANGELOG.md +14 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +281 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/certs/postsignum_qca4_root.pem +41 -0
- data/certs/postsignum_vca5_sub.pem +44 -0
- data/doc/CzechPostB2bClient.html +479 -0
- data/doc/CzechPostB2bClient/B2BErrors.html +242 -0
- data/doc/CzechPostB2bClient/B2BErrors/BadRequestError.html +145 -0
- data/doc/CzechPostB2bClient/B2BErrors/BaseError.html +376 -0
- data/doc/CzechPostB2bClient/B2BErrors/CustomerRequestsCountOverflowError.html +145 -0
- data/doc/CzechPostB2bClient/B2BErrors/InternalB2BServerError.html +145 -0
- data/doc/CzechPostB2bClient/B2BErrors/InternalBackendServerError.html +145 -0
- data/doc/CzechPostB2bClient/B2BErrors/InternalDataPersistenceServerError.html +145 -0
- data/doc/CzechPostB2bClient/B2BErrors/ProcessingUnfinishedYetError.html +145 -0
- data/doc/CzechPostB2bClient/B2BErrors/ServiceBusyError.html +145 -0
- data/doc/CzechPostB2bClient/B2BErrors/UnauthorizedContractAccessError.html +145 -0
- data/doc/CzechPostB2bClient/B2BErrors/UnauthorizedRoleAccessError.html +145 -0
- data/doc/CzechPostB2bClient/Configuration.html +1005 -0
- data/doc/CzechPostB2bClient/Error.html +128 -0
- data/doc/CzechPostB2bClient/PrintingTemplates.html +199 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AddressData3x8.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel.html +117 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/Blank.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/Blank4OnPage.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/BlankLandscape.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/ForeignPackage.html +115 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/ForeignPackage/EMS.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/ForeignPackage/EMS2x4.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/ForeignPackage/Standard.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/ForeignPackage/Standard4OnPage.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/ForeignPackage/Valuable.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/ForeignPackage/Valuable4OnPage.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/Simple.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/AdressLabel/SimpleWithCODVoucherA.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/Base.html +279 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/CODVoucherA.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/CODVoucherA3OnPage.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/CODVoucherC.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/CODVoucherForCSOB.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/CustomDeclarationCN22.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/CustomDeclarationCN23.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/DeliveryTicket.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/Envelope.html +115 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/Envelope/EnvelopeB4.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/Envelope/EnvelopeC5.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/Envelope/EnvelopeC6.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/Envelope/EnvelopeDL.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/HarmonizedLabel.html +141 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/HarmonizedLabel4OnPage.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/IntegratedDocument.html +129 -0
- data/doc/CzechPostB2bClient/PrintingTemplates/RRLabels3x8.html +129 -0
- data/doc/CzechPostB2bClient/RequestBuilders.html +117 -0
- data/doc/CzechPostB2bClient/RequestBuilders/BaseBuilder.html +396 -0
- data/doc/CzechPostB2bClient/RequestBuilders/GetParcelStateBuilder.html +329 -0
- data/doc/CzechPostB2bClient/RequestBuilders/GetParcelsPrintingBuilder.html +470 -0
- data/doc/CzechPostB2bClient/RequestBuilders/GetResultParcelsBuilder.html +329 -0
- data/doc/CzechPostB2bClient/RequestBuilders/GetStatsBuilder.html +403 -0
- data/doc/CzechPostB2bClient/RequestBuilders/SendParcelsBuilder.html +403 -0
- data/doc/CzechPostB2bClient/ResponseCodes.html +242 -0
- data/doc/CzechPostB2bClient/ResponseCodes/AddressAllowedForBalikovnaOnly.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/AddressIsNotValidForSubject.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/AddressNeedsPhoneNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/AddressSuitableForLocalDelivery.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/AddressValidOnlyForNaPostu.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/AddressValidOnlyForNaPostuDuplicate.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/AddresseeCityRequired.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/AlreadyAssignedOrderNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadAddressee.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadCODAmount.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadFormatReturnNumberDays.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadHeight.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadLength.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadPrefix.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadPrefixForAddress.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadPrice.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadVariableSymbol.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadWeight.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BadWidth.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BaseCode.html +550 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BatchClosed.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BatchInvalid.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/BatchUnfinished.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/CODAmountOutOfRange.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/CODAmountTooBig.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/CanceledOrderNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/CustomGoodQuantityOutOfRange.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/CustomerIDNotInAccordanceWithParcelCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/DensityOutOfRange.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/DuplicateDuplicateParcelCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/DuplicateParcel.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/DuplicateParcelCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/DuplicitParcelCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/FullSequence.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/FullSequenceDuplicate.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/IllegalCombinationOfServices.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoAddRequiredService75.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoAddService1A.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoAddService1B.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoAddService1D.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoAddService9.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoAddressWasModified.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoAddresseeToLong.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelCustCardNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelCustCardNumberAddresseeDocument.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelHeight.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelLength.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelMobilePhoneOrEmailAddresseeDocument.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelPalettsNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelPersonalIdentificationNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1AB.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1ABForService40.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1AForPostCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1AForService40.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1AWith1B.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1B.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1BAddService1A.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1BForPostCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1BWith1A.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1D.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1E.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService1V.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService25.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService27.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService29.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService30.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService31.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService34.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService34InvalidPhoneNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService45.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService45InvalidPhoneNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService46.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService47.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService5B.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService5BAnd5C.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService5BAnd5D.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService5C.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService5CAnd5D.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelService5D.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelVSVoucher.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCancelWidth.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoCityChanged.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInexactAddress.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidAccount.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidBankCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidBirthDay.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidCODAmount.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidCategoryCustomDecalaration.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidEmail.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidMobilePhoneNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidPhoneNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidPrefixAccount.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidPrice.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidSpecificSymbol.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidTelephoneNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoInvalidWeight.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoMissingPartCityServiceDeliveryOnSundayOrHolidayMayNotBeRealized.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoPriceIsNotNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoPriceIsTooBig.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoService29And47.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InfoSpecialPackagingRequest.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InternalApplicationError.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAddressAddresseeDocumentForParcelType.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAddressAddresseeDocumentObjectNotFound.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAddressAddresseeDocumentWrongCity.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAddressForBalikovna.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAddressForBigPackage.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAddressForCODAmountOver20000.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAddressForParcelType.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAddressee.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAmount.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAmountCurrency.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidAmountType.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidCODAmount.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidCODCurrency.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidCODCurrencyAccordance.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidCategoryCustomDecalaration.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidContentCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidCurrencyCustomDecalaration.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidCustomGoodNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidCustomerCardNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidCustomerId.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidDensity.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidEmail.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidHeight.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidHsCodeCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidIsoCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidIsoCustomGoodFormat.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidLength.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidLocation.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidMRNCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidMRNCodeControl.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidNumberClosure.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidOrderNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidParcelBarcode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidParcelBarcodeDuplicate.html +145 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidParcelCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidParcelCodeControl.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidParcelResponseCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidParcelTypeForID.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPartnerCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPayday.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPhoneNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPostCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPrefixAccordance.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPrefixCombination.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPrefixForDimensionsAndFragile.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPrice.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPriceCurrency.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPriceCurrencyAccordance.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidPriceCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidQuantityCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidResponsibleConsignmentNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidReturnNumberDays.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidService18.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidService19.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidServiceCombination.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidServicesForDimensions.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidSignNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidSubisoCountry.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidTareWeight.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidTiming.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidTransmissionDate.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidTypePrefix.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidUseOfService36.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidUseOfService37.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidUseOfService38.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidWeight.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidWeightCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidWeightCustomGoodSummary.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidWeightForService11.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidWidth.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidZPROOrderNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidZPROOrderNumberFormat.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/InvalidostCodeOrCity.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MIssingParcelCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingAddressee.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingAddresseeCity.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingAddresseeStreet.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingAddresseeZipCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingCODAmount.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingCODAmountType.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingCategoryCustomDecalaration.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingCompanyName.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingContentCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingCurrencyCustomDeclaration.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingHandlingInstructions.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingHeight.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingHsCodeCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingIsoCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingLength.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingPalettsNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingParcelCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingParcelCustomGoods.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingPhoneNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingPrefix.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingPrice.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingPriceCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingQuantityCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredAddresseeDocument.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredAddresseeDocumentDuplicate.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredAddresseeEmail.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredEmail.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredFirstNameAddresseeDocument.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredMRNCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredMobileNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredMobileNumberOrEmail.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredParcelCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredPayday.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredPhoneNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredPhoneNumberOrEmail.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredPhoneNumberOrWhat.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredPrice.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService10.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService1AB.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService1X.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService2X.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService3X.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService3XTrinity.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService4.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService4X.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredService4x.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredVoucherPrice.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingRequiredZPROOrderNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingReturnInstructions.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingReturnNumberDays.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingSenderEmail.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingSizeCategory.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingSurname.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingVariableSymbol.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingVariableSymbolDuplicate.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingWeightCustomGood.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/MissingWidth.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/NfoCancelService9.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/NoContractService41.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/NoContractServiceReturnReceipt.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/NotExistingOrderNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/Ok.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/OverenoVecerniDorucovani.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/PalettsNumberOutOfRange.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/ParcelCodeNotAllowed.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/ParcelCodeNotInAssignedRange.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/ParcelDoesNotMeetTheRequirementsForm.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/PriceAndCODAmountTooBig.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/PriceOutOfRange.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/PriceTooBig.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/PriceTooLow.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/ResponsibleConsignmentNumberCannotBeImported.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/ResponsibleConsignmentNumberOutOfRange.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/ServicesCombinationNotAllowed.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/TransmissionAlreadyClosed.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/TransmissionNotExists.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/TransmissionOpened.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/TransmissionUnfinished.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/UnauthorizedAccess.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/UnknownAddresseeCity.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/UnknownAddresseePostCode.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/UnknownPrefix.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/VariableSymbolIsNotNumber.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/WeightCustomGoodOutOfRange.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/WeightIsOutOfRange.html +134 -0
- data/doc/CzechPostB2bClient/ResponseCodes/WeightIsOutOfRangeDuplicate.html +134 -0
- data/doc/CzechPostB2bClient/ResponseParsers.html +117 -0
- data/doc/CzechPostB2bClient/ResponseParsers/BaseParser.html +283 -0
- data/doc/CzechPostB2bClient/ResponseParsers/GetParcelStateParser.html +533 -0
- data/doc/CzechPostB2bClient/ResponseParsers/GetParcelsPrintingParser.html +463 -0
- data/doc/CzechPostB2bClient/ResponseParsers/GetResultParcelsParser.html +625 -0
- data/doc/CzechPostB2bClient/ResponseParsers/GetStatsParser.html +347 -0
- data/doc/CzechPostB2bClient/ResponseParsers/SendParcelsParser.html +231 -0
- data/doc/CzechPostB2bClient/Services.html +117 -0
- data/doc/CzechPostB2bClient/Services/AddressSheetsGenerator.html +451 -0
- data/doc/CzechPostB2bClient/Services/ApiCaller.html +307 -0
- data/doc/CzechPostB2bClient/Services/Communicator.html +220 -0
- data/doc/CzechPostB2bClient/Services/DeliveringInspector.html +324 -0
- data/doc/CzechPostB2bClient/Services/Orchestrator.html +143 -0
- data/doc/CzechPostB2bClient/Services/ParcelsSendProcessUpdater.html +377 -0
- data/doc/CzechPostB2bClient/Services/ParcelsSender.html +402 -0
- data/doc/CzechPostB2bClient/Services/ParcelsSubmissionCloser.html +337 -0
- data/doc/CzechPostB2bClient/Services/TimePeriodStatisticator.html +398 -0
- data/doc/SteppedService.html +224 -0
- data/doc/SteppedService/Base.html +706 -0
- data/doc/SteppedService/Errors.html +365 -0
- data/doc/_index.html +2607 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +357 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +357 -0
- data/doc/js/app.js +303 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +923 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/czech_post_b2b_client.rb +37 -0
- data/lib/czech_post_b2b_client/b2b_errors.rb +105 -0
- data/lib/czech_post_b2b_client/configuration.rb +34 -0
- data/lib/czech_post_b2b_client/printing_templates.rb +166 -0
- data/lib/czech_post_b2b_client/request_builders.rb +8 -0
- data/lib/czech_post_b2b_client/request_builders/base_builder.rb +90 -0
- data/lib/czech_post_b2b_client/request_builders/get_parcel_state_builder.rb +44 -0
- data/lib/czech_post_b2b_client/request_builders/get_parcels_printing_builder.rb +79 -0
- data/lib/czech_post_b2b_client/request_builders/get_result_parcels_builder.rb +28 -0
- data/lib/czech_post_b2b_client/request_builders/get_stats_builder.rb +30 -0
- data/lib/czech_post_b2b_client/request_builders/send_parcels_builder.rb +294 -0
- data/lib/czech_post_b2b_client/response_codes.rb +1900 -0
- data/lib/czech_post_b2b_client/response_parsers.rb +8 -0
- data/lib/czech_post_b2b_client/response_parsers/base_parser.rb +95 -0
- data/lib/czech_post_b2b_client/response_parsers/get_parcel_state_parser.rb +54 -0
- data/lib/czech_post_b2b_client/response_parsers/get_parcels_printing_parser.rb +42 -0
- data/lib/czech_post_b2b_client/response_parsers/get_result_parcels_parser.rb +56 -0
- data/lib/czech_post_b2b_client/response_parsers/get_stats_parser.rb +27 -0
- data/lib/czech_post_b2b_client/response_parsers/send_parcels_parser.rb +13 -0
- data/lib/czech_post_b2b_client/services.rb +10 -0
- data/lib/czech_post_b2b_client/services/address_sheets_generator.rb +55 -0
- data/lib/czech_post_b2b_client/services/api_caller.rb +115 -0
- data/lib/czech_post_b2b_client/services/communicator.rb +28 -0
- data/lib/czech_post_b2b_client/services/delivering_inspector.rb +50 -0
- data/lib/czech_post_b2b_client/services/orchestrator.rb +27 -0
- data/lib/czech_post_b2b_client/services/parcels_send_process_updater.rb +71 -0
- data/lib/czech_post_b2b_client/services/parcels_sender.rb +53 -0
- data/lib/czech_post_b2b_client/services/parcels_submission_closer.rb +23 -0
- data/lib/czech_post_b2b_client/services/time_period_statisticator.rb +44 -0
- data/lib/czech_post_b2b_client/version.rb +5 -0
- data/lib/stepped_service.rb +4 -0
- data/lib/stepped_service/base.rb +139 -0
- data/lib/stepped_service/errors.rb +29 -0
- metadata +571 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bff8d19f2cd4f9ee58994477fb890eef066510e2
|
4
|
+
data.tar.gz: ed5744ba6049e7710470c3f95f2e31d00fcaf9c9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9b08eaa088b9f79a9ad3d94e70002a3e3f20459738eaa8bd773e4057776a05fedc6fe711716c122ded6d3be167163044599d644e16b680d791951bcb786e8d94
|
7
|
+
data.tar.gz: c73c9233831f71dd17ae21abfd6c657abac0f15f66486063a9e4d5125cdb49fe0b586642b6e9586085609e317a58481e74a325adbd3f446b5213540ad0ddf78a
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require:
|
2
|
+
# - rubocop-minitest
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
Include:
|
6
|
+
- "**/Gemfile"
|
7
|
+
- "**/Rakefile"
|
8
|
+
- "**/*.rb"
|
9
|
+
- "**/*.ru"
|
10
|
+
- "**/Rakefile"
|
11
|
+
- "**/*.rake"
|
12
|
+
- "**/*.jb"
|
13
|
+
Exclude:
|
14
|
+
- "bin/*"
|
15
|
+
Rails:
|
16
|
+
Enabled: false
|
17
|
+
Documentation:
|
18
|
+
Enabled: false
|
19
|
+
Metrics/LineLength:
|
20
|
+
Max: 120
|
21
|
+
Metrics/AbcSize:
|
22
|
+
Max: 20
|
23
|
+
Metrics/MethodLength:
|
24
|
+
Max: 20
|
25
|
+
Metrics/BlockLength:
|
26
|
+
Enabled: false
|
27
|
+
Metrics/CyclomaticComplexity:
|
28
|
+
Max: 7
|
29
|
+
Metrics/ClassLength:
|
30
|
+
Max: 210
|
31
|
+
Metrics/ModuleLength:
|
32
|
+
Max: 200
|
33
|
+
Style/TrivialAccessors:
|
34
|
+
Enabled: true
|
35
|
+
Style/MixinUsage:
|
36
|
+
Enabled: true
|
37
|
+
Style/YodaCondition:
|
38
|
+
EnforcedStyle: forbid_for_equality_operators_only
|
39
|
+
Naming/PredicateName:
|
40
|
+
Enabled: true
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at foton@centrum.cz. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Petr Mlčoch
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,281 @@
|
|
1
|
+
# CzechPostB2bClient
|
2
|
+
Accessing B2B API of Czech Post for bulk processing of parcels ("B2B - WS PodáníOnline").
|
3
|
+
|
4
|
+
There are these supported operations of API:
|
5
|
+
- *sendParcels* - stores data of parcels for async processing [HTTP POST - async response]
|
6
|
+
- *getResultParcels* - return results of such processing [HTTP GET - sync response]
|
7
|
+
- *getStats* - returns statistics of parcels sent in time period [HTTP GET - sync response]
|
8
|
+
- *getParcelState* - returns all known states for listed parcels [HTTP GET - sync response]
|
9
|
+
- *getParcelsPrinting* - returns PDF with address labels/stickers for listed parcels [HTTP GET - sync response]
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
### 1) Registration at Czech Post (CP)
|
13
|
+
The longterm and hardest part.
|
14
|
+
- Connect Czech Post representative and make a contract with them.
|
15
|
+
- Ask them for ALL documentation!(I have to ask 3 times to collect enough of it). They like to put files into DOCX file, so click on file icons!
|
16
|
+
- You have to obtain "komerční certifikát PostSignum".
|
17
|
+
|
18
|
+
Instructions (in czech) are in [`documents/Postup_pro_zavedení_API_služeb_České_pošty.docx`](./documents/Postup_pro_zavedení_API_služeb_České_pošty.docx)
|
19
|
+
|
20
|
+
### 2) Preparations on PodaniOnline app
|
21
|
+
1) Sign in to [PostaOnline](https://www.postaonline.cz/rap/prihlaseni)
|
22
|
+
2) Go to ["Podání Online"](https://www.postaonline.cz/klientskazona?p_p_id=clientzone_WAR_clientZoneportlet&p_p_lifecycle=0&_clientzone_WAR_clientZoneportlet_action=showPol&_clientzone_WAR_clientZoneportlet_implicitModel=true)
|
23
|
+
3) When You are in, select tab **Nastavení** and menu **Podací místa**
|
24
|
+
4) Add _Podací místo_ and write down it's ID (will be used in `sending_post_office_location_number`)
|
25
|
+
5) Switch tab to **Zásilky** and go to menu **Zásilky => Přednastavení údajů**
|
26
|
+
6) Write down value(s) in _Výběr technologického čísla_ (it will be used as `customer_id`).
|
27
|
+
|
28
|
+
|
29
|
+
### 3) Gem installation
|
30
|
+
Add this line to your application's Gemfile:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
gem 'czech_post_b2b_client'
|
34
|
+
```
|
35
|
+
|
36
|
+
And then execute:
|
37
|
+
|
38
|
+
$ bundle
|
39
|
+
|
40
|
+
Or install it yourself as:
|
41
|
+
|
42
|
+
$ gem install czech_post_b2b_client
|
43
|
+
|
44
|
+
### 4) Setting up gem
|
45
|
+
Set up your `contract_id`, `customer_id` (both from CP signed contract), `certificate_path`, `private_key_path` and `private_key_password` in configuration:
|
46
|
+
```
|
47
|
+
CzechPostB2bClient.configure do |config|
|
48
|
+
config.contract_id = 'contract_id'
|
49
|
+
config.customer_id = 'customer_id'
|
50
|
+
config.certificate_path = 'full_path/to/your/postsignum_certificate.pem'
|
51
|
+
config.private_key_path = 'full_path/to/your/postsignum_private.key'
|
52
|
+
config.private_key_password = 'your_password or nil'
|
53
|
+
|
54
|
+
# this actually do not work, I have to use `sending_post_office_location_number`. But it is REQUIRED!
|
55
|
+
config.sending_post_office_code = 12_345 # PSC of post office where parcels will be physically delivered and submitted
|
56
|
+
|
57
|
+
# and You can override defaults
|
58
|
+
# config.sending_post_office_location_number => 1
|
59
|
+
# config.namespaces #XML namespaces
|
60
|
+
# config.language => :cs # other languages are not supported now
|
61
|
+
# config.logger => ::Rails.logger or ::Logger.new(STDOUT),
|
62
|
+
# config.b2b_api_base_uri => 'https://b2b.postaonline.cz/services/POLService/v1'
|
63
|
+
end
|
64
|
+
```
|
65
|
+
|
66
|
+
- `contract_id` is _"ID CČK"_ (can be found in contract; eg.: _"2511327004"_)
|
67
|
+
- `customer_id` is _"Technologické číslo"_ (can be found in contract; eg.: _"U123"_ or _"L03022"_; also is visible at [PodaníOnline](https://www.postaonline.cz/podanionline/PrednastaveniUdajuZasilky.action)
|
68
|
+
|
69
|
+
Because PostSignum Certificate Authority is not trusted by default, correct certificate chain is in `certs/` folder. If You have problem with them, create a issue here. Maybe they are outdated now.
|
70
|
+
|
71
|
+
## Usage
|
72
|
+
**You have to know which parcel type (according to CP) you sending!** Eg. 'BA' or 'RR'. See [`documents/parcel_types.md`](./documents/parcel_types.md).
|
73
|
+
|
74
|
+
**And what services You will use for each parcel**, see [`documents/services_list.md`](./documents/services_list.md) and [`documents/parcels_type_and_services_restrictions.md`](./documents/parcels_type_and_services_restrictions.md).
|
75
|
+
|
76
|
+
Hashes used is service calls bellow:
|
77
|
+
```
|
78
|
+
short_sender_data = { address: {
|
79
|
+
company_name: 'Oriflame',
|
80
|
+
addition_to_name: 'perfume', # optional
|
81
|
+
street: 'V olšinách',
|
82
|
+
house_number: '16',
|
83
|
+
city_part: 'Strašnice',
|
84
|
+
city: 'Praha',
|
85
|
+
post_code: 10_000,
|
86
|
+
},
|
87
|
+
mobile_phone: '+420777888999',
|
88
|
+
email: 'rehor.jan@cpost.cz' }
|
89
|
+
sending_data = { contract_id: configuration.contract_id,
|
90
|
+
parcels_sending_date: Date.today,
|
91
|
+
sending_post_office_location_number: 1,
|
92
|
+
sender: short_sender_data,
|
93
|
+
cash_on_delivery: {
|
94
|
+
address: short_sender_data[:address]
|
95
|
+
bank_account: '123456-1234567890/1234'
|
96
|
+
} }
|
97
|
+
|
98
|
+
short_addressee_data = { address: {
|
99
|
+
first_name: 'Petr',
|
100
|
+
last_name: 'Foton',
|
101
|
+
street: 'Fischerova',
|
102
|
+
house_number: '686',
|
103
|
+
sequence_number: '32',
|
104
|
+
city_part: 'Nové Sady',
|
105
|
+
city: 'Olomouc',
|
106
|
+
post_code: 77_900
|
107
|
+
},
|
108
|
+
email: 'foton@github.com',
|
109
|
+
mobile_phone: '+420777888999' }
|
110
|
+
|
111
|
+
parcels = [
|
112
|
+
{
|
113
|
+
addressee: short_addressee_data,
|
114
|
+
params: { parcel_id: 'package_1of2',
|
115
|
+
parcel_code_prefix: 'BA',
|
116
|
+
weight_in_kg: 1.0,
|
117
|
+
parcel_order: 1,
|
118
|
+
parcels_count: 2 },
|
119
|
+
services: [70, 7, 'S']
|
120
|
+
},
|
121
|
+
{
|
122
|
+
addressee: short_addressee_data,
|
123
|
+
params: { parcel_id: 'package_2of2',
|
124
|
+
parcel_code_prefix: 'BA',
|
125
|
+
weight_in_kg: 1.6,
|
126
|
+
parcel_order: 2,
|
127
|
+
parcels_count: 2 },
|
128
|
+
services: [70,'S']
|
129
|
+
},
|
130
|
+
{
|
131
|
+
addressee: short_addressee_data,
|
132
|
+
params: { parcel_id: 'package_3',
|
133
|
+
parcel_code_prefix: 'BA',
|
134
|
+
weight_in_kg: 1.9 },
|
135
|
+
services: [7,'M']
|
136
|
+
}
|
137
|
+
]
|
138
|
+
```
|
139
|
+
|
140
|
+
|
141
|
+
1) Pack your parcel(s)
|
142
|
+
|
143
|
+
2) Call `ParcelsSender`, this will store in `result` `transmission_id` and expected time to ask for results.
|
144
|
+
```
|
145
|
+
psender = ParcelsSender.call(sending_data: sending_data, parcels: parcels)
|
146
|
+
|
147
|
+
if psender.success?
|
148
|
+
result = psender.result
|
149
|
+
processing_end_time_utc = (result.processing_end_expected_at - (60 *60)).utc # API returns time in CET but marked as UTC
|
150
|
+
transaction_id = result.transaction_id
|
151
|
+
else
|
152
|
+
puts psender.errors.full_messages
|
153
|
+
end
|
154
|
+
```
|
155
|
+
For now, `parcels` is array of complicated hashes; each parcel must have `parcel_id` key (your ID of parcel).
|
156
|
+
|
157
|
+
3) When such expected time pass, ask for results by calling `ParcelsSendProcessUpdater`.
|
158
|
+
|
159
|
+
You can get error `Processing is not yet finished` or hash based on `parcel_id` keys.
|
160
|
+
Eg. :
|
161
|
+
```
|
162
|
+
pudater = ParcelsSendProcessUpdater.call(transmission_id: transmission_id)
|
163
|
+
|
164
|
+
if pupdater.success?
|
165
|
+
update_my_parcels_with(pupdater.result) # => { 'parcel_1of2' => { parcel_code: 'BA12354678', states: [{ code: 1, text: 'OK' }]},
|
166
|
+
# 'parcel_2of2' => { parcel_code: 'BA12354679', states: [{ code: 1, text: 'OK' }]},
|
167
|
+
# 'parcel_3' => { parcel_code: 'BA12354680', states: [{ code: 1, text: 'OK' }]}
|
168
|
+
else
|
169
|
+
puts psender.errors.full_messages # => "response_state: ResponseCode[19 BATCH_INVALID] V dávce se vyskytují chybné záznamy"
|
170
|
+
# "parcels: Parcel[parcel_2of2] => ResponseCode[104 INVALID_WEIGHT] Hmotnost mimo povolený rozsah"
|
171
|
+
# "parcels: Parcel[parcel_2of2] => ResponseCode[261 MISSING_SIZE_CATEGORY] Neuvedena rozměrová kategorie zásilky"
|
172
|
+
# "parcels: Parcel[parcel_3] => ResponseCode[310 INVALID_PREFIX] Neplatný typ zásilky"
|
173
|
+
end
|
174
|
+
```
|
175
|
+
`parcel_code` is CzechPost ID of parcel and is used in following calls.
|
176
|
+
|
177
|
+
4) Print address sheets of parcels(s) by calling `AddressSheetsGenerator`.
|
178
|
+
See [template_classes](./lib/czech_post_b2b_client/printing_templates.rb) for available templates.
|
179
|
+
Eg. :
|
180
|
+
```
|
181
|
+
parcel_codes = %w[RA123456789 RR123456789F RR123456789G] # beware of parcel_id!
|
182
|
+
options = {
|
183
|
+
customer_id: configuration.customer_id, # required
|
184
|
+
contract_number: configuration.contract_id, # not required
|
185
|
+
template_id: 24, # 'obalka 3 - B4' #
|
186
|
+
margin_in_mm: { top: 5, left: 3 } # required
|
187
|
+
}
|
188
|
+
|
189
|
+
adrprinter = AddressSheetsGenerator.call(parcel_codes: parcel_codes, options: options )
|
190
|
+
|
191
|
+
if adrprinter.success?
|
192
|
+
File.write("adrsheet.pdf", adrprinter.result.pdf_content)
|
193
|
+
else
|
194
|
+
puts(adrprinter.errors.full_messages)
|
195
|
+
end
|
196
|
+
```
|
197
|
+
|
198
|
+
5) Repeat steps 1-4 until You decide to deliver packages to post office.
|
199
|
+
|
200
|
+
6) Close your parcels submission with call `ParcelsSubmissionCloser.call(sending_data: sender_data)`.
|
201
|
+
|
202
|
+
7) _They will await You at post office with warm welcome (hopefully). Parcels which are not delivered within 60 days are removed from CzechPost systems for free :-)_
|
203
|
+
|
204
|
+
8) You can check current status of delivering with `DeliveringInspector`, which will return hash based on `parcel_code` keys.
|
205
|
+
Eg. :
|
206
|
+
```
|
207
|
+
delivery_boy = DeliveringInspector.call(parcel_codes: parcel_codes)
|
208
|
+
|
209
|
+
if delivery_boy.success?
|
210
|
+
update_my_parcels_delivery_status_with(delivery_boy.result)
|
211
|
+
# result is like:
|
212
|
+
# { 'RA12345687' => { current_state: { id: '91',
|
213
|
+
date: Date.parse('2015-09-04'),
|
214
|
+
text: 'Dodání zásilky.',
|
215
|
+
post_code: '25756',
|
216
|
+
post_name: 'Neveklov'},
|
217
|
+
deposited_until: Date.new(2015, 9, 2),
|
218
|
+
deposited_for_days: 15,
|
219
|
+
all_states: [
|
220
|
+
{ id: '21', date: Date.parse('2015-09-02'), text: 'Podání zásilky.', post_code: '26701', post_name: 'Králův Dvůr u Berouna' },
|
221
|
+
{ id: '-F', date: Date.parse('2015-09-03'), text: 'Vstup zásilky na SPU.', post_code: '22200', post_name: 'SPU Praha 022' },
|
222
|
+
{ id: '-I', date: Date.parse('2015-09-03'), text: 'Výstup zásilky z SPU.', post_code: '22200', post_name: 'SPU Praha 022' },
|
223
|
+
{ id: '-B', date: Date.parse('2015-09-03'), text: 'Přeprava zásilky k dodací poště.', post_code: nil, post_name: nil },
|
224
|
+
{ id: '51', date: Date.parse('2015-09-04'), text: 'Příprava zásilky k doručení.', post_code: '25607', post_name: 'Depo Benešov 70' },
|
225
|
+
{ id: '53', date: Date.parse('2015-09-04'), text: 'Doručování zásilky.', post_code: '25756', post_name: 'Neveklov' },
|
226
|
+
{ id: '91', date: Date.parse('2015-09-04'), text: 'Dodání zásilky.', post_code: '25756', post_name: 'Neveklov' }
|
227
|
+
]},
|
228
|
+
'BA56487125' => {...}
|
229
|
+
}
|
230
|
+
else
|
231
|
+
puts(delivery_boy.errors.full_messages)
|
232
|
+
end
|
233
|
+
```
|
234
|
+
|
235
|
+
9) And You can always ask for statistics!
|
236
|
+
```
|
237
|
+
tps = TimePeriodStatisticator.call(from_date: Date.today - 5, to_date: Date.today)
|
238
|
+
if tps.success?
|
239
|
+
result = tps.result
|
240
|
+
result.requests.total # => 26,
|
241
|
+
result.requests.with_errors # => 16
|
242
|
+
result.requests.successful # => 10
|
243
|
+
result.imported_parcels # => 3
|
244
|
+
else
|
245
|
+
puts(tps.errors.full_messages)
|
246
|
+
end
|
247
|
+
```
|
248
|
+
|
249
|
+
### Example usage
|
250
|
+
|
251
|
+
See `test/integration_test.rb` for almost production usage. HTTP calls to B2B services are blocked and responses from them are stubbed.
|
252
|
+
|
253
|
+
You can quickly check you setup by altering config and run `ruby try_api_calls.rb` see [`try_api_calls.rb`](./examples/try_api_calls.rb).
|
254
|
+
|
255
|
+
## Troubleshooting
|
256
|
+
|
257
|
+
1) Read all stuff in [`./documents`](./documents/) and [Yard docs](./doc/index.html), maybe it helps.
|
258
|
+
2) If You get "handshake protocol failed" You do not have correct setup for certificates. If You get any xml response (see logger in debug mode) certificates are ok.
|
259
|
+
You can always try `TimePeriodStatisticator` for that check, it do not need any "before" actions.
|
260
|
+
3) Error `UNAUTHORIZED_ROLE_ACCESS` means wrong `customer_id` or You are not yet registered in "PodáníOnline"
|
261
|
+
4) Error `11: INVALID_LOCATION` was occuring when only `sending_post_office_code` was used. Try to use `sending_post_office_location_number`.
|
262
|
+
5) And last tip `261 MISSING_SIZE_CATEGORY` -> add correct "size service" to services (eg: 'S', 'M')
|
263
|
+
6) Compare resulting request XML with examples in `test/request_builders`
|
264
|
+
|
265
|
+
## Development
|
266
|
+
|
267
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
268
|
+
|
269
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `lib/czech_post_b2b_client/version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
270
|
+
|
271
|
+
## Contributing
|
272
|
+
|
273
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/czech_post_b2b_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
274
|
+
|
275
|
+
## License
|
276
|
+
|
277
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
278
|
+
|
279
|
+
## Code of Conduct
|
280
|
+
|
281
|
+
Everyone interacting in the CzechPostB2bClient project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/czech_post_b2b_client/blob/master/CODE_OF_CONDUCT.md).
|