Skip to content

Commit 31221ee

Browse files
committed
Release 5.0.3
1 parent bb7b1b3 commit 31221ee

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Changelog
22

33
For more information, see the [README](https://github.com/sumup/Android-MerchantSDK/blob/master/README.md)
4+
## Version 5.0.3
5+
* [ADDED] Introduces "configureRetryPolicy()" in the payment builder to configure the retry policy when the result of a transaction can not be retrieved at the end of a transaction. (see dedicated section in README [here](https://github.com/sumup/sumup-android-sdk#retry-policy-configuration) for more)
6+
* Both `pollingInterval` and `maxWaitingTime` should be provided in milliseconds.
7+
* If `disableBackButton` is set to true, the Android device's back button will be disabled while the retry screen is shown.
8+
* If `maxWaitingTime` elapses without a response, `SumUpAPI.ResultCode.ERROR_UNKNOWN_TRANSACTION_STATUS` will be returned.
9+
* If `disableBackButton` is set to false, pressing the back button while the retry screen is displayed will also return `SumUpAPI.ResultCode.ERROR_UNKNOWN_TRANSACTION_STATUS`.
10+
* If `pollingInterval` is greater than `maxWaitingTime`, the value of `maxWaitingTime` will be adjusted to match `pollingInterval`.
11+
* If either `pollingInterval` or `maxWaitingTime` is passed as a negative value, it will default to 0.
12+
* If `configureRetryPolicy()` is not called, the SDK will default to returning the `SumUpAPI.ResultCode.ERROR_TRANSACTION_FAILED` error code, and default values will be used while trying to get the status of the transaction.
13+
* Default values are 2000 ms for the `pollingInterval` and 60000 ms for the `maxWaitingTime`.
14+
415
## Version 5.0.2
516
* [FIXED] An issue where successful transactions were returned without all the relevant information in the SumUpAPI.Response.TX_INFO object, e.g. the card type
617
* [FIXED] A bug where initiating a checkout while the Card Reader payment method was disabled in the merchant settings resulted in a transaction failure. The SDK now enables it intrinsically

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ allprojects {
4646
Add the dependency to a module:
4747

4848
```groovy
49-
implementation 'com.sumup:merchant-sdk:5.0.2'
49+
implementation 'com.sumup:merchant-sdk:5.0.3'
5050
```
5151

5252

@@ -138,6 +138,8 @@ Several response fields are available when the callback activity is called:
138138
* SumUpAPI.Response.ResultCode.ERROR_ALREADY_LOGGED_IN = 11
139139
* SumUpAPI.Response.ResultCode.ERROR_INVALID_AMOUNT_DECIMALS = 12
140140
* SumUpAPI.Response.ResultCode.ERROR_API_LEVEL_TOO_LOW = 13
141+
* SumUpAPI.Response.ResultCode.ERROR_CARD_READER_SETTINGS_OFF = 14
142+
* SumUpAPI.Response.ResultCode.ERROR_UNKNOWN_TRANSACTION_STATUS = 15
141143
* SumUpAPI.Response.MESSAGE
142144
* Type: String
143145
* Description: A human readable message describing the result of the payment
@@ -207,6 +209,24 @@ A tip amount can be prompted directly in the card reader by using `tipOnCardRead
207209
> Note: Not all card readers support this feature. To find out if the feature is supported for the last-saved card reader, you should always check `SumUpApi.isTipOnCardReaderAvailable()`. You must handle this case yourself in order to avoid no tip from being prompted.
208210
Please also note that if both `tip` and `tipOnCardReader` are called then only `tipOnCardReader` amount will be considered during checkout if available.
209211

212+
#### Retry Policy Configuration
213+
The `configureRetryPolicy()` feature allows you to set custom retry parameters for transaction result retrieval, using `pollingInterval`, `maxWaitingTime`, and `disableBackButton`.
214+
* Parameters: Both `pollingInterval` and `maxWaitingTime` should be provided in milliseconds, with default values of 2000 ms and 60000 ms, respectively. Setting `disableBackButton` to true disables the back button during retries.
215+
* Timeout: If `maxWaitingTime` elapses with no result, the SDK returns `SumUpAPI.ResultCode.ERROR_UNKNOWN_TRANSACTION_STATUS`. Pressing the back button (if enabled) during retries will also trigger this error.
216+
* Adjustments: If `pollingInterval` exceeds `maxWaitingTime`, `maxWaitingTime` will automatically be adjusted to match. Negative values for either parameter default to 0.
217+
* Default: If `configureRetryPolicy()` is not used, the SDK defaults to returning `SumUpAPI.ResultCode.ERROR_TRANSACTION_FAILED`.
218+
219+
##### Querying the Transaction Status
220+
When using the SumUp payment as shown below:
221+
222+
```java
223+
SumupPayment.builder()
224+
...
225+
.foreignTransactionId(UUID.randomUUID().toString())
226+
.configureRetryPolicy(2000, 60000, true)
227+
.build();
228+
```
229+
If there are connectivity issues and the transaction status can not be retrieved, the API will return `ERROR_UNKNOWN_TRANSACTION_STATUS`. In such cases, you can query the transaction status by calling [SumUp transaction status API](https://developer.sumup.com/api/transactions/get) using the specified `foreignTransactionId`.
210230

211231
#### Transaction identifier
212232
The `foreignTransactionID` identifier will be associated with the transaction and can be used to retrieve details related to the transaction. See [API documentation](https://developer.sumup.com/rest-api/#tag/Transactions) for details. Please make sure that this ID is unique within the scope of the SumUp merchant account and sub-accounts. It must not be longer than 128 characters.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
minSdkVersion 26
99
targetSdkVersion 33
1010
versionCode 1
11-
versionName "5.0.2"
11+
versionName "5.0.3"
1212
}
1313

1414
packagingOptions {
@@ -35,7 +35,7 @@ android {
3535
dependencies {
3636
implementation 'com.google.android.gms:play-services-location:21.0.1'
3737

38-
implementation 'com.sumup:merchant-sdk:5.0.2'
38+
implementation 'com.sumup:merchant-sdk:5.0.3'
3939

4040
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
4141
}

app/src/main/java/com/sumup/sdksampleapp/MainActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public void onClick(View v) {
7575
.addAdditionalInfo("AccountId", "taxi0334")
7676
.addAdditionalInfo("From", "Paris")
7777
.addAdditionalInfo("To", "Berlin")
78+
.configureRetryPolicy(2000, 60000, true)
7879
// optional: foreign transaction ID, must be unique!
7980
.foreignTransactionId(UUID.randomUUID().toString()) // can not exceed 128 chars
8081
.build();

0 commit comments

Comments
 (0)