Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Release v1.3.2 (#317)
Browse files Browse the repository at this point in the history
* Add showSnackBar function to BaseFragment.kt, improve handle delete card response function

* Remove redundant todo

* Remove test code

* Restore result bundle after screen rotation

* Remove redundant TODO

* Remove test code

* Handle multiple delete dialogs, fix null card exception, handle delete button visibility when all cards deleted

* Refactor handleDeleteCard function

* Add TODO for recycler view adapter

* Fix javadoc

* Add result bundle property to Cancel state

* Remove redundant TODO

* Handle cancel result parse

* Add TODO

* Move result bundle to activity, to restore result bundle when fragment change

* Fix add card command

* Remove test code

* Handle delete results in canceled case

* Remove test code

* Remove redundant constant link

* Fix links in example activities

* Update Mapper.toCardResponse() function

* Disable pay button when all cards deleted

* Add validation behavior to "BeforeSubmit" analytic event

* Bump dokka-gradle-plugin from 1.6.20 to 1.6.21 (#228)

Bumps [dokka-gradle-plugin](https://github.com/Kotlin/dokka) from 1.6.20 to 1.6.21.
- [Release notes](https://github.com/Kotlin/dokka/releases)
- [Commits](Kotlin/dokka@v1.6.20...v1.6.21)

---
updated-dependencies:
- dependency-name: org.jetbrains.dokka:dokka-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add load/delete fin instrument events

* Add create fin instrument event

* Add AddCArdPaymentMethod event, update tests

* Update tests (#229)

* normalize brand names (#230)

* Add isRemoveCardOptionEnabled boolean flag for add card config

* Update strings.xml (#232)

* Fix CreateFinInstrument/AddPymentMethod events sending in custom config

* Rename AddCardPaymentMethod -> AddCardPaymentMethodEvent

* add exception warning (#234)

* Fix VGSCheckoutAddCardConfig.create() cancel does not work. Improve parallel cards fetching

* Refactoring: rename GetSavedCardsCommand.kt properties

* Bump robolectric from 4.7.3 to 4.8 (#236)

Bumps [robolectric](https://github.com/robolectric/robolectric) from 4.7.3 to 4.8.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](robolectric/robolectric@robolectric-4.7.3...robolectric-4.8)

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Move analytics disable/enable to static object VGSCheckoutAnalyticLogger.kt

* Improve multi-threading

* Bump material from 1.5.0 to 1.6.0

Bumps [material](https://github.com/material-components/material-components-android) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/material-components/material-components-android/releases)
- [Commits](material-components/material-components-android@1.5.0...1.6.0)

---
updated-dependencies:
- dependency-name: com.google.android.material:material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Refactor card featch, improve processing time

* Bump robolectric from 4.8 to 4.8.1 (#238)

Bumps [robolectric](https://github.com/robolectric/robolectric) from 4.8 to 4.8.1.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](robolectric/robolectric@robolectric-4.8...robolectric-4.8.1)

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* replace packages (#241)

* Fix tests

* Bump gradle from 7.1.3 to 7.2.0

Bumps gradle from 7.1.3 to 7.2.0.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Add basic saved cards UI tests

* Add more tests

* Add getBrandIcon tests

* Save card option (#244)

* add saveCardOptionEnabled

* add test

* add variable description

* Bump mockk from 1.12.3 to 1.12.4

Bumps [mockk](https://github.com/mockk/mockk) from 1.12.3 to 1.12.4.
- [Release notes](https://github.com/mockk/mockk/releases)
- [Commits](mockk/mockk@1.12.3...1.12.4)

---
updated-dependencies:
- dependency-name: io.mockk:mockk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update gradle wrapper version

* Remove redundant code

* Add tests for saved card flows (#243)

* Upate "BeforeSubmit" event content block

* Update tests

* Update Init event

* Update AddPaymentMethod event name and type

* Format code

* card option default state (#247)

* update default value

* update tests

* disable Automatic Component Creation

* enable Automatic Component Creation

* Add --stacktrace to ci config

* Disable daemon in ci config

* Update tests

* Update tests

* Refactor demo app packages

* Refactor demo app packages

* Increment target sdk version, remove compile sdk version

* Increment compile sdk version

* Rename activity & layouts

* Refactor custom example

* Refactor payment example

* Remove redundant log

* Revert token url

* Refactor theme

* Refactor strings

* Add back buttons

* Add comment

* Refactor packages

* Remove unsued colors

* Update CI config.yml

* Add config screen handle navigation

* Rename ConfigActivity.kt

* Add SettingsFragment.kt and settings xml

* Add UI config

* Update naming

* Update payment config creating

* Add different settings for payment and custom configs

* Bump constraintlayout from 2.1.3 to 2.1.4

Bumps [constraintlayout](https://github.com/androidx/constraintlayout) from 2.1.3 to 2.1.4.
- [Release notes](https://github.com/androidx/constraintlayout/releases)
- [Commits](https://github.com/androidx/constraintlayout/commits)

---
updated-dependencies:
- dependency-name: androidx.constraintlayout:constraintlayout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Implement payment checkout settings

* Handle payment flow loading state while fetch token

* Add ability to configure vault

* Remove debug log

* Update analytic test handling

* Update FinInstrumentCrudEventTest.kt tests

* Rename test methods

* Make generateContent function private

* Cover analytics package with tests for 100%

* Add "content" assertion

* Remove redundant interfaces

* Add test layout

* Update CustomCheckoutActivity.kt (#254)

* Fix VGSCheckoutTextInputLayout child view add

* Fix view add and clear text icon

* Remove VGSTextInputLayout.kt, refactor UI to use VGSCheckoutTextInputLayout.kt

* Fix switch case logic

* Remove outdated test

* Remove unused card previews drawables

* Fix unknown card icon

* Fix view matchers

* Fix tests

* Remove local storage (#255)

* remove storage

* update tests

* remove dependency notifier

* update tests

* Merge with dev

* Update circle ci android image

* Revert "Update circle ci android image"

This reverts commit 85bda53.

* remove collect onEditorActionListener (#258)

* Update CI config.yml

* Bump gradle from 7.2.0 to 7.2.1 (#259)

Bumps gradle from 7.2.0 to 7.2.1.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* remove limitations for OnKeyListener (#261)

* remove log

* remove listener

* remove limitations for focus change listener (#260)

* remove obsoleted code

* remove limitations for focusChangeListener

* Remove limitations for text change listener (#262)

* Update amex icon

* Remove obsolete attributes (#263)

* remove redundant attributes

* update styles

* Update elo icon

* Update visa electron icon

* Update visa icon

* Update maestro icon

* Update FORBRUGSFORENINGEN icon

* Update Dankort icon

* Update Maestro icon

* Update Hipercard icon

* Update Dinclub icon

* Update Discover icon

* Update Union pay icon

* Update JCB icon

* update default behavior value (#264)

* Fix tests

* Fix tests

* Bump mockito-inline from 4.5.1 to 4.6.0

Bumps [mockito-inline](https://github.com/mockito/mockito) from 4.5.1 to 4.6.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.5.1...v4.6.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-inline
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Remove unused classes

* Refactor validation manager to depend on BaseInputField.kt

* Refactor person name input

* Fix id set

* Remove card number input wrapper

* Remove unused ssn field

* Remove expiration date input wrapper

* Bump mockito-core from 4.5.1 to 4.6.0 (#268)

Bumps [mockito-core](https://github.com/mockito/mockito) from 4.5.1 to 4.6.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.5.1...v4.6.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mockito-android from 4.5.1 to 4.6.0 (#266)

Bumps [mockito-android](https://github.com/mockito/mockito) from 4.5.1 to 4.6.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.5.1...v4.6.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-android
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove cvc input wrapper

* Remove vgs edit text

* Remove country input wrapper

* Remove VGSCheckoutTextInputLayout.kt & InputFieldView.kt

* Bump material from 1.6.0 to 1.6.1

Bumps [material](https://github.com/material-components/material-components-android) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/material-components/material-components-android/releases)
- [Commits](material-components/material-components-android@1.6.0...1.6.1)

---
updated-dependencies:
- dependency-name: com.google.android.material:material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump gradle-maven-publish-plugin from 0.19.0 to 0.20.0

Bumps [gradle-maven-publish-plugin](https://github.com/vanniktech/gradle-maven-publish-plugin) from 0.19.0 to 0.20.0.
- [Release notes](https://github.com/vanniktech/gradle-maven-publish-plugin/releases)
- [Changelog](https://github.com/vanniktech/gradle-maven-publish-plugin/blob/master/CHANGELOG.md)
- [Commits](vanniktech/gradle-maven-publish-plugin@0.19.0...0.20.0)

---
updated-dependencies:
- dependency-name: com.vanniktech:gradle-maven-publish-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump appcompat from 1.4.1 to 1.4.2

Bumps appcompat from 1.4.1 to 1.4.2.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump core-ktx from 1.7.0 to 1.8.0

Bumps core-ktx from 1.7.0 to 1.8.0.

---
updated-dependencies:
- dependency-name: androidx.core:core-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump core-ktx from 1.7.0 to 1.8.0

Bumps core-ktx from 1.7.0 to 1.8.0.

---
updated-dependencies:
- dependency-name: androidx.core:core-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Run UI tests CI config

* Move card brand test to correct folder

* Fix view matcher

* Revert config file

* Bump mockito-android from 4.6.0 to 4.6.1

Bumps [mockito-android](https://github.com/mockito/mockito) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump mockito-inline from 4.6.0 to 4.6.1

Bumps [mockito-inline](https://github.com/mockito/mockito) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-inline
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Delete unused attributes

* Bump mockito-core from 4.6.0 to 4.6.1

Bumps [mockito-core](https://github.com/mockito/mockito) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Remove deleted attributes from themes

* Remove deleted attributes from layout

* add payment activity (#277)

* Add payment config (#278)

* Payment activity (#279)

* Add Payment fragment (#280)

* Bump kotlin_version from 1.6.21 to 1.7.0 (#281)

Bumps `kotlin_version` from 1.6.21 to 1.7.0.

Updates `kotlin-gradle-plugin` from 1.6.21 to 1.7.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-stdlib` from 1.6.21 to 1.7.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Transfer payment method (#282)

* Bump okhttp from 4.9.3 to 4.10.0 (#284)

Bumps [okhttp](https://github.com/square/okhttp) from 4.9.3 to 4.10.0.
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](square/okhttp@parent-4.9.3...parent-4.10.0)

---
updated-dependencies:
- dependency-name: com.squareup.okhttp3:okhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add Transfer (#283)

* remove useless check

* Add transfer command

* refactor Order request

* remove commented code

* refactored payment PaymentMethodFragment.kt

* return Transfer response to user

* return transfer with new card

* update default date patter

* return transfer result

* improve loading

* remove useless import

* add analytic notes

* Bump dokka-gradle-plugin from 1.6.21 to 1.7.0

Bumps [dokka-gradle-plugin](https://github.com/Kotlin/dokka) from 1.6.21 to 1.7.0.
- [Release notes](https://github.com/Kotlin/dokka/releases)
- [Commits](https://github.com/Kotlin/dokka/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.dokka:dokka-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Add card model tests

* Read last4 from response

* Bump jsonassert from 1.5.0 to 1.5.1

Bumps [jsonassert](https://github.com/skyscreamer/JSONassert) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/skyscreamer/JSONassert/releases)
- [Changelog](https://github.com/skyscreamer/JSONassert/blob/master/CHANGELOG.md)
- [Commits](skyscreamer/JSONassert@jsonassert-1.5.0...jsonassert-1.5.1)

---
updated-dependencies:
- dependency-name: org.skyscreamer:jsonassert
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump kotlin_version from 1.7.0 to 1.7.10 (#289)

Bumps `kotlin_version` from 1.7.0 to 1.7.10.

Updates `kotlin-gradle-plugin` from 1.7.0 to 1.7.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-stdlib` from 1.7.0 to 1.7.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add static route id for payment requests (#288)

* add analytic parameter (#296)

* Refactor  compose command (#302)

* Feature/save cards (#303)

* add documentation to methods (#304)

* Sub account

* Fix types

* Bump mockito-core from 4.6.1 to 4.7.0 (#313)

Bumps [mockito-core](https://github.com/mockito/mockito) from 4.6.1 to 4.7.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.6.1...v4.7.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mockito-android from 4.6.1 to 4.7.0 (#312)

Bumps [mockito-android](https://github.com/mockito/mockito) from 4.6.1 to 4.7.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.6.1...v4.7.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-android
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump gson from 2.9.0 to 2.9.1 (#308)

Bumps [gson](https://github.com/google/gson) from 2.9.0 to 2.9.1.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](google/gson@gson-parent-2.9.0...gson-parent-2.9.1)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mockito-inline from 4.6.1 to 4.7.0 (#314)

Bumps [mockito-inline](https://github.com/mockito/mockito) from 4.6.1 to 4.7.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.6.1...v4.7.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-inline
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update default policy (#316)

* Bump robolectric from 4.8.1 to 4.8.2 (#315)

Bumps [robolectric](https://github.com/robolectric/robolectric) from 4.8.1 to 4.8.2.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](robolectric/robolectric@robolectric-4.8.1...robolectric-4.8.2)

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump gradle from 7.2.1 to 7.2.2 (#309)

Bumps gradle from 7.2.1 to 7.2.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update default value

* increase version

* set parameter from builder

* add log

* remove log

* Fix auth url property in CI config

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dmytrodmytryshyn <[email protected]>
Co-authored-by: DmytroDm <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
4 people committed Aug 29, 2022
1 parent 8d1e698 commit 73dd161
Show file tree
Hide file tree
Showing 15 changed files with 128 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
echo "JWT_TOKEN_WITHOUT_TRANSFERS=$JWT_TOKEN_WITHOUT_TRANSFERS" >> local.properties
echo "JWT_TOKEN_WITH_TRANSFERS_WRITE=$JWT_TOKEN_WITH_TRANSFERS_WRITE" >> local.properties
echo "JWT_TOKEN_WITH_TRANSFERS_ANY=$JWT_TOKEN_WITH_TRANSFERS_ANY" >> local.properties
echo "AUTHENTICATION_HOST=AUTHENTICATION_HOST" >> local.properties
echo "AUTHENTICATION_HOST=$AUTHENTICATION_HOST" >> local.properties
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "demo/build.gradle" }}
- run:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.gradle_tools = "7.2.1"
ext.gradle_tools = "7.2.2"
ext.kotlin_version = "1.7.10"
ext.app_compat = "1.4.2"
ext.core_ktx = "1.8.0"
Expand Down
2 changes: 1 addition & 1 deletion demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {

implementation "com.squareup.okhttp3:okhttp:$okHttp"

implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.google.code.gson:gson:2.9.1'

implementation "androidx.preference:preference-ktx:1.2.0"

Expand Down
10 changes: 5 additions & 5 deletions vgscheckout/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@ dependencies {
testImplementation "junit:junit:$junit"
testImplementation "androidx.test.ext:junit-ktx:$junit_extension"
testImplementation "androidx.test:core-ktx:1.4.0"
testImplementation "org.robolectric:robolectric:4.8.1"
testImplementation "org.mockito:mockito-core:4.6.1"
testImplementation "org.mockito:mockito-inline:4.6.1"
testImplementation "org.robolectric:robolectric:4.8.2"
testImplementation "org.mockito:mockito-core:4.7.0"
testImplementation "org.mockito:mockito-inline:4.7.0"
testImplementation "org.json:json:20220320"
testImplementation "io.mockk:mockk:1.12.4"
testImplementation "org.skyscreamer:jsonassert:1.5.1"
androidTestImplementation "androidx.test.ext:junit:$junit_extension"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_core"
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espresso_core"
androidTestImplementation "org.mockito:mockito-android:4.6.1"
androidTestImplementation "org.mockito:mockito-android:4.7.0"
androidTestImplementation "androidx.test.ext:junit:$junit_extension"
androidTestImplementation "androidx.test.ext:junit-ktx:$junit_extension"
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'com.google.code.gson:gson:2.9.0'
androidTestImplementation 'com.google.code.gson:gson:2.9.1'
}

def createBuildConfigFields(buildConfig) {
Expand Down
4 changes: 2 additions & 2 deletions vgscheckout/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ POM_DESCRIPTION=VGS Checkout Android SDK is a library that allows you to securel
POM_INCEPTION_YEAR=2021
POM_PACKAGING=aar
# Version code & name
VERSION_NAME=1.3.1
VERSION_CODE=131
VERSION_NAME=1.3.2
VERSION_CODE=132
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.test.core.app.ApplicationProvider
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
import com.verygoodsecurity.vgscheckout.BuildConfig
Expand All @@ -23,13 +24,17 @@ import com.verygoodsecurity.vgscheckout.util.extension.addCardPaymentInstrument
import com.verygoodsecurity.vgscheckout.util.extension.getParcelableSafe
import org.junit.Assert
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import java.util.concurrent.CountDownLatch

@Suppress("SameParameterValue")
@RunWith(AndroidJUnit4::class)
class SavedCardActivityResultTest {

private val context: Context = ApplicationProvider.getApplicationContext()

private lateinit var intent: Intent
private lateinit var token: String
private lateinit var device: UiDevice

Expand All @@ -39,52 +44,49 @@ class SavedCardActivityResultTest {
device.setOrientationNatural()

token = AccessTokenHelper.getToken()

val config = initializeSavedCardConfig()

intent = Intent(context, SaveCardActivity::class.java).apply {
putExtra(
EXTRA_KEY_ARGS,
CheckoutResultContract.Args(config!!)
)
}
}

private fun initializeSavedCardConfig(finID: String): VGSCheckoutAddCardConfig {
private fun initializeSavedCardConfig() = CountDownLatch(1).runCatching {
val finID = addCardPaymentInstrument(context, token)

val config = VGSCheckoutAddCardConfig.Builder(BuildConfig.VAULT_ID)
val savedConfig = VGSCheckoutAddCardConfig.Builder(BuildConfig.VAULT_ID)
.setAccessToken(token)
.setIsScreenshotsAllowed(true)
.setSavedCardsIds(arrayListOf(finID))
.build()

CountDownLatch(1).runCatching {
VGSCheckoutAddCardConfig.loadSavedCards(
context,
config,
object : VGSCheckoutConfigInitCallback {
override fun onSuccess() {
countDown()
.also {
VGSCheckoutAddCardConfig.loadSavedCards(
context,
it,
object : VGSCheckoutConfigInitCallback {
override fun onSuccess() {
countDown()
}

override fun onFailure(exception: VGSCheckoutException) {
countDown()
}
}
)
}
await()

override fun onFailure(exception: VGSCheckoutException) {
countDown()
}
}
)
await()
}
Assert.assertNotNull(savedConfig)

return config
}

private fun createIntent(config: VGSCheckoutAddCardConfig) =
Intent(context, SaveCardActivity::class.java).apply {
putExtra(
EXTRA_KEY_ARGS,
CheckoutResultContract.Args(config)
)
}
savedConfig
}.getOrNull()

@Test
fun performPaymentOrchestration_cancelActivityResult_withBackPress_codeCanceled() {
val finID = addCardPaymentInstrument(context, token)
Assert.assertTrue(finID.isNotEmpty())

val intent = initializeSavedCardConfig(finID).run {
createIntent(this)
}

ActivityScenario.launch<SaveCardActivity>(intent).use {
// Act
device.pressBack()
Expand All @@ -95,13 +97,8 @@ class SavedCardActivityResultTest {
}
}

@Test
fun performPaymentOrchestration_cancelActivityResult_withNavigationUp_codeCanceled() {
val finID = addCardPaymentInstrument(context, token)
Assert.assertTrue(finID.isNotEmpty())
val intent = initializeSavedCardConfig(finID).run {
createIntent(this)
}

ActivityScenario.launch<SaveCardActivity>(intent).use {
waitFor(500)
// Act
Expand All @@ -114,12 +111,8 @@ class SavedCardActivityResultTest {
}
}

@Test
fun performPaymentOrchestration_savedCard_successfulResponse_codeOk() {
val finID = addCardPaymentInstrument(context, token)
Assert.assertTrue(finID.isNotEmpty())
val intent = initializeSavedCardConfig(finID).run {
createIntent(this)
}
ActivityScenario.launch<SaveCardActivity>(intent).use {
waitFor(500)
// Act
Expand All @@ -131,12 +124,8 @@ class SavedCardActivityResultTest {
}
}

@Test
fun performPaymentOrchestration_isPreSavedCard_true() {
val finID = addCardPaymentInstrument(context, token)
Assert.assertTrue(finID.isNotEmpty())
val intent = initializeSavedCardConfig(finID).run {
createIntent(this)
}
ActivityScenario.launch<SaveCardActivity>(intent).use {
waitFor(500)
// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
import com.verygoodsecurity.vgscheckout.BuildConfig
Expand All @@ -31,9 +32,12 @@ import com.verygoodsecurity.vgscheckout.util.extension.addCardPaymentInstrument
import com.verygoodsecurity.vgscheckout.util.extension.getParcelableSafe
import org.junit.Assert
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import java.util.concurrent.CountDownLatch

@Suppress("SameParameterValue")
@RunWith(AndroidJUnit4::class)
class SavedCardManagementTest {

private val context: Context = ApplicationProvider.getApplicationContext()
Expand All @@ -57,33 +61,35 @@ class SavedCardManagementTest {
)
}

private fun initializeSavedCardConfig(arrayListOf: ArrayList<String>): VGSCheckoutAddCardConfig {
val config = VGSCheckoutAddCardConfig.Builder(BuildConfig.VAULT_ID)
.setAccessToken(token)
.setIsScreenshotsAllowed(true)
.setSavedCardsIds(arrayListOf)
.build()

private fun initializeSavedCardConfig(arrayListOf: ArrayList<String>) =
CountDownLatch(1).runCatching {
VGSCheckoutAddCardConfig.loadSavedCards(
context,
config,
object : VGSCheckoutConfigInitCallback {
override fun onSuccess() {
countDown()
}
val savedConfig = VGSCheckoutAddCardConfig.Builder(BuildConfig.VAULT_ID)
.setAccessToken(token)
.setIsScreenshotsAllowed(true)
.setSavedCardsIds(arrayListOf)
.build()
.also {
VGSCheckoutAddCardConfig.loadSavedCards(
context,
it,
object : VGSCheckoutConfigInitCallback {
override fun onSuccess() {
countDown()
}

override fun onFailure(exception: VGSCheckoutException) {
countDown()
}
override fun onFailure(exception: VGSCheckoutException) {
countDown()
}
}
)
}
)
await()
}
Assert.assertNotNull(savedConfig)

return config
}
savedConfig
}.getOrNull()

@Test
fun performPaymentOrchestration_presaved3Card_selected2Card() {
val amexCardPosition = 2
val finID0 = addCardPaymentInstrument(context, token, VALID_CARD_NUMBER)
Expand All @@ -96,7 +102,7 @@ class SavedCardManagementTest {
)

val intent = initializeSavedCardConfig(arrayListOf(finID0, finID1, finID2)).run {
createIntent(this)
createIntent(this!!)
}

ActivityScenario.launch<SaveCardActivity>(intent).use {
Expand All @@ -119,6 +125,8 @@ class SavedCardManagementTest {
}
}

//here
@Test
fun performPaymentOrchestration_presaved3Card_delete3Cards() {
val removedCardSize = 3
val finID0 = addCardPaymentInstrument(context, token, VALID_CARD_NUMBER)
Expand All @@ -131,7 +139,7 @@ class SavedCardManagementTest {
)

val intent = initializeSavedCardConfig(arrayListOf(finID0, finID1, finID2)).run {
createIntent(this)
createIntent(this!!)
}

ActivityScenario.launch<SaveCardActivity>(intent).use {
Expand All @@ -158,10 +166,11 @@ class SavedCardManagementTest {
}
}

//todo: add after saved cards release
fun performPaymentOrchestration_loadDeletedCard() {
val finID0 = addCardPaymentInstrument(context, token, VALID_CARD_NUMBER)
val intent = initializeSavedCardConfig(arrayListOf(finID0)).run {
createIntent(this)
createIntent(this!!)
}

ActivityScenario.launch<SaveCardActivity>(intent).use {
Expand All @@ -183,7 +192,7 @@ class SavedCardManagementTest {
}

val wrongSavedCardIntent = initializeSavedCardConfig(arrayListOf(finID0)).run {
createIntent(this)
createIntent(this!!)
}

ActivityScenario.launch<SaveCardActivity>(wrongSavedCardIntent).use {
Expand All @@ -193,6 +202,7 @@ class SavedCardManagementTest {
}
}

//todo: add after saved cards release
fun performPaymentOrchestration_presaved3Card_deleteSecondCard_submitThirdCard() {
val secondCardPosition = 1
val finID0 = addCardPaymentInstrument(context, token, VALID_CARD_NUMBER)
Expand All @@ -205,7 +215,7 @@ class SavedCardManagementTest {
)

val intent = initializeSavedCardConfig(arrayListOf(finID0, finID1, finID2)).run {
createIntent(this)
createIntent(this!!)
}

ActivityScenario.launch<SaveCardActivity>(intent).use {
Expand Down
Loading

0 comments on commit 73dd161

Please sign in to comment.