Skip to content

Commit

Permalink
Merge pull request #595 from gini/PP-213_Rename_releaseCapture
Browse files Browse the repository at this point in the history
feat:(bank-sdk) Rename releaseCapture with cleanCapture
  • Loading branch information
GeraltRiv authored Oct 23, 2024
2 parents 413ed14 + 52c105f commit b5d55c5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class ExtractionsActivity : AppCompatActivity(), ExtractionsAdapter.ExtractionsA
)
)

GiniBank.releaseCapture(applicationContext)
GiniBank.cleanupCapture(applicationContext)

finish()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class TransferSummaryIntegrationTest {
)

// Now we can release capture
GiniBank.releaseCapture(getApplicationContext()
GiniBank.cleanupCapture(getApplicationContext()
)

// Wait a little for the feedback sending to complete
Expand Down
25 changes: 20 additions & 5 deletions bank-sdk/sdk/src/main/java/net/gini/android/bank/sdk/GiniBank.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import net.gini.android.bank.api.GiniBankAPI
import net.gini.android.bank.api.models.ResolvePaymentInput
import net.gini.android.bank.api.models.ResolvedPayment
import net.gini.android.bank.sdk.GiniBank.getPaymentRequest
import net.gini.android.bank.sdk.GiniBank.releaseCapture
import net.gini.android.bank.sdk.GiniBank.resolvePaymentRequest
import net.gini.android.bank.sdk.GiniBank.returnToPaymentInitiatorApp
import net.gini.android.bank.sdk.GiniBank.setCaptureConfiguration
Expand Down Expand Up @@ -167,7 +166,7 @@ object GiniBank {

/**
* Sets configuration for Capture feature.
* Note that configuration is immutable. [releaseCapture] needs to be called before passing a new configuration.
* Note that configuration is immutable. [cleanupCapture] needs to be called before passing a new configuration.
*
* @throws IllegalStateException if capture is already configured.
*/
Expand Down Expand Up @@ -203,7 +202,7 @@ object GiniBank {
* Please provide the required transfer summary to improve the future extraction accuracy.
*
* Follow the recommendations below:
* - Make sure to call this method before calling [releaseCapture] if the user has completed TAN verification.
* - Make sure to call this method before calling [cleanupCapture] if the user has completed TAN verification.
* - Provide values for all necessary fields, including those that were not extracted.
* - Provide the final data approved by the user (and not the initially extracted only).
* - Send the transfer summary after TAN verification and provide the extraction values the user has used.
Expand Down Expand Up @@ -246,7 +245,7 @@ object GiniBank {
* @param bic bank identification code
* @param amount accepts extracted amount and currency
*
* @deprecated Use [sendTransferSummary] to provide the required transfer summary first (if the user has completed TAN verification) and then [releaseCapture] to let the SDK free up used resources.
* @deprecated Use [sendTransferSummary] to provide the required transfer summary first (if the user has completed TAN verification) and then [cleanupCapture] to let the SDK free up used resources.
*/
@Deprecated(
"Please use sendTransferSummary() to provide the required transfer summary first (if the user has completed TAN verification) and then releaseCapture() to let the SDK free up used resources.",
Expand All @@ -264,7 +263,7 @@ object GiniBank {
sendTransferSummary(
paymentRecipient, paymentReference, paymentPurpose, iban, bic, amount
)
releaseCapture(context)
cleanupCapture(context)
releaseTransactionDocsFeature(context)
BankSdkIsolatedKoinContext.clean()
}
Expand All @@ -276,8 +275,24 @@ object GiniBank {
* @param context Android context
*
*/
@Deprecated(
"Please use cleanupCapture(context). This method will be removed in a future release.",
ReplaceWith("cleanupCapture(context)")
)
fun releaseCapture(
context: Context
) {
cleanupCapture(context)
}

/**
* Frees up resources used by the capture flow.
*
* @param context Android context
*
*/
fun cleanupCapture(
context: Context
) {
GiniCapture.cleanup(
context
Expand Down

0 comments on commit b5d55c5

Please sign in to comment.