Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions GravySDK/src/main/java/com/gr4vy/android_sdk/Gr4vySDK.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class Gr4vySDK(
* @param connectionOptionsString An optional connection options list as a JSON string.
* @param buyer An optional buyer object to allow guest checkout.
* @param debugMode Enables debug mode.
* @param installmentCount An optional value that indicates the number of installments a buyer is required to make.
*/
fun launch(
context: Context,
Expand Down Expand Up @@ -113,6 +114,7 @@ class Gr4vySDK(
connectionOptionsString: String? = null,
buyer: @RawValue Gr4vyBuyer? = null,
debugMode: Boolean = false,
installmentCount: Int? = null,
) {

if (!isSupported()) {
Expand Down Expand Up @@ -147,6 +149,7 @@ class Gr4vySDK(
merchantAccountId = merchantAccountId,
connectionOptions = gr4vyMapConnectionOptions(connectionOptions, connectionOptionsString),
buyer = buyer,
installmentCount = installmentCount,
)

val intent = Gr4vyActivity.createIntentWithParameters(context, parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ data class UpdateMessage(
shippingDetailsId = parameters.shippingDetailsId,
merchantAccountId = parameters.merchantAccountId,
connectionOptions = gr4vyConvertJSONStringToMap(parameters.connectionOptions),
buyer = parameters.buyer
buyer = parameters.buyer,
installmentCount = parameters.installmentCount
)
)
}
Expand Down Expand Up @@ -164,7 +165,8 @@ data class Update(
val shippingDetailsId: String? = null,
val merchantAccountId: String? = null,
val connectionOptions: Map<String, JsonElement>? = null,
val buyer: Gr4vyBuyer? = null
val buyer: Gr4vyBuyer? = null,
val installmentCount: Int? = null
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ data class Parameters(
val merchantAccountId: String? = null,
val connectionOptions: String? = null,
val buyer: Gr4vyBuyer? = null,
val installmentCount: Int? = null,
) : Parcelable {
init {
require(token.isNotBlank()) { "Gr4vy token was blank" }
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![Build Status](https://github.com/gr4vy/gr4vy-android/actions/workflows/build.yaml/badge.svg?branch=main)

![Platforms](https://img.shields.io/badge/Platforms-Android-yellowgreen?style=for-the-badge)
![Version](https://img.shields.io/badge/Version-1.12.0-yellowgreen?style=for-the-badge)
![Version](https://img.shields.io/badge/Version-1.13.0-yellowgreen?style=for-the-badge)

Quickly embed Gr4vy in your Android app to store card details, authorize payments, and capture a transaction.

Expand All @@ -26,7 +26,7 @@ repositories {
}

dependencies {
implementation 'com.github.gr4vy:gr4vy-android:v1.12.0'
implementation 'com.github.gr4vy:gr4vy-android:v1.13.0'
}
```

Expand Down Expand Up @@ -108,6 +108,8 @@ These are the options available in this SDK:

| `debugMode` | `Optional` | `true`, `false`. Defaults to `false`, this prints to the console. |

| `installmentCount` | `Optional` | `number` | An optional value that indicates the number of installments a buyer is required to make. |

### Step 3. Handle events from Gr4vy

When you implement `Gr4vyResultHandler` you can handle the events emitted by Gr4vy like so:
Expand Down