From f7f6c655b734aee8d47bc44dbd3967aa09bc68bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20W=C4=99drychowski?= Date: Wed, 10 Aug 2022 11:40:55 +0200 Subject: [PATCH] MOB-4219 release 1.6.3 (MASTER) (#158) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * Release 1.5.1 (#106) * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 * changed readme (#108) * MOB-3445 change AuthToken init access level from internal to public (#109) * MOB-3488 Release 1.5.2 (develop) (#110) * Release 1.5.2 * Update marketting project version * MOB-3405 fix coding key for fleet capabilties (#112) Co-authored-by: Anca Feurdean * fix refresh token call headers (#114) * MOB-3528: Release 1.5.3 (develop) (#115) * Release 1.5.3 * test circleci * undo circleci test * Add new error codes (#117) * Add loyalty nonce to booking api (#118) * Modify LoyaltyProgramme to be an Object vs an Array (#120) * Mob xxxx circleci fix (#124) * Update config.yml * Update config.yml * Revert * Avoid deleting the SSH private key * use separate commends * use xlarge resource * use cache for bundle * update xcode version to 12.2.0 * a bit cleanup * revert back to working version * update bundler version * use large resource * use xlarge resource * update xcode version, decrease resource_class to medium to fit our price plan * revert Xcode to 12.0, revert resource_class to xlarge, and change bundler version to 2.2.7 - working UISDK config * try solution proposed by Mikolaj * going back to xcode 12.2 and large resource_class * using medium resource_class * update fastlane * update fastlane take 2 * circleci sanity check * test removing ssh key * reverting last commit * adjust bundler version * test circleci * update to xcode 13 * update fastlane * remove fastline update, run bundle install before installing specific gem * Use xcode 12.5.1 * Minor change Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Diana Petrea * [MOB-3633] Add Loyalty API (#119) * Add endpoints * LoyaltyStatus API Added * Add LoyaltyPoints model * Fix up the API endpoints * LoyaltyStatus Interactor * Edit APIEndpoint again * Update LoyaltyService * LoyaltyBurn interactor * Loyaltyearn Interactor * Update LoyaltyService * PreAuth interactor * Update service * Add mocks * Preauth mock * Add tests * Add remaining tests * Update PreAuth interactor * Remove Integration Tests (Not ready) * Fix loyaltyservice for preauth * Fix tests * Make requested changes to LoyaltyPreAuth * points to burnPoints * Guard currency * Fix broken test * Add new status test to make sure request is setup correctly * Fix loyaltyStatus? * cicleci test commit * test circleci commit * Add errors * Mob 3656 (#123) * get and persist loyalty status after payment provider response * minor change * add get current status method to loyalty service * refresh current loyalty status * add unit tests * Fix for paymemt provider model * resolve PR comments Co-authored-by: Mostafa Hadian Co-authored-by: Diana Petrea Co-authored-by: Mostafa Hadian Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> * Mob 3650 (#125) * update loyalty nonce model * fix unit test * fix loyalty preauth interactor * redo execute implementation in loyalty preauth interactor * Mob 3785 (#126) * add slug to KarhooError * use slug, add new error type * add new errot type * bump version (#127) * MOB-3819 add shopper locale to adyen payment request (#129) * add shopper locale to adyen payment request * add minor tweak * Feature/MOB-3883 add basic analytics events to track the conversion steps (#130) * New event names added according to requirements in https://karhoo.atlassian.net/browse/MOB-3868 * cleanup * cleanup * Renaming * bump version (#131) * change vehicle class to vehicle type in quote categories (#134) * change vehicle class to vehicle type in quote categories * fix tests * Feature/4021 add client key endpoint (#137) * add Adyen client key call * Mob 4024 post release 1.6 [DEVELOP] (#141) * [MOB-3216] Update master (#97) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> * MOB-3387 Final release 1.5.0 (#102) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> * Post release 1 5 1 (#107) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> * MOB-3488 Post release 1.5.2 (master) (#111) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * Release 1.5.1 (#106) * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 * changed readme (#108) * MOB-3445 change AuthToken init access level from internal to public (#109) * Release 1.5.2 * Update marketting project version Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> * MOB-3528: Post Release 1.5.3 (master) (#116) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * Release 1.5.1 (#106) * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 * changed readme (#108) * MOB-3445 change AuthToken init access level from internal to public (#109) * MOB-3488 Release 1.5.2 (develop) (#110) * Release 1.5.2 * Update marketting project version * MOB-3405 fix coding key for fleet capabilties (#112) Co-authored-by: Anca Feurdean * fix refresh token call headers (#114) * Release 1.5.3 * test circleci fix * undo circleci test Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: ancafeurdean09 <30659315+ancafeurdean09@users.noreply.github.com> * Mob-3749_post_release_1_5_4 (#128) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * Release 1.5.1 (#106) * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 * changed readme (#108) * MOB-3445 change AuthToken init access level from internal to public (#109) * MOB-3488 Release 1.5.2 (develop) (#110) * Release 1.5.2 * Update marketting project version * MOB-3405 fix coding key for fleet capabilties (#112) Co-authored-by: Anca Feurdean * fix refresh token call headers (#114) * MOB-3528: Release 1.5.3 (develop) (#115) * Release 1.5.3 * test circleci * undo circleci test * Add new error codes (#117) * Add loyalty nonce to booking api (#118) * Modify LoyaltyProgramme to be an Object vs an Array (#120) * Mob xxxx circleci fix (#124) * Update config.yml * Update config.yml * Revert * Avoid deleting the SSH private key * use separate commends * use xlarge resource * use cache for bundle * update xcode version to 12.2.0 * a bit cleanup * revert back to working version * update bundler version * use large resource * use xlarge resource * update xcode version, decrease resource_class to medium to fit our price plan * revert Xcode to 12.0, revert resource_class to xlarge, and change bundler version to 2.2.7 - working UISDK config * try solution proposed by Mikolaj * going back to xcode 12.2 and large resource_class * using medium resource_class * update fastlane * update fastlane take 2 * circleci sanity check * test removing ssh key * reverting last commit * adjust bundler version * test circleci * update to xcode 13 * update fastlane * remove fastline update, run bundle install before installing specific gem * Use xcode 12.5.1 * Minor change Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Diana Petrea * [MOB-3633] Add Loyalty API (#119) * Add endpoints * LoyaltyStatus API Added * Add LoyaltyPoints model * Fix up the API endpoints * LoyaltyStatus Interactor * Edit APIEndpoint again * Update LoyaltyService * LoyaltyBurn interactor * Loyaltyearn Interactor * Update LoyaltyService * PreAuth interactor * Update service * Add mocks * Preauth mock * Add tests * Add remaining tests * Update PreAuth interactor * Remove Integration Tests (Not ready) * Fix loyaltyservice for preauth * Fix tests * Make requested changes to LoyaltyPreAuth * points to burnPoints * Guard currency * Fix broken test * Add new status test to make sure request is setup correctly * Fix loyaltyStatus? * cicleci test commit * test circleci commit * Add errors * Mob 3656 (#123) * get and persist loyalty status after payment provider response * minor change * add get current status method to loyalty service * refresh current loyalty status * add unit tests * Fix for paymemt provider model * resolve PR comments Co-authored-by: Mostafa Hadian Co-authored-by: Diana Petrea Co-authored-by: Mostafa Hadian Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> * Mob 3650 (#125) * update loyalty nonce model * fix unit test * fix loyalty preauth interactor * redo execute implementation in loyalty preauth interactor * Mob 3785 (#126) * add slug to KarhooError * use slug, add new error type * add new errot type * bump version Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: ancafeurdean09 <30659315+ancafeurdean09@users.noreply.github.com> Co-authored-by: Anca Feurdean * Mob 3893 post release 1 5 5 [MASTER] (#132) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * Release 1.5.1 (#106) * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 * changed readme (#108) * MOB-3445 change AuthToken init access level from internal to public (#109) * MOB-3488 Release 1.5.2 (develop) (#110) * Release 1.5.2 * Update marketting project version * MOB-3405 fix coding key for fleet capabilties (#112) Co-authored-by: Anca Feurdean * fix refresh token call headers (#114) * MOB-3528: Release 1.5.3 (develop) (#115) * Release 1.5.3 * test circleci * undo circleci test * Add new error codes (#117) * Add loyalty nonce to booking api (#118) * Modify LoyaltyProgramme to be an Object vs an Array (#120) * Mob xxxx circleci fix (#124) * Update config.yml * Update config.yml * Revert * Avoid deleting the SSH private key * use separate commends * use xlarge resource * use cache for bundle * update xcode version to 12.2.0 * a bit cleanup * revert back to working version * update bundler version * use large resource * use xlarge resource * update xcode version, decrease resource_class to medium to fit our price plan * revert Xcode to 12.0, revert resource_class to xlarge, and change bundler version to 2.2.7 - working UISDK config * try solution proposed by Mikolaj * going back to xcode 12.2 and large resource_class * using medium resource_class * update fastlane * update fastlane take 2 * circleci sanity check * test removing ssh key * reverting last commit * adjust bundler version * test circleci * update to xcode 13 * update fastlane * remove fastline update, run bundle install before installing specific gem * Use xcode 12.5.1 * Minor change Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Diana Petrea * [MOB-3633] Add Loyalty API (#119) * Add endpoints * LoyaltyStatus API Added * Add LoyaltyPoints model * Fix up the API endpoints * LoyaltyStatus Interactor * Edit APIEndpoint again * Update LoyaltyService * LoyaltyBurn interactor * Loyaltyearn Interactor * Update LoyaltyService * PreAuth interactor * Update service * Add mocks * Preauth mock * Add tests * Add remaining tests * Update PreAuth interactor * Remove Integration Tests (Not ready) * Fix loyaltyservice for preauth * Fix tests * Make requested changes to LoyaltyPreAuth * points to burnPoints * Guard currency * Fix broken test * Add new status test to make sure request is setup correctly * Fix loyaltyStatus? * cicleci test commit * test circleci commit * Add errors * Mob 3656 (#123) * get and persist loyalty status after payment provider response * minor change * add get current status method to loyalty service * refresh current loyalty status * add unit tests * Fix for paymemt provider model * resolve PR comments Co-authored-by: Mostafa Hadian Co-authored-by: Diana Petrea Co-authored-by: Mostafa Hadian Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> * Mob 3650 (#125) * update loyalty nonce model * fix unit test * fix loyalty preauth interactor * redo execute implementation in loyalty preauth interactor * Mob 3785 (#126) * add slug to KarhooError * use slug, add new error type * add new errot type * bump version (#127) * MOB-3819 add shopper locale to adyen payment request (#129) * add shopper locale to adyen payment request * add minor tweak * Feature/MOB-3883 add basic analytics events to track the conversion steps (#130) * New event names added according to requirements in https://karhoo.atlassian.net/browse/MOB-3868 * cleanup * cleanup * Renaming * bump version Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: ancafeurdean09 <30659315+ancafeurdean09@users.noreply.github.com> Co-authored-by: Anca Feurdean Co-authored-by: Aleksander Wędrychowski <97090287+AleksanderWedrychowskiKarhoo@users.noreply.github.com> * Feature/MOB-4020 update network sdk to support versioning of payment related calls (#136) * Add `version` parameter to PaymentProvider model * Payment API Version added to payments interactors and endpints * force v68 api version for debug * Payment version added to path if differs from v51 * version path component fix * version string calculation improved * Test v68 version * update tests * version bump 1.5.5 => 1.5.6 * Change version number * MOB-4021 cherry pick * version bump 1.6.0 * version bump in Podspec Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> Co-authored-by: ancafeurdean09 <30659315+ancafeurdean09@users.noreply.github.com> Co-authored-by: Anca Feurdean Co-authored-by: Aleksander Wędrychowski <97090287+AleksanderWedrychowskiKarhoo@users.noreply.github.com> Co-authored-by: Aleksander Wędrychowski * MOB-4020 post release 1.6.1 [develop] (#144) * [MOB-3216] Update master (#97) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> * MOB-3387 Final release 1.5.0 (#102) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> * Post release 1 5 1 (#107) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> * MOB-3488 Post release 1.5.2 (master) (#111) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * Release 1.5.1 (#106) * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 * changed readme (#108) * MOB-3445 change AuthToken init access level from internal to public (#109) * Release 1.5.2 * Update marketting project version Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> * MOB-3528: Post Release 1.5.3 (master) (#116) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * Release 1.5.1 (#106) * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 * changed readme (#108) * MOB-3445 change AuthToken init access level from internal to public (#109) * MOB-3488 Release 1.5.2 (develop) (#110) * Release 1.5.2 * Update marketting project version * MOB-3405 fix coding key for fleet capabilties (#112) Co-authored-by: Anca Feurdean * fix refresh token call headers (#114) * Release 1.5.3 * test circleci fix * undo circleci test Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: ancafeurdean09 <30659315+ancafeurdean09@users.noreply.github.com> * Mob-3749_post_release_1_5_4 (#128) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * Release 1.5.1 (#106) * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 * changed readme (#108) * MOB-3445 change AuthToken init access level from internal to public (#109) * MOB-3488 Release 1.5.2 (develop) (#110) * Release 1.5.2 * Update marketting project version * MOB-3405 fix coding key for fleet capabilties (#112) Co-authored-by: Anca Feurdean * fix refresh token call headers (#114) * MOB-3528: Release 1.5.3 (develop) (#115) * Release 1.5.3 * test circleci * undo circleci test * Add new error codes (#117) * Add loyalty nonce to booking api (#118) * Modify LoyaltyProgramme to be an Object vs an Array (#120) * Mob xxxx circleci fix (#124) * Update config.yml * Update config.yml * Revert * Avoid deleting the SSH private key * use separate commends * use xlarge resource * use cache for bundle * update xcode version to 12.2.0 * a bit cleanup * revert back to working version * update bundler version * use large resource * use xlarge resource * update xcode version, decrease resource_class to medium to fit our price plan * revert Xcode to 12.0, revert resource_class to xlarge, and change bundler version to 2.2.7 - working UISDK config * try solution proposed by Mikolaj * going back to xcode 12.2 and large resource_class * using medium resource_class * update fastlane * update fastlane take 2 * circleci sanity check * test removing ssh key * reverting last commit * adjust bundler version * test circleci * update to xcode 13 * update fastlane * remove fastline update, run bundle install before installing specific gem * Use xcode 12.5.1 * Minor change Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Diana Petrea * [MOB-3633] Add Loyalty API (#119) * Add endpoints * LoyaltyStatus API Added * Add LoyaltyPoints model * Fix up the API endpoints * LoyaltyStatus Interactor * Edit APIEndpoint again * Update LoyaltyService * LoyaltyBurn interactor * Loyaltyearn Interactor * Update LoyaltyService * PreAuth interactor * Update service * Add mocks * Preauth mock * Add tests * Add remaining tests * Update PreAuth interactor * Remove Integration Tests (Not ready) * Fix loyaltyservice for preauth * Fix tests * Make requested changes to LoyaltyPreAuth * points to burnPoints * Guard currency * Fix broken test * Add new status test to make sure request is setup correctly * Fix loyaltyStatus? * cicleci test commit * test circleci commit * Add errors * Mob 3656 (#123) * get and persist loyalty status after payment provider response * minor change * add get current status method to loyalty service * refresh current loyalty status * add unit tests * Fix for paymemt provider model * resolve PR comments Co-authored-by: Mostafa Hadian Co-authored-by: Diana Petrea Co-authored-by: Mostafa Hadian Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> * Mob 3650 (#125) * update loyalty nonce model * fix unit test * fix loyalty preauth interactor * redo execute implementation in loyalty preauth interactor * Mob 3785 (#126) * add slug to KarhooError * use slug, add new error type * add new errot type * bump version Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: ancafeurdean09 <30659315+ancafeurdean09@users.noreply.github.com> Co-authored-by: Anca Feurdean * Mob 3893 post release 1 5 5 [MASTER] (#132) * [MOB-2976] Quote model update for Polling (#80) * Update quote models * Update tests * Update cart file (#81) * Call follow endpoint for guest checkout booking fee retrieval (#83) * [MOB-3176] Cancellation SLA to booking (#84) * New models * Update tripinfo object * Update JSON * Remove package.resolved file * Update tests * Ignore this (#85) * {MOB-3181] Quotes cancellation SLA (#86) * Update quote model * Update tests * MOB-3144 - Add decimal formatting to CancellationFeePrice (#87) * Add decimal formatting to CancellationFeePrice * Update to use global const * Remove URL suffix (#88) * Add BrowserInfo to Adyen DropIn Payload (#89) * Bump nokogiri from 1.10.7 to 1.11.1 (#76) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.11.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.11.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * MOB-3205 Add SupplyPartnerID to the AdyenPayments request (#90) * Add SupplyPartnerId field to the payments API * Update tests and add supplyPartnerId * Add Fleet model to be used in Quote model (#91) * Make service cancellation type an enum (#92) * Make service cancellation type an enum * Retain other service cancellation type values. * Bump kramdown from 2.3.0 to 2.3.1 (#93) Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use the Keychain to store user credentials. (#94) * Add fastlane update command (#95) * Add fastlane update command * Add fastlane update as a separate command * Update Gemfile.lock * [MOB-3216] Release 1.4.0 (#96) * Bump version * Update pod spec (Need this to be published) * Bump nokogiri from 1.11.2 to 1.11.5 (#98) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use date data type for dateBooked (#99) * Bump version number to 1.5.0 (#100) * [MOB-3438] login with credentials (#104) * Make first small changes to auth service. * Create auth credentials swift files and update authservice * Init auth credentials interactor * Credentials finally works as public * Almost finished * Swap credentials with authToken * Finish interactor + rename token interactor * Remove requestsender * Test pass * Release 1.5.1 (#106) * versiob bump to 1_5_1-rc1 * updated version to 1_5_1 * changed readme (#108) * MOB-3445 change AuthToken init access level from internal to public (#109) * MOB-3488 Release 1.5.2 (develop) (#110) * Release 1.5.2 * Update marketting project version * MOB-3405 fix coding key for fleet capabilties (#112) Co-authored-by: Anca Feurdean * fix refresh token call headers (#114) * MOB-3528: Release 1.5.3 (develop) (#115) * Release 1.5.3 * test circleci * undo circleci test * Add new error codes (#117) * Add loyalty nonce to booking api (#118) * Modify LoyaltyProgramme to be an Object vs an Array (#120) * Mob xxxx circleci fix (#124) * Update config.yml * Update config.yml * Revert * Avoid deleting the SSH private key * use separate commends * use xlarge resource * use cache for bundle * update xcode version to 12.2.0 * a bit cleanup * revert back to working version * update bundler version * use large resource * use xlarge resource * update xcode version, decrease resource_class to medium to fit our price plan * revert Xcode to 12.0, revert resource_class to xlarge, and change bundler version to 2.2.7 - working UISDK config * try solution proposed by Mikolaj * going back to xcode 12.2 and large resource_class * using medium resource_class * update fastlane * update fastlane take 2 * circleci sanity check * test removing ssh key * reverting last commit * adjust bundler version * test circleci * update to xcode 13 * update fastlane * remove fastline update, run bundle install before installing specific gem * Use xcode 12.5.1 * Minor change Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Diana Petrea * [MOB-3633] Add Loyalty API (#119) * Add endpoints * LoyaltyStatus API Added * Add LoyaltyPoints model * Fix up the API endpoints * LoyaltyStatus Interactor * Edit APIEndpoint again * Update LoyaltyService * LoyaltyBurn interactor * Loyaltyearn Interactor * Update LoyaltyService * PreAuth interactor * Update service * Add mocks * Preauth mock * Add tests * Add remaining tests * Update PreAuth interactor * Remove Integration Tests (Not ready) * Fix loyaltyservice for preauth * Fix tests * Make requested changes to LoyaltyPreAuth * points to burnPoints * Guard currency * Fix broken test * Add new status test to make sure request is setup correctly * Fix loyaltyStatus? * cicleci test commit * test circleci commit * Add errors * Mob 3656 (#123) * get and persist loyalty status after payment provider response * minor change * add get current status method to loyalty service * refresh current loyalty status * add unit tests * Fix for paymemt provider model * resolve PR comments Co-authored-by: Mostafa Hadian Co-authored-by: Diana Petrea Co-authored-by: Mostafa Hadian Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> * Mob 3650 (#125) * update loyalty nonce model * fix unit test * fix loyalty preauth interactor * redo execute implementation in loyalty preauth interactor * Mob 3785 (#126) * add slug to KarhooError * use slug, add new error type * add new errot type * bump version (#127) * MOB-3819 add shopper locale to adyen payment request (#129) * add shopper locale to adyen payment request * add minor tweak * Feature/MOB-3883 add basic analytics events to track the conversion steps (#130) * New event names added according to requirements in https://karhoo.atlassian.net/browse/MOB-3868 * cleanup * cleanup * Renaming * bump version Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: ancafeurdean09 <30659315+ancafeurdean09@users.noreply.github.com> Co-authored-by: Anca Feurdean Co-authored-by: Aleksander Wędrychowski <97090287+AleksanderWedrychowskiKarhoo@users.noreply.github.com> * Feature/MOB-4020 update network sdk to support versioning of payment related calls (#136) * Add `version` parameter to PaymentProvider model * Payment API Version added to payments interactors and endpints * force v68 api version for debug * Payment version added to path if differs from v51 * version path component fix * version string calculation improved * Test v68 version * update tests * version bump 1.5.5 => 1.5.6 * Change version number * MOB-4021 cherry pick * version bump 1.6.0 * version bump in Podspec * Feature/MOB-4020 update network sdk to support versioning of payment … (#139) * Feature/MOB-4020 update network sdk to support versioning of payment related calls (#136) * Add `version` parameter to PaymentProvider model * Payment API Version added to payments interactors and endpints * force v68 api version for debug * Payment version added to path if differs from v51 * version path component fix * version string calculation improved * Test v68 version * update tests * version bump 1.5.5 => 1.5.6 * Change version number * MOB-4021 cherry pick * version bump 1.6.0 * version bump in Podspec Co-authored-by: Aleksander Wędrychowski Co-authored-by: Bartłomiej Sopala * Feature/MOB-4020 update network sdk to support versioning of payment related calls (#142) * Add `version` parameter to PaymentProvider model * Payment API Version added to payments interactors and endpints * force v68 api version for debug * Payment version added to path if differs from v51 * version path component fix * version string calculation improved * Test v68 version * update tests * version bump 1.5.5 => 1.5.6 * Change version number * MOB-4021 cherry pick * SPM updated * fetching payment provider api version fixed * Unit tests update * SPM update reverted due to CI issue * remove `version` parameter form PaymentProvider model * bumb version 1.6.0 => 1.6.1 * REvert SPM changes Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> Co-authored-by: ancafeurdean09 <30659315+ancafeurdean09@users.noreply.github.com> Co-authored-by: Anca Feurdean Co-authored-by: Bartłomiej Sopala * Bump nokogiri from 1.11.5 to 1.13.4 (#138) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.5 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.5...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump cocoapods-downloader from 1.4.0 to 1.6.3 (#135) Bumps [cocoapods-downloader](https://github.com/CocoaPods/cocoapods-downloader) from 1.4.0 to 1.6.3. - [Release notes](https://github.com/CocoaPods/cocoapods-downloader/releases) - [Changelog](https://github.com/CocoaPods/cocoapods-downloader/blob/master/CHANGELOG.md) - [Commits](https://github.com/CocoaPods/cocoapods-downloader/compare/1.4.0...1.6.3) --- updated-dependencies: - dependency-name: cocoapods-downloader dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feature/mob 4090 make nsdk psp agnostic (#146) * remove braintree psp condition from authentication call * remove if braitree condition * Unit tests updated Co-authored-by: Aleksander Wędrychowski * revert nokogiri version to 1.11.5 (#148) * bump version to 1.6.2 (#149) * Feature/MOB-4198 quote list use vehicle images from be (#155) * VehicleRules configuration fetching * VehivlesRules model updated * temporary set some methods as public so UISDK can debug * Do not add headers to vehicle rules api call * Debug changes reverted * cleanup * remove assert * - VehicleRules -> VehicleImageRules - revert version bump * Small formatting change * Add `isDefault` property to VehicleImageRule model * RuleType enum introduced to VehicleImageRule model * Vehicle image rule type description change * Feature/mob 4160 extract correlation - APPROACH A (#153) * add analytics constants for payment and loyalty * add correlation id to Result * add correlationId in handler * remove enum tuple warnings * update Keys * add missing loyalty key * pr request changes * revert Package.resolved to previous version * update keys * remove unnecessary notes * update user nonce only for Braintree (#154) * update user nonce only for Braintree * Create Payment provider updater * fix tests * fix formatting * pr review updates * try to reset Packge.resolved to previous version * remove default implementation for payment and nonce provider * change way of initialing self.paymentProviderUpdateHandler * add loyaltyPaymerntRequest to paymentProviderUpdateHandler initislizers * Release preparations * Set KarhooPaymentProviderUpdateHandler privacy protection to default * remove not needed spm resolve file * Bumb sdk version for podspec and readme Co-authored-by: EdwardW2 <44901854+EdwardW2@users.noreply.github.com> Co-authored-by: Jo Santa Maria <60882714+jsm20@users.noreply.github.com> Co-authored-by: Mostafa Hadian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cornelkar <61707821+cornelkar@users.noreply.github.com> Co-authored-by: cosminBadulescu Co-authored-by: dianakarh <86302636+dianakarh@users.noreply.github.com> Co-authored-by: ancafeurdean09 <30659315+ancafeurdean09@users.noreply.github.com> Co-authored-by: Anca Feurdean Co-authored-by: Diana Petrea Co-authored-by: Bartłomiej Sopala <97114085+BartlomiejSopalaKarhoo@users.noreply.github.com> Co-authored-by: Bartłomiej Sopala --- .gitignore | 1 + KarhooSDK.podspec | 2 +- KarhooSDK.xcodeproj/project.pbxproj | 42 +++++++++++-- .../xcshareddata/swiftpm/Package.resolved | 34 ----------- .../Api/Response/VehicleImageRules.swift | 51 ++++++++++++++++ KarhooSDK/Api/Util/Result.swift | 36 +++++++++-- KarhooSDK/Network/APIEndpoint.swift | 5 ++ .../RequestSender/KarhooRequestSender.swift | 6 +- .../JsonHttpClient/JsonHttpClient.swift | 53 ++++++++++++----- .../Analytics/AnalyticsConstants.swift | 26 ++++++-- ...ooAuthLoginWithCredentialsInteractor.swift | 50 +++++----------- .../KarhooAuthLoginWithTokenInteractor.swift | 58 +++++++----------- .../KarhooAdyenPaymentMethodsInteractor.swift | 4 +- ...KarhooAdyenPaymentsDetailsInteractor.swift | 4 +- .../KarhooVehicleRulesInteractor.swift | 30 ++++++++++ .../Interactor/VehicleRulesInteractor.swift | 12 ++++ .../Service/Quote/KarhooQuoteService.swift | 15 ++++- KarhooSDK/Service/Quote/QuoteService.swift | 1 + .../KarhooTripUpdateInteractor.swift | 6 +- .../KarhooPaymentProviderUpdateHandler.swift | 59 +++++++++++++++++++ .../KarhooLoginInteractor.swift | 42 ++++--------- .../User/PaymentProviderUpdateHandler.swift | 9 +++ .../KarhooUpdateUserDetailsInteractor.swift | 10 ++-- .../Auth/KarhooAuthLoginInteractorSpec.swift | 20 ++++--- .../KarhooAuthLoginWithCredentialsSpec.swift | 21 +++++-- .../New Group/KarhooLoginInteractorSpec.swift | 21 ++++--- README.md | 4 +- 27 files changed, 414 insertions(+), 208 deletions(-) delete mode 100644 KarhooSDK.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 KarhooSDK/Api/Response/VehicleImageRules.swift create mode 100644 KarhooSDK/Service/Quote/Interactor/KarhooVehicleRulesInteractor.swift create mode 100644 KarhooSDK/Service/Quote/Interactor/VehicleRulesInteractor.swift create mode 100644 KarhooSDK/Service/User/KarhooPaymentProviderUpdateHandler.swift create mode 100644 KarhooSDK/Service/User/PaymentProviderUpdateHandler.swift diff --git a/.gitignore b/.gitignore index 1f1485ae..140fc0f5 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ fastlane/.env # access keys Client/Keys.swift Package.resolved +.idea diff --git a/KarhooSDK.podspec b/KarhooSDK.podspec index 2f7f421c..13f3482c 100644 --- a/KarhooSDK.podspec +++ b/KarhooSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "KarhooSDK" - s.version = "1.6.2" + s.version = "1.6.3" s.summary = "Karhoo Network SDK" s.homepage = "https://developer.karhoo.com/docs/build-apps-using-sdks" s.license = 'BSD 2-Clause' diff --git a/KarhooSDK.xcodeproj/project.pbxproj b/KarhooSDK.xcodeproj/project.pbxproj index 5914f990..c0c204a2 100644 --- a/KarhooSDK.xcodeproj/project.pbxproj +++ b/KarhooSDK.xcodeproj/project.pbxproj @@ -317,6 +317,9 @@ 43F939A41F3C85A300914E18 /* KarhooEnvironmentDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43F9399B1F3C85A300914E18 /* KarhooEnvironmentDetails.swift */; }; 43F939A51F3C85A300914E18 /* URLSessionSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43F9399C1F3C85A300914E18 /* URLSessionSender.swift */; }; 43F939B61F3CD33200914E18 /* JsonHttpRequestBuilderSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43F939B11F3CD33200914E18 /* JsonHttpRequestBuilderSpec.swift */; }; + 517C6CCF2886BF3C00EA164C /* VehicleImageRules.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517C6CCE2886BF3C00EA164C /* VehicleImageRules.swift */; }; + 517C6CD12886BF7500EA164C /* KarhooVehicleRulesInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517C6CD02886BF7500EA164C /* KarhooVehicleRulesInteractor.swift */; }; + 517C6CD32886BF9100EA164C /* VehicleRulesInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517C6CD22886BF9100EA164C /* VehicleRulesInteractor.swift */; }; 51C3FCD727FE137200273BA2 /* AdyenAPIVersionProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C3FCD627FE137200273BA2 /* AdyenAPIVersionProvider.swift */; }; 51C3FCD927FE194C00273BA2 /* KarhooAdyenAPIVersionProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C3FCD827FE194C00273BA2 /* KarhooAdyenAPIVersionProvider.swift */; }; 5C076FFF20F23B5F00A35537 /* CategoryQuoteMapperSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C076FFE20F23B5F00A35537 /* CategoryQuoteMapperSpec.swift */; }; @@ -440,6 +443,9 @@ 6FED7B9225794AAC00E95C27 /* CancellationFee.json in Resources */ = {isa = PBXBuildFile; fileRef = 6FED7B9125794AAC00E95C27 /* CancellationFee.json */; }; 6FED7B9C25794D8A00E95C27 /* CancellationFeeFalse.json in Resources */ = {isa = PBXBuildFile; fileRef = 6FED7B9B25794D8A00E95C27 /* CancellationFeeFalse.json */; }; 6FED7C42257E741000E95C27 /* Luggage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FED7C41257E741000E95C27 /* Luggage.swift */; }; + 7B28E006288688D400F6FDAE /* KarhooPaymentProviderUpdateHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B28E005288688D400F6FDAE /* KarhooPaymentProviderUpdateHandler.swift */; }; + 7B28E008288688E300F6FDAE /* PaymentProviderUpdateHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B28E007288688E300F6FDAE /* PaymentProviderUpdateHandler.swift */; }; + 7B28E00A2886891300F6FDAE /* Keys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B28E0092886891300F6FDAE /* Keys.swift */; }; A10F03D6260CA199005743F4 /* ServiceCancellationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A10F03D5260CA199005743F4 /* ServiceCancellationType.swift */; }; A1F3C05A261B7C44003CE2CD /* MockSecretStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1F3C059261B7C44003CE2CD /* MockSecretStore.swift */; }; A1F3C070261B83AC003CE2CD /* CredentialsStoreKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1F3C06F261B83AC003CE2CD /* CredentialsStoreKeys.swift */; }; @@ -877,6 +883,9 @@ 43F9399C1F3C85A300914E18 /* URLSessionSender.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLSessionSender.swift; sourceTree = ""; }; 43F939B01F3CD33200914E18 /* JsonHttpClientSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JsonHttpClientSpec.swift; sourceTree = ""; }; 43F939B11F3CD33200914E18 /* JsonHttpRequestBuilderSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JsonHttpRequestBuilderSpec.swift; sourceTree = ""; }; + 517C6CCE2886BF3C00EA164C /* VehicleImageRules.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VehicleImageRules.swift; sourceTree = ""; }; + 517C6CD02886BF7500EA164C /* KarhooVehicleRulesInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KarhooVehicleRulesInteractor.swift; sourceTree = ""; }; + 517C6CD22886BF9100EA164C /* VehicleRulesInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VehicleRulesInteractor.swift; sourceTree = ""; }; 51C3FCD627FE137200273BA2 /* AdyenAPIVersionProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdyenAPIVersionProvider.swift; sourceTree = ""; }; 51C3FCD827FE194C00273BA2 /* KarhooAdyenAPIVersionProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KarhooAdyenAPIVersionProvider.swift; sourceTree = ""; }; 5C076FFE20F23B5F00A35537 /* CategoryQuoteMapperSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryQuoteMapperSpec.swift; sourceTree = ""; }; @@ -994,6 +1003,9 @@ 6FED7B9125794AAC00E95C27 /* CancellationFee.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = CancellationFee.json; sourceTree = ""; }; 6FED7B9B25794D8A00E95C27 /* CancellationFeeFalse.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = CancellationFeeFalse.json; sourceTree = ""; }; 6FED7C41257E741000E95C27 /* Luggage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Luggage.swift; sourceTree = ""; }; + 7B28E005288688D400F6FDAE /* KarhooPaymentProviderUpdateHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = KarhooPaymentProviderUpdateHandler.swift; path = KarhooSDK/Service/User/KarhooPaymentProviderUpdateHandler.swift; sourceTree = SOURCE_ROOT; }; + 7B28E007288688E300F6FDAE /* PaymentProviderUpdateHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PaymentProviderUpdateHandler.swift; path = KarhooSDK/Service/User/PaymentProviderUpdateHandler.swift; sourceTree = SOURCE_ROOT; }; + 7B28E0092886891300F6FDAE /* Keys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Keys.swift; sourceTree = ""; }; A10F03D5260CA199005743F4 /* ServiceCancellationType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceCancellationType.swift; sourceTree = ""; }; A1F3C059261B7C44003CE2CD /* MockSecretStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockSecretStore.swift; sourceTree = ""; }; A1F3C06F261B83AC003CE2CD /* CredentialsStoreKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialsStoreKeys.swift; sourceTree = ""; }; @@ -1415,6 +1427,8 @@ 6F69F34A255A7FFD00F8DA05 /* KarhooQuoteCoverageInteractor.swift */, 6F9A9E4325641B0C00B50753 /* VerifyQuoteInteractor.swift */, 6F9A9E4925641BE400B50753 /* KarhooVerifyQuoteInteractor.swift */, + 517C6CD22886BF9100EA164C /* VehicleRulesInteractor.swift */, + 517C6CD02886BF7500EA164C /* KarhooVehicleRulesInteractor.swift */, ); path = Interactor; sourceTree = ""; @@ -1460,6 +1474,7 @@ 09A9B2982405901B00823FB0 /* LaunchScreen.storyboard */, 09A9B29B2405901B00823FB0 /* Info.plist */, 5D480EA12F7236874F815CF5 /* Keys.swift */, + 7B28E0092886891300F6FDAE /* Keys.swift */, ); path = Client; sourceTree = ""; @@ -1568,6 +1583,7 @@ 095A03C12333AF98007D805E /* UIConfig.swift */, 27421AB287B1A33F00AC4119 /* UserInfo.swift */, 313DC2DC20221D0100D9DD1B /* Vehicle.swift */, + 517C6CCE2886BF3C00EA164C /* VehicleImageRules.swift */, 5CDD26D324BF4EA900436F01 /* VehicleAvailability.swift */, 23163622274274330082EE9B /* LoyaltyStatus.swift */, 23163624274276E40082EE9B /* LoyaltyPoints.swift */, @@ -2499,6 +2515,7 @@ 43850F401ECB0056009CB8FD /* User */ = { isa = PBXGroup; children = ( + 7B28E004288688B600F6FDAE /* PaymentProviderUpdater */, 2359B45C2342522E008433A1 /* UpdateUserDetailsInteractor */, 43850F3E1ECB003E009CB8FD /* UserService.swift */, 43850F431ECB0056009CB8FD /* KarhooUserService.swift */, @@ -2977,6 +2994,15 @@ path = CancallationFee; sourceTree = ""; }; + 7B28E004288688B600F6FDAE /* PaymentProviderUpdater */ = { + isa = PBXGroup; + children = ( + 7B28E007288688E300F6FDAE /* PaymentProviderUpdateHandler.swift */, + 7B28E005288688D400F6FDAE /* KarhooPaymentProviderUpdateHandler.swift */, + ); + path = PaymentProviderUpdater; + sourceTree = ""; + }; BAA0A09FEA1B89384EFDA915 /* TripUpdate */ = { isa = PBXGroup; children = ( @@ -3357,9 +3383,9 @@ isa = PBXNativeTarget; buildConfigurationList = 4387A6551E3BAF6D0024FD55 /* Build configuration list for PBXNativeTarget "KarhooSDK" */; buildPhases = ( + 4387A63E1E3BAF6D0024FD55 /* Headers */, 4387A63C1E3BAF6D0024FD55 /* Sources */, 4387A63D1E3BAF6D0024FD55 /* Frameworks */, - 4387A63E1E3BAF6D0024FD55 /* Headers */, 4387A63F1E3BAF6D0024FD55 /* Resources */, ); buildRules = ( @@ -3536,6 +3562,7 @@ buildActionMask = 2147483647; files = ( 09A9B2922405901900823FB0 /* ViewController.swift in Sources */, + 7B28E00A2886891300F6FDAE /* Keys.swift in Sources */, 40FBF609240FBB2E007F6A54 /* AuthRequestsTesterViewController.swift in Sources */, 09A9B28E2405901900823FB0 /* AppDelegate.swift in Sources */, 09A9B2902405901900823FB0 /* SceneDelegate.swift in Sources */, @@ -3629,6 +3656,7 @@ 6FA6200024F5536C00C1DF48 /* AdyenPayments.swift in Sources */, 09811A1820D7BB8C001DB06F /* CancelTripRequestPayload.swift in Sources */, 43850F4C1ECB0056009CB8FD /* KarhooUserService.swift in Sources */, + 517C6CD12886BF7500EA164C /* KarhooVehicleRulesInteractor.swift in Sources */, 5C2856D220E3B127009B9464 /* ReverseGeocodeInteractor.swift in Sources */, 095A03C02333AF64007D805E /* KarhooUIConfigInteractor.swift in Sources */, 090E8226235DAD5900B447A2 /* KarhooEnvironment.swift in Sources */, @@ -3723,6 +3751,7 @@ 43D395CA1ECF9F5B00499E8F /* KarhooPaymentService.swift in Sources */, FC8EB5C9216507B7009DC8DE /* TripQuote.swift in Sources */, 317610EC1FD84B1E00D2DB75 /* KarhooNetworkDateFormatter.swift in Sources */, + 7B28E008288688E300F6FDAE /* PaymentProviderUpdateHandler.swift in Sources */, FCBD67B7211C9D7E005AA332 /* RegisterInteractor.swift in Sources */, 142CB38B24DC290A0065149C /* LoyaltyProgramme.swift in Sources */, 5C224EAF223DCA9900C1CFCE /* AddPaymentDetailsInteractor.swift in Sources */, @@ -3760,6 +3789,7 @@ 5C813E67250FB40A0060A9A9 /* AdyenPaymentMethodsRequest.swift in Sources */, 2316363D274666CF0082EE9B /* KarhooLoyaltyPreAuthInteractor.swift in Sources */, 23163636274574EC0082EE9B /* LoyaltyEarnInteractor.swift in Sources */, + 517C6CCF2886BF3C00EA164C /* VehicleImageRules.swift in Sources */, 5C49849024C0A89F00F646A4 /* QuoteVehicle.swift in Sources */, 6FED7B4D2577D0C200E95C27 /* KarhooCancellationFeeInteractor.swift in Sources */, 09A56DFC20922D5C00891F02 /* MeetingPointType.swift in Sources */, @@ -3801,6 +3831,7 @@ 147B889F24E3F537003F78B8 /* KarhooAdyenPaymentMethodsInteractor.swift in Sources */, 095A03D02333BABD007D805E /* KarhooUIConfigProvider.swift in Sources */, BAA0A9B82B56E7732880DF88 /* PositionExt.swift in Sources */, + 517C6CD32886BF9100EA164C /* VehicleRulesInteractor.swift in Sources */, 23163634274573910082EE9B /* KarhooLoyaltyBurnInteractor.swift in Sources */, BAA0A0D9B4689C44C4517E85 /* Places.swift in Sources */, BAA0A33C16B003E2D9F99AB3 /* PoiType.swift in Sources */, @@ -3810,6 +3841,7 @@ BAA0A52F9D9380CE153EA7C6 /* PaymentSDKToken.swift in Sources */, FC2EE934212425F6001B36D2 /* SDKErrorFactory.swift in Sources */, 09D0757520D826A700F75E32 /* KarhooLogoutInteractor.swift in Sources */, + 7B28E006288688D400F6FDAE /* KarhooPaymentProviderUpdateHandler.swift in Sources */, 23163625274276E40082EE9B /* LoyaltyPoints.swift in Sources */, FC1B01ED2209D0D20069D7F3 /* QuoteCategory.swift in Sources */, FC321EE020F8D54E00B2C3CD /* DriverTrackingService.swift in Sources */, @@ -4314,7 +4346,7 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 28; + CURRENT_PROJECT_VERSION = 29; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = U7U4Q7YGDH; DYLIB_COMPATIBILITY_VERSION = 1; @@ -4338,7 +4370,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.3; MODULEMAP_PRIVATE_FILE = ""; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.karhoo.KarhooSDK; @@ -4359,7 +4391,7 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 28; + CURRENT_PROJECT_VERSION = 29; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = U7U4Q7YGDH; DYLIB_COMPATIBILITY_VERSION = 1; @@ -4383,7 +4415,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.3; MODULEMAP_PRIVATE_FILE = ""; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.karhoo.KarhooSDK; diff --git a/KarhooSDK.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/KarhooSDK.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 49164336..00000000 --- a/KarhooSDK.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,34 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "KeychainSwift", - "repositoryURL": "https://github.com/evgenyneu/keychain-swift.git", - "state": { - "branch": null, - "revision": "96fb84f45a96630e7583903bd7e08cf095c7a7ef", - "version": "19.0.0" - } - }, - { - "package": "OHHTTPStubs", - "repositoryURL": "https://github.com/AliSoftware/OHHTTPStubs", - "state": { - "branch": null, - "revision": "e92b5a5746ef16add2a1424f1fc19529d9a75cde", - "version": "9.0.0" - } - }, - { - "package": "Reachability", - "repositoryURL": "https://github.com/ashleymills/Reachability.swift", - "state": { - "branch": null, - "revision": "98e968e7b6c1318fb61df23e347bc319761e8acb", - "version": "5.0.0" - } - } - ] - }, - "version": 1 -} diff --git a/KarhooSDK/Api/Response/VehicleImageRules.swift b/KarhooSDK/Api/Response/VehicleImageRules.swift new file mode 100644 index 00000000..86f5057a --- /dev/null +++ b/KarhooSDK/Api/Response/VehicleImageRules.swift @@ -0,0 +1,51 @@ +// +// VehicleRules.swift +// KarhooSDK +// +// Created by Aleksander Wedrychowski on 19/07/2022. +// Copyright © 2022 Flit Technologies Ltd. All rights reserved. +// + +import Foundation + +public struct VehicleImageRules: Codable, KarhooCodableModel { + public let rules: [VehicleImageRule] + + enum CodingKeys: String, CodingKey { + case rules = "mappings" + } +} + +public struct VehicleImageRule: Codable { + + private static let fallbackRuleValue = "*" + + public enum RuleType { + /// Rule that should be used when the vehicle type and tags match perfectly the ones in the quote. + case specific + /// Default rule for a given vehicle type. If the quote does not contain vehicle tags, then this rule should be used. + case typeDefault + /// Rule that is general fallback if any other rule doesn't mach given vehicle. + case fallback + } + public let type: String + public let tags: [String] + public let imagePath: String + + /// How a rule should be treated by front ent system. + public var ruleType: RuleType { + if type == VehicleImageRule.fallbackRuleValue { + return .fallback + } else if tags.isEmpty == true { + return .typeDefault + } else { + return .specific + } + } + + enum CodingKeys: String, CodingKey { + case type + case tags + case imagePath = "image_png" + } +} diff --git a/KarhooSDK/Api/Util/Result.swift b/KarhooSDK/Api/Util/Result.swift index 13c6dfa9..89b86fe0 100644 --- a/KarhooSDK/Api/Util/Result.swift +++ b/KarhooSDK/Api/Util/Result.swift @@ -9,12 +9,17 @@ import Foundation public enum Result { - case success(result: T) - case failure(error: KarhooError?) + case success(result: T, correlationId: String? = nil) + case failure(error: KarhooError?, correlationId: String? = nil) + @available(*, deprecated, message: "errorValue() is deprecated and will be removed in next SDK version. getErrorValue() should be used instead") public func errorValue() -> KarhooError? { + getErrorValue() + } + + public func getErrorValue() -> KarhooError? { switch self { - case .failure(let error): + case .failure(let error, _): return error default: @@ -22,10 +27,15 @@ public enum Result { } } + @available(*, deprecated, message: "successValue() is deprecated and will be removed in next SDK version. getSuccessValue() should be used instead") public func successValue() -> T? { + getSuccessValue() + } + + public func getSuccessValue() -> T? { switch self { case .success(let result): - return result + return result.result default: return nil @@ -41,13 +51,27 @@ public enum Result { return false } } + + public func getCorrelationId() -> String? { + switch self { + case .success(let result): + return result.correlationId + case .failure(let error): + return error.correlationId + } + } + @available(*, deprecated, message: "successValue(orErrorCallback:) is deprecated and will be removed in next SDK version. getSuccessValue(orErrorCallback:) should be used instead") public func successValue(orErrorCallback: CallbackClosure) -> T? { + getSuccessValue(orErrorCallback: orErrorCallback) + } + + public func getSuccessValue(orErrorCallback: CallbackClosure) -> T? { switch self { case .success(let result): - return result + return result.result case .failure(let error): - orErrorCallback(.failure(error: error)) + orErrorCallback(.failure(error: error.error)) return nil } } diff --git a/KarhooSDK/Network/APIEndpoint.swift b/KarhooSDK/Network/APIEndpoint.swift index 72934cde..f9b8b007 100644 --- a/KarhooSDK/Network/APIEndpoint.swift +++ b/KarhooSDK/Network/APIEndpoint.swift @@ -40,6 +40,7 @@ enum APIEndpoint { case adyenPublicKey case adyenClientKey case quoteCoverage + case vehicleImageRules case verifyQuote(quoteID: String) case loyaltyStatus(identifier: String) case loyaltyBurn(identifier: String, currency: String, amount: Int) @@ -141,6 +142,8 @@ enum APIEndpoint { return "/payments/adyen/client-key" case .quoteCoverage: return "/quotes/coverage" + case .vehicleImageRules: + return "https://cdn.karhoo.com/s/images/vehicles/config.json" case .verifyQuote(let quoteID): return "/quotes/verify/\(quoteID)" case .loyaltyStatus(let identifier): @@ -198,6 +201,7 @@ enum APIEndpoint { case .adyenPublicKey: return .get case .adyenClientKey: return .get case .quoteCoverage: return .get + case .vehicleImageRules: return .get case .verifyQuote: return .get case .loyaltyStatus: return .get case .loyaltyBurn: return .get @@ -222,6 +226,7 @@ enum APIEndpoint { case .adyenPublicKey: return "v3" case .adyenClientKey: return "v3" case .quoteCoverage: return "v2" + case .vehicleImageRules: return "" case .verifyQuote: return "v2" case .loyaltyBalance: return "v3" case .loyaltyConversion: return "v3" diff --git a/KarhooSDK/Network/Common/RequestSender/KarhooRequestSender.swift b/KarhooSDK/Network/Common/RequestSender/KarhooRequestSender.swift index ce9ca353..72c764e2 100644 --- a/KarhooSDK/Network/Common/RequestSender/KarhooRequestSender.swift +++ b/KarhooSDK/Network/Common/RequestSender/KarhooRequestSender.swift @@ -43,12 +43,12 @@ final class KarhooRequestSender: RequestSender { private func handler(response: Result, callback: @escaping CallbackClosure) { if let value = response.successValue()?.decodeData(ofType: T.self) { - callback(.success(result: value)) + callback(.success(result: value, correlationId: response.getCorrelationId())) } else { if let error = response.errorValue() { - callback(.failure(error: error)) + callback(.failure(error: error, correlationId: response.getCorrelationId())) } else { - callback(.failure(error: SDKErrorFactory.unexpectedError())) + callback(.failure(error: SDKErrorFactory.unexpectedError(), correlationId: response.getCorrelationId())) } } } diff --git a/KarhooSDK/Network/HttpClient/JsonHttpClient/JsonHttpClient.swift b/KarhooSDK/Network/HttpClient/JsonHttpClient/JsonHttpClient.swift index 0271ecbd..25f79c7c 100644 --- a/KarhooSDK/Network/HttpClient/JsonHttpClient/JsonHttpClient.swift +++ b/KarhooSDK/Network/HttpClient/JsonHttpClient/JsonHttpClient.swift @@ -35,7 +35,13 @@ final class JsonHttpClient: HttpClient { request = try requestBuilder.request(method: endpoint.method, url: url, headers: headers, data: data) return urlSessionSender.send(request: request) { data, response, error in - self.handle(response: response, data: data, error: error, completion: completion) + self.handle( + response: response, + data: data, + error: error, + correlationId: request.allHTTPHeaderFields?[HeaderConstants.correlationId], + completion: completion + ) } } catch { return nil @@ -56,15 +62,25 @@ final class JsonHttpClient: HttpClient { urlComponents: urlComponents) return urlSessionSender.send(request: request) { data, response, error in - self.handle(response: response, data: data, error: error, completion: completion) + self.handle( + response: response, + data: data, + error: error, + correlationId: request.allHTTPHeaderFields?[HeaderConstants.correlationId], + completion: completion + ) } } catch { return nil } } - private func handle(response: URLResponse?, data: Data?, error: Error?, - completion: CallbackClosure) { + private func handle( + response: URLResponse?, + data: Data?, + error: Error?, + correlationId: String?, + completion: CallbackClosure) { let statusCode = (response as? HTTPURLResponse)?.statusCode ?? 0 let httpResponse = HttpResponse(code: statusCode, data: data ?? Data()) @@ -74,30 +90,32 @@ final class JsonHttpClient: HttpClient { statusCode: statusCode, response: httpResponse, error: error, + correlationId: correlationId, completion: completion) return } - completion(Result.success(result: httpResponse)) + completion(Result.success(result: httpResponse, correlationId: correlationId)) } func handleError(requestUrl: String, statusCode: Int, response: HttpResponse, error: Error?, + correlationId: String?, completion: CallbackClosure) { analyticsService.send(eventName: .requestFails, payload: error != nil ? [AnalyticsConstants.Keys.requestError.rawValue: error.debugDescription, AnalyticsConstants.Keys.requestUrl.rawValue: requestUrl] : [AnalyticsConstants.Keys.requestUrl.rawValue: requestUrl]) if let error = response.decodeError() { if error.code.isEmpty, error.slug.isEmpty { - completion(Result.failure(error: SDKErrorFactory.unexpectedError())) + completion(Result.failure(error: SDKErrorFactory.unexpectedError(), correlationId: correlationId)) } else { - completion(Result.failure(error: error)) + completion(Result.failure(error: error, correlationId: correlationId)) } } else { let httpError = HTTPError(statusCode: statusCode, error: error as NSError?) - completion(Result.failure(error: httpError)) + completion(Result.failure(error: httpError, correlationId: correlationId)) } } @@ -118,6 +136,8 @@ final class JsonHttpClient: HttpClient { .authRefresh: headers = headerProvider.headersWithFormEncodedType(headers: &headers) headers = headerProvider.headersWithAcceptJSONType(headers: &headers) + case .vehicleImageRules: + break default: headers = headerProvider.headersWithAuthorization(headers: &headers, endpoint: endpoint) headers = headerProvider.headersWithCorrelationId(headers: &headers, endpoint: endpoint) @@ -129,6 +149,12 @@ final class JsonHttpClient: HttpClient { private extension JsonHttpClient { func absoluteUrl(endpoint: APIEndpoint) -> URL { + guard endpoint != .vehicleImageRules else { + guard let url = URL(string: endpoint.relativePath) else { + fatalError(urlMalformedException) + } + return url + } let environmentDetails = KarhooEnvironmentDetails(environment: Karhoo.configuration.environment()) switch Karhoo.configuration.authenticationMethod() { @@ -146,12 +172,11 @@ private extension JsonHttpClient { .authTokenExchange, .authUserInfo, .authRefresh: - guard let authServiceUrl = URL(string: environmentDetails.authHost + endpoint.relativePath) else { - fatalError(urlMalformedException) - } - - return authServiceUrl - + guard let authServiceUrl = URL(string: environmentDetails.authHost + endpoint.relativePath) else { + fatalError(urlMalformedException) + } + + return authServiceUrl default: guard let url = URL(string: environmentDetails.host + endpoint.path) else { fatalError(urlMalformedException) diff --git a/KarhooSDK/Service/Analytics/AnalyticsConstants.swift b/KarhooSDK/Service/Analytics/AnalyticsConstants.swift index 2fdd8100..e322c2dd 100644 --- a/KarhooSDK/Service/Analytics/AnalyticsConstants.swift +++ b/KarhooSDK/Service/Analytics/AnalyticsConstants.swift @@ -69,9 +69,6 @@ public enum AnalyticsConstants { case bookingScreenOpened = "RIDE_PLANNING_SCREEN" case quoteListOpened = "QUOTE_LIST_SCREEN" case checkoutOpened = "CHECKOUT_SCREEN" - case checkoutBookingRequested = "CHECKOUT_BOOKING_REQUESTED" - case paymentSucceed = "PAYMENT_CONFIRMED" - case paymentFailed = "PAYMENT_REFUSED_OR_REJECTED" case trackTripOpened = "VEHICLE_TRACKING_SCREEN" case ridesPastTripsOpened = "RIDES_PAST_LIST" case ridesUpcomingTripsOpened = "RIDES_UPCOMING_LIST" @@ -79,9 +76,25 @@ public enum AnalyticsConstants { case ridesUpcomingContactFleetClicked = "RIDES_UPCOMING_CONTACT_FLEET_CLICKED" case ridesUpcomingContactDriverClicked = "RIDES_UPCOMING_CONTACT_DRIVER_CLICKED" case trackingContactDriverClicked = "VEHICLE_TRACKING_SCREEN_CONTACT_DRIVER_CLICKED" - + + // PAYMENT STATUS + case bookingSuccess = "BOOKING_SUCCESS" + case bookingFailure = "BOOKING_FAILURE" + + // BOOKING + case checkoutBookingRequested = "BOOKING_REQUESTED" + + // LOYALTY STATUS + case loyaltyStatusRequested = "LOYALTY_STATUS_REQUESTED" + case loyaltyPreauthSuccess = "LOYALTY_PREAUTH_SUCCESS" + case loyaltyPreauthFailure = "LOYALTY_PREAUTH_FAILURE" + + // CARD AUTHORISATION STATUS + case cardAuthorisationFailure = "CARD_AUTHORISATION_FAILURE" + case cardAuthorisationSuccess = "CARD_AUTHORISATION_SUCCESS" + public var description: String { - return rawValue + rawValue } } @@ -119,9 +132,10 @@ public enum AnalyticsConstants { case destinationLongitude = "destinationLongitude" case destinationAddress = "destinationAddress" case isPrebook = "isPrebook" + case paymentMethodUsed = "paymentMethodUsed" var description: String { - return rawValue + rawValue } } } diff --git a/KarhooSDK/Service/Auth/LoginInteractor/KarhooAuthLoginWithCredentialsInteractor.swift b/KarhooSDK/Service/Auth/LoginInteractor/KarhooAuthLoginWithCredentialsInteractor.swift index 38495693..6d72fc6b 100644 --- a/KarhooSDK/Service/Auth/LoginInteractor/KarhooAuthLoginWithCredentialsInteractor.swift +++ b/KarhooSDK/Service/Auth/LoginInteractor/KarhooAuthLoginWithCredentialsInteractor.swift @@ -13,22 +13,25 @@ final class KarhooAuthLoginWithCredentialsInteractor: AuthLoginWithCredentialsIn private let userInfoSender: RequestSender private let userDataStore: UserDataStore private let analytics: AnalyticsService - private let paymentProviderRequest: RequestSender - private let loyaltyProviderRequest: RequestSender - private let nonceRequestSender: RequestSender - + private let paymentProviderUpdateHandler: PaymentProviderUpdateHandler + init(userInfoSender: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared), userDataStore: UserDataStore = DefaultUserDataStore(), analytics: AnalyticsService = KarhooAnalyticsService(), paymentProviderRequest: RequestSender = KarhooRequestSender(httpClient: JsonHttpClient.shared), loyaltyProviderRequest: RequestSender = KarhooRequestSender(httpClient: JsonHttpClient.shared), - nonceRequestSender: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared)) { + nonceRequestSender: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared), + paymentProviderUpdateHandler: PaymentProviderUpdateHandler? = nil + ) { self.userInfoSender = userInfoSender self.userDataStore = userDataStore self.analytics = analytics - self.paymentProviderRequest = paymentProviderRequest - self.nonceRequestSender = nonceRequestSender - self.loyaltyProviderRequest = loyaltyProviderRequest + self.paymentProviderUpdateHandler = paymentProviderUpdateHandler ?? + KarhooPaymentProviderUpdateHandler( + nonceRequestSender: nonceRequestSender, + paymentProviderRequest: paymentProviderRequest, + loyaltyProviderRequest: loyaltyProviderRequest + ) } func set(auth: AuthToken?) { @@ -58,11 +61,12 @@ final class KarhooAuthLoginWithCredentialsInteractor: AuthLoginWithCredentialsIn userInfoSender.requestAndDecode(payload: nil, endpoint: .authUserInfo) { [weak self](result: Result) in switch result { - case .success(let user): + case .success(let result): + let user = result.result self?.didLogin(user: user, credentials: credentials) callback(.success(result: user)) case .failure(let error): - callback(.failure(error: error)) + callback(.failure(error: error.error)) } } } @@ -74,31 +78,7 @@ final class KarhooAuthLoginWithCredentialsInteractor: AuthLoginWithCredentialsIn private func didLogin(user: UserInfo, credentials: Credentials) { userDataStore.setCurrentUser(user: user, credentials: credentials) - updatePaymentProvider(user: user) + paymentProviderUpdateHandler.updatePaymentProvider(user: user) analytics.send(eventName: .ssoUserLogIn) } - - private func updatePaymentProvider(user: UserInfo) { - paymentProviderRequest.requestAndDecode(payload: nil, - endpoint: .paymentProvider, - callback: { [weak self] (result: Result) in - let paymentProvider = result.successValue() - self?.userDataStore.updatePaymentProvider(paymentProvider: paymentProvider) - self?.updateUserNonce(user: user) - guard let self = self else { return } - LoyaltyUtils.updateLoyaltyStatusFor(paymentProvider: paymentProvider, - userDataStore: self.userDataStore, - loyaltyProviderRequest: self.loyaltyProviderRequest) - }) - } - - private func updateUserNonce(user: UserInfo) { - let payload = NonceRequestPayload(payer: Payer(user: user), - organisationId: user.organisations.first?.id ?? "") - - nonceRequestSender.requestAndDecode(payload: payload, - endpoint: .getNonce) { [weak self] (result: Result) in - self?.userDataStore.updateCurrentUserNonce(nonce: result.successValue()) - } - } } diff --git a/KarhooSDK/Service/Auth/LoginInteractor/KarhooAuthLoginWithTokenInteractor.swift b/KarhooSDK/Service/Auth/LoginInteractor/KarhooAuthLoginWithTokenInteractor.swift index 5b1d05f4..8782faba 100644 --- a/KarhooSDK/Service/Auth/LoginInteractor/KarhooAuthLoginWithTokenInteractor.swift +++ b/KarhooSDK/Service/Auth/LoginInteractor/KarhooAuthLoginWithTokenInteractor.swift @@ -12,26 +12,33 @@ final class KarhooAuthLoginWithTokenInteractor: AuthLoginWithTokenInteractor { private var token: String? private let tokenExchangeRequestSender: RequestSender private let userInfoSender: RequestSender + private let nonceRequestSender: RequestSender + private let paymentProviderRequest: RequestSender private let userDataStore: UserDataStore private let analytics: AnalyticsService - private let paymentProviderRequest: RequestSender - private let loyaltyProviderRequest: RequestSender - private let nonceRequestSender: RequestSender + private let paymentProviderUpdateHandler: PaymentProviderUpdateHandler init(tokenExchangeRequestSender: RequestSender = KarhooRequestSender(httpClient: JsonHttpClient.shared), userInfoSender: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared), - userDataStore: UserDataStore = DefaultUserDataStore(), - analytics: AnalyticsService = KarhooAnalyticsService(), paymentProviderRequest: RequestSender = KarhooRequestSender(httpClient: JsonHttpClient.shared), + nonceRequestSender: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared), loyaltyProviderRequest: RequestSender = KarhooRequestSender(httpClient: JsonHttpClient.shared), - nonceRequestSender: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared)) { + userDataStore: UserDataStore = DefaultUserDataStore(), + analytics: AnalyticsService = KarhooAnalyticsService(), + paymentProviderUpdateHandler: PaymentProviderUpdateHandler? = nil + ) { self.tokenExchangeRequestSender = tokenExchangeRequestSender self.userInfoSender = userInfoSender - self.userDataStore = userDataStore - self.analytics = analytics self.paymentProviderRequest = paymentProviderRequest - self.loyaltyProviderRequest = loyaltyProviderRequest self.nonceRequestSender = nonceRequestSender + self.userDataStore = userDataStore + self.analytics = analytics + self.paymentProviderUpdateHandler = paymentProviderUpdateHandler ?? + KarhooPaymentProviderUpdateHandler( + nonceRequestSender: nonceRequestSender, + paymentProviderRequest: paymentProviderRequest, + loyaltyProviderRequest: loyaltyProviderRequest + ) } func cancel() { @@ -67,11 +74,12 @@ final class KarhooAuthLoginWithTokenInteractor: AuthLoginWithTokenInteractor { userInfoSender.requestAndDecode(payload: nil, endpoint: .authUserInfo) { [weak self](result: Result) in switch result { - case .success(let user): + case .success(let result): + let user = result.result self?.didLogin(user: user, credentials: credentials) callback(.success(result: user)) case .failure(let error): - callback(.failure(error: error)) + callback(.failure(error: error.error)) } } } @@ -79,7 +87,7 @@ final class KarhooAuthLoginWithTokenInteractor: AuthLoginWithTokenInteractor { private func didLogin(user: UserInfo, credentials: Credentials) { userDataStore.setCurrentUser(user: user, credentials: credentials) - updatePaymentProvider(user: user) + paymentProviderUpdateHandler.updatePaymentProvider(user: user) analytics.send(eventName: .ssoUserLogIn) } @@ -94,30 +102,4 @@ final class KarhooAuthLoginWithTokenInteractor: AuthLoginWithTokenInteractor { URLQueryItem(name: AuthHeaderKeys.token.rawValue, value: token)] return components } - - private func updatePaymentProvider(user: UserInfo) { - paymentProviderRequest.requestAndDecode(payload: nil, - endpoint: .paymentProvider, - callback: { [weak self] (result: Result) in - - let paymentProvider = result.successValue() - self?.userDataStore.updatePaymentProvider(paymentProvider: paymentProvider) - self?.updateUserNonce(user: user) - guard let self = self else { return } - - LoyaltyUtils.updateLoyaltyStatusFor(paymentProvider: paymentProvider, - userDataStore: self.userDataStore, - loyaltyProviderRequest: self.loyaltyProviderRequest) - }) - } - - private func updateUserNonce(user: UserInfo) { - let payload = NonceRequestPayload(payer: Payer(user: user), - organisationId: user.organisations.first?.id ?? "") - - nonceRequestSender.requestAndDecode(payload: payload, - endpoint: .getNonce) { [weak self] (result: Result) in - self?.userDataStore.updateCurrentUserNonce(nonce: result.successValue()) - } - } } diff --git a/KarhooSDK/Service/Payment/AdyenPaymentMethods/KarhooAdyenPaymentMethodsInteractor.swift b/KarhooSDK/Service/Payment/AdyenPaymentMethods/KarhooAdyenPaymentMethodsInteractor.swift index 1cd29cc6..ef77b328 100644 --- a/KarhooSDK/Service/Payment/AdyenPaymentMethods/KarhooAdyenPaymentMethodsInteractor.swift +++ b/KarhooSDK/Service/Payment/AdyenPaymentMethods/KarhooAdyenPaymentMethodsInteractor.swift @@ -46,8 +46,8 @@ final class KarhooAdyenPaymentMethodsInteractor: AdyenPaymentMethodsInteractor { private func handle(_ response: Result, interactorCallback: CallbackClosure) { switch response { - case .failure(let error): interactorCallback(.failure(error: error)) - case .success(let response): interactorCallback(.success(result: DecodableData(data: response.data))) + case .failure(let error): interactorCallback(.failure(error: error.error)) + case .success(let result): interactorCallback(.success(result: DecodableData(data: result.result.data))) } } } diff --git a/KarhooSDK/Service/Payment/AdyenPaymentsDetails/KarhooAdyenPaymentsDetailsInteractor.swift b/KarhooSDK/Service/Payment/AdyenPaymentsDetails/KarhooAdyenPaymentsDetailsInteractor.swift index f566d6e0..fef18bdc 100644 --- a/KarhooSDK/Service/Payment/AdyenPaymentsDetails/KarhooAdyenPaymentsDetailsInteractor.swift +++ b/KarhooSDK/Service/Payment/AdyenPaymentsDetails/KarhooAdyenPaymentsDetailsInteractor.swift @@ -48,9 +48,9 @@ final class KarhooAdyenPaymentsDetailsInteractor: AdyenPaymentsDetailsInteractor interactorCallback: CallbackClosure) { switch response { case .failure(let error): - interactorCallback(.failure(error: error)) + interactorCallback(.failure(error: error.error)) case .success(let response): - interactorCallback(.success(result: DecodableData(data: response.data))) + interactorCallback(.success(result: DecodableData(data: response.result.data))) } } } diff --git a/KarhooSDK/Service/Quote/Interactor/KarhooVehicleRulesInteractor.swift b/KarhooSDK/Service/Quote/Interactor/KarhooVehicleRulesInteractor.swift new file mode 100644 index 00000000..6ed753f0 --- /dev/null +++ b/KarhooSDK/Service/Quote/Interactor/KarhooVehicleRulesInteractor.swift @@ -0,0 +1,30 @@ +// +// KarhooVehicleRulesInteractor.swift +// KarhooSDK +// +// Created by Aleksander Wedrychowski on 19/07/2022. +// Copyright © 2022 Flit Technologies Ltd. All rights reserved. +// + +import Foundation + +final class KarhooVehicleRulesInteractor: VehicleRulesInteractor { + private var requestSender: RequestSender + + init(requestSender: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared)) { + self.requestSender = requestSender + } + + func execute(callback: @escaping CallbackClosure) where T : KarhooCodableModel { + + requestSender.requestAndDecode( + payload: nil, + endpoint: .vehicleImageRules, + callback: callback + ) + } + + func cancel() { + requestSender.cancelNetworkRequest() + } +} diff --git a/KarhooSDK/Service/Quote/Interactor/VehicleRulesInteractor.swift b/KarhooSDK/Service/Quote/Interactor/VehicleRulesInteractor.swift new file mode 100644 index 00000000..67f14826 --- /dev/null +++ b/KarhooSDK/Service/Quote/Interactor/VehicleRulesInteractor.swift @@ -0,0 +1,12 @@ +// +// VehicleRulesInteractor.swift +// KarhooSDK +// +// Created by Aleksander Wedrychowski on 19/07/2022. +// Copyright © 2022 Flit Technologies Ltd. All rights reserved. +// + +import Foundation + +protocol VehicleRulesInteractor: KarhooExecutable { +} diff --git a/KarhooSDK/Service/Quote/KarhooQuoteService.swift b/KarhooSDK/Service/Quote/KarhooQuoteService.swift index 24209a02..85734fc7 100644 --- a/KarhooSDK/Service/Quote/KarhooQuoteService.swift +++ b/KarhooSDK/Service/Quote/KarhooQuoteService.swift @@ -13,13 +13,18 @@ final class KarhooQuoteService: QuoteService { private let quoteInteractor: QuoteInteractor private let coverageInteractor: QuoteCoverageInteractor private let verifyQuoteInteractor: VerifyQuoteInteractor + private let vehicleRulesInteractor: VehicleRulesInteractor - init(quoteInteractor: QuoteInteractor = KarhooQuoteInteractor(), - coverageInteractor: QuoteCoverageInteractor = KarhooQuoteCoverageInteractor(), - verifyQuoteInteractor: VerifyQuoteInteractor = KarhooVerifyQuoteInteractor()) { + init( + quoteInteractor: QuoteInteractor = KarhooQuoteInteractor(), + coverageInteractor: QuoteCoverageInteractor = KarhooQuoteCoverageInteractor(), + verifyQuoteInteractor: VerifyQuoteInteractor = KarhooVerifyQuoteInteractor(), + vehicleRulesInteractor: VehicleRulesInteractor = KarhooVehicleRulesInteractor() + ) { self.quoteInteractor = quoteInteractor self.coverageInteractor = coverageInteractor self.verifyQuoteInteractor = verifyQuoteInteractor + self.vehicleRulesInteractor = vehicleRulesInteractor } func quotes(quoteSearch: QuoteSearch) -> PollCall { @@ -37,4 +42,8 @@ final class KarhooQuoteService: QuoteService { verifyQuoteInteractor.set(verifyQuotePayload: verifyQuotePayload) return Call(executable: verifyQuoteInteractor) } + + func getVehicleImageRules() -> Call { + return Call(executable: vehicleRulesInteractor) + } } diff --git a/KarhooSDK/Service/Quote/QuoteService.swift b/KarhooSDK/Service/Quote/QuoteService.swift index 1f1bb7dc..09e511a6 100644 --- a/KarhooSDK/Service/Quote/QuoteService.swift +++ b/KarhooSDK/Service/Quote/QuoteService.swift @@ -12,4 +12,5 @@ public protocol QuoteService { func quotes(quoteSearch: QuoteSearch) -> PollCall func coverage(coverageRequest: QuoteCoverageRequest) -> Call func verifyQuote(verifyQuotePayload: VerifyQuotePayload) -> Call + func getVehicleImageRules() -> Call } diff --git a/KarhooSDK/Service/Trip/TripUpdate/KarhooTripUpdateInteractor.swift b/KarhooSDK/Service/Trip/TripUpdate/KarhooTripUpdateInteractor.swift index 51b5b0a4..73b8c777 100644 --- a/KarhooSDK/Service/Trip/TripUpdate/KarhooTripUpdateInteractor.swift +++ b/KarhooSDK/Service/Trip/TripUpdate/KarhooTripUpdateInteractor.swift @@ -25,15 +25,15 @@ final class KarhooTripUpdateInteractor: TripUpdateInteractor { callback: { [weak self] (result: Result) in switch result { case .success(var response): - self?.addFollowCodeToResponse(&response) + self?.addFollowCodeToResponse(&response.result) - guard let trip = response as? T else { + guard let trip = response.result as? T else { return } callback(.success(result: trip)) case .failure(let error): - callback(.failure(error: error)) + callback(.failure(error: error.error)) } }) } diff --git a/KarhooSDK/Service/User/KarhooPaymentProviderUpdateHandler.swift b/KarhooSDK/Service/User/KarhooPaymentProviderUpdateHandler.swift new file mode 100644 index 00000000..a039b5b4 --- /dev/null +++ b/KarhooSDK/Service/User/KarhooPaymentProviderUpdateHandler.swift @@ -0,0 +1,59 @@ +// +// Created by Bartlomiej Sopala on 18/07/2022. +// + +import Foundation + +class KarhooPaymentProviderUpdateHandler: PaymentProviderUpdateHandler { + + private let userDataStore: UserDataStore + private let nonceRequestSender: RequestSender + private let paymentProviderRequest: RequestSender + private let loyaltyProviderRequest: RequestSender + + init( + userDataStore: UserDataStore = DefaultUserDataStore(), + nonceRequestSender: RequestSender, + paymentProviderRequest: RequestSender, + loyaltyProviderRequest: RequestSender + ) { + self.userDataStore = userDataStore + self.nonceRequestSender = nonceRequestSender + self.paymentProviderRequest = paymentProviderRequest + self.loyaltyProviderRequest = loyaltyProviderRequest + } + + func updatePaymentProvider(user: UserInfo) { + paymentProviderRequest.requestAndDecode( + payload: nil, + endpoint: .paymentProvider, + callback: { [weak self] (result: Result) in + let paymentProvider = result.successValue() + guard let self = self else { return } + self.userDataStore.updatePaymentProvider(paymentProvider: paymentProvider) + if result.successValue()?.provider.type == .braintree { + self.updateUserNonce(user: user) + } + LoyaltyUtils.updateLoyaltyStatusFor( + paymentProvider: paymentProvider, + userDataStore: self.userDataStore, + loyaltyProviderRequest: self.loyaltyProviderRequest + ) + } + ) + } + + private func updateUserNonce(user: UserInfo) { + let payload = NonceRequestPayload( + payer: Payer(user: user), + organisationId: user.organisations.first?.id ?? "" + ) + + nonceRequestSender.requestAndDecode( + payload: payload, + endpoint: .getNonce + ) { [weak self] (result: Result) in + self?.userDataStore.updateCurrentUserNonce(nonce: result.successValue()) + } + } +} diff --git a/KarhooSDK/Service/User/LoginInteractor/KarhooLoginInteractor.swift b/KarhooSDK/Service/User/LoginInteractor/KarhooLoginInteractor.swift index 8c60b252..d508e1e0 100644 --- a/KarhooSDK/Service/User/LoginInteractor/KarhooLoginInteractor.swift +++ b/KarhooSDK/Service/User/LoginInteractor/KarhooLoginInteractor.swift @@ -15,11 +15,12 @@ final class KarhooLoginInteractor: LoginInteractor { private let analytics: AnalyticsService private let loginRequestSender: RequestSender private let profileRequestSender: RequestSender - private let userDataStore: UserDataStore private let nonceRequestSender: RequestSender private let paymentProviderRequest: RequestSender - private let loyaltyProviderRequest: RequestSender + private let userDataStore: UserDataStore private let authorizedUserRoles = ["TRIP_ADMIN", "MOBILE_USER"] + private let paymentProviderUpdateHandler: PaymentProviderUpdateHandler + init(userDataStore: UserDataStore = DefaultUserDataStore(), loginRequestSender: RequestSender = KarhooRequestSender(httpClient: JsonHttpClient.shared), @@ -27,14 +28,21 @@ final class KarhooLoginInteractor: LoginInteractor { analytics: AnalyticsService = KarhooAnalyticsService(), nonceRequestSender: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared), paymentProviderRequest: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared), - loyaltyProviderRequest: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared)) { + loyaltyProviderRequest: RequestSender = KarhooRequestSender(httpClient: TokenRefreshingHttpClient.shared), + paymentProviderUpdateHandler: PaymentProviderUpdateHandler? = nil + ) { self.analytics = analytics self.userDataStore = userDataStore self.loginRequestSender = loginRequestSender self.profileRequestSender = profileRequestSender self.nonceRequestSender = nonceRequestSender self.paymentProviderRequest = paymentProviderRequest - self.loyaltyProviderRequest = loyaltyProviderRequest + self.paymentProviderUpdateHandler = paymentProviderUpdateHandler ?? + KarhooPaymentProviderUpdateHandler( + nonceRequestSender: nonceRequestSender, + paymentProviderRequest: paymentProviderRequest, + loyaltyProviderRequest: loyaltyProviderRequest + ) } func set(userLogin: UserLogin) { @@ -120,31 +128,7 @@ final class KarhooLoginInteractor: LoginInteractor { analytics.send(eventName: .userLoggedIn) userDataStore.setCurrentUser(user: user, credentials: credentials) - updatePaymentProvider(user: user) + paymentProviderUpdateHandler.updatePaymentProvider(user: user) callback(.success(result: result)) } - - private func updatePaymentProvider(user: UserInfo) { - paymentProviderRequest.requestAndDecode(payload: nil, - endpoint: .paymentProvider, - callback: { [weak self] (result: Result) in - self?.userDataStore.updatePaymentProvider(paymentProvider: result.successValue()) - self?.updateUserNonce(user: user) - guard let self = self else { return } - - LoyaltyUtils.updateLoyaltyStatusFor(paymentProvider: result.successValue(), - userDataStore: self.userDataStore, - loyaltyProviderRequest: self.loyaltyProviderRequest) - }) - } - - private func updateUserNonce(user: UserInfo) { - let payload = NonceRequestPayload(payer: Payer(user: user), - organisationId: user.organisations.first?.id ?? "") - - nonceRequestSender.requestAndDecode(payload: payload, - endpoint: .getNonce) { [weak self] (result: Result) in - self?.userDataStore.updateCurrentUserNonce(nonce: result.successValue()) - } - } } diff --git a/KarhooSDK/Service/User/PaymentProviderUpdateHandler.swift b/KarhooSDK/Service/User/PaymentProviderUpdateHandler.swift new file mode 100644 index 00000000..30c16c4f --- /dev/null +++ b/KarhooSDK/Service/User/PaymentProviderUpdateHandler.swift @@ -0,0 +1,9 @@ +// +// Created by Bartlomiej Sopala on 18/07/2022. +// + +import Foundation + +protocol PaymentProviderUpdateHandler: AnyObject { + func updatePaymentProvider(user: UserInfo) +} diff --git a/KarhooSDK/Service/User/UpdateUserDetailsInteractor/KarhooUpdateUserDetailsInteractor.swift b/KarhooSDK/Service/User/UpdateUserDetailsInteractor/KarhooUpdateUserDetailsInteractor.swift index 348222be..281dc55a 100644 --- a/KarhooSDK/Service/User/UpdateUserDetailsInteractor/KarhooUpdateUserDetailsInteractor.swift +++ b/KarhooSDK/Service/User/UpdateUserDetailsInteractor/KarhooUpdateUserDetailsInteractor.swift @@ -41,16 +41,16 @@ final class KarhooUpdateUserDetailsInteractor: UpdaterUserDetailsInteractor { endpoint: APIEndpoint.userProfileUpdate(identifier: userId), callback: { [weak self] (result: Result) in switch result { - case .success(var user): - self?.userDataStore.updateUser(user: &user) + case .success(var result): + self?.userDataStore.updateUser(user: &result.result) self?.analyticsService.send(eventName: .userProfileUpdateSuccess) - guard let result = user as? T else { + guard let user = result.result as? T else { return } - callback(.success(result: result)) + callback(.success(result: user)) case .failure(let error): self?.analyticsService.send(eventName: .userProfleUpdateFailed) - callback(.failure(error: error)) + callback(.failure(error: error.error)) } }) } diff --git a/KarhooSDKTests/TestCases/Service/Auth/KarhooAuthLoginInteractorSpec.swift b/KarhooSDKTests/TestCases/Service/Auth/KarhooAuthLoginInteractorSpec.swift index ce1d38db..ae95d010 100644 --- a/KarhooSDKTests/TestCases/Service/Auth/KarhooAuthLoginInteractorSpec.swift +++ b/KarhooSDKTests/TestCases/Service/Auth/KarhooAuthLoginInteractorSpec.swift @@ -31,13 +31,19 @@ final class KarhooAuthLoginInteractorSpec: XCTestCase { mockAnalytics = MockAnalyticsService() mockGetNonceRequestSender = MockRequestSender() - testObject = KarhooAuthLoginWithTokenInteractor(tokenExchangeRequestSender: mocktokenExchangeRequest, - userInfoSender: mockUserRequest, - userDataStore: mockUserDataStore, - analytics: mockAnalytics, - paymentProviderRequest: mockPaymentProviderRequest, - loyaltyProviderRequest: mockLoyaltyProviderRequest, - nonceRequestSender: mockGetNonceRequestSender) + let mockPaymentProviderUpdateHandler = KarhooPaymentProviderUpdateHandler( + userDataStore: mockUserDataStore, + nonceRequestSender: mockGetNonceRequestSender, + paymentProviderRequest: mockPaymentProviderRequest, + loyaltyProviderRequest: mockLoyaltyProviderRequest + ) + testObject = KarhooAuthLoginWithTokenInteractor( + tokenExchangeRequestSender: mocktokenExchangeRequest, + userInfoSender: mockUserRequest, + userDataStore: mockUserDataStore, + analytics: mockAnalytics, + paymentProviderUpdateHandler: mockPaymentProviderUpdateHandler + ) testObject.set(token: "13123123123123") } diff --git a/KarhooSDKTests/TestCases/Service/Auth/KarhooAuthLoginWithCredentialsSpec.swift b/KarhooSDKTests/TestCases/Service/Auth/KarhooAuthLoginWithCredentialsSpec.swift index e66f0f3d..e7b7ae53 100644 --- a/KarhooSDKTests/TestCases/Service/Auth/KarhooAuthLoginWithCredentialsSpec.swift +++ b/KarhooSDKTests/TestCases/Service/Auth/KarhooAuthLoginWithCredentialsSpec.swift @@ -29,12 +29,21 @@ final class KarhooAuthLoginWithCredentialsSpec: XCTestCase { mockAnalytics = MockAnalyticsService() mockGetNonceRequestSender = MockRequestSender() - testObject = KarhooAuthLoginWithCredentialsInteractor(userInfoSender: mockUserRequest, - userDataStore: mockUserDataStore, - analytics: mockAnalytics, - paymentProviderRequest: mockPaymentProviderRequest, - loyaltyProviderRequest: mockLoyaltyProviderRequest, - nonceRequestSender: mockGetNonceRequestSender) + let mockPaymentProviderUpdateHandler = KarhooPaymentProviderUpdateHandler( + userDataStore: mockUserDataStore, + nonceRequestSender: mockGetNonceRequestSender, + paymentProviderRequest: mockPaymentProviderRequest, + loyaltyProviderRequest: mockLoyaltyProviderRequest + ) + testObject = KarhooAuthLoginWithCredentialsInteractor( + userInfoSender: mockUserRequest, + userDataStore: mockUserDataStore, + analytics: mockAnalytics, + paymentProviderRequest: mockPaymentProviderRequest, + loyaltyProviderRequest: mockLoyaltyProviderRequest, + nonceRequestSender: mockGetNonceRequestSender, + paymentProviderUpdateHandler: mockPaymentProviderUpdateHandler + ) testObject.set(auth: AuthToken(accessToken: "123123123", expiresIn: 5, refreshToken: "123123123", refreshExpiresIn: 5)) } diff --git a/KarhooSDKTests/TestCases/Service/User/New Group/KarhooLoginInteractorSpec.swift b/KarhooSDKTests/TestCases/Service/User/New Group/KarhooLoginInteractorSpec.swift index e9cd1c69..c1492aad 100644 --- a/KarhooSDKTests/TestCases/Service/User/New Group/KarhooLoginInteractorSpec.swift +++ b/KarhooSDKTests/TestCases/Service/User/New Group/KarhooLoginInteractorSpec.swift @@ -30,13 +30,20 @@ class KarhooLoginInteractorSpec: XCTestCase { mockUserDataStore = MockUserDataStore() mockGetNonceRequestSender = MockRequestSender() - testObject = KarhooLoginInteractor(userDataStore: mockUserDataStore, - loginRequestSender: mockLoginRequestSender, - profileRequestSender: mockProfileRequestSender, - analytics: mockAnalytics, - nonceRequestSender: mockGetNonceRequestSender, - paymentProviderRequest: mockPaymentProviderRequest, - loyaltyProviderRequest: mockLoyaltyProviderRequest) + let mockPaymentProviderUpdateHandler = KarhooPaymentProviderUpdateHandler( + userDataStore: mockUserDataStore, + nonceRequestSender: mockGetNonceRequestSender, + paymentProviderRequest: mockPaymentProviderRequest, + loyaltyProviderRequest: mockLoyaltyProviderRequest + ) + testObject = KarhooLoginInteractor( + userDataStore: mockUserDataStore, + loginRequestSender: mockLoginRequestSender, + profileRequestSender: mockProfileRequestSender, + analytics: mockAnalytics, + nonceRequestSender: mockGetNonceRequestSender, + paymentProviderUpdateHandler: mockPaymentProviderUpdateHandler + ) } /** diff --git a/README.md b/README.md index d7a41006..11716908 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ You can use [CocoaPods](http://cocoapods.org/) to install `KarhooSDK` by adding ```ruby use_frameworks! -pod 'KarhooSDK', '~> 1.6.2' +pod 'KarhooSDK', '~> 1.6.3' ``` then import `KarhooSDK` wherever you want to access Karhoo services @@ -52,7 +52,7 @@ Once you have your Swift package set up, adding Karhoo as a dependency is as eas ```swift dependencies: [ -.package(url: "https://github.com/Karhoo/karhoo-ios-sdk.git", .upToNextMajor(from: "1.6.2")) +.package(url: "https://github.com/Karhoo/karhoo-ios-sdk.git", .upToNextMajor(from: "1.6.3")) ] ```