-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
430f358
commit a94d865
Showing
9 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
payments-model/src/main/java/com/stripe/android/model/ConsumerPaymentDetailsUpdateParams.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.stripe.android.model | ||
|
||
import android.os.Parcelable | ||
import androidx.annotation.RestrictTo | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) | ||
@Parcelize | ||
class ConsumerPaymentDetailsUpdateParams( | ||
val id: String, | ||
val isDefault: Boolean? = null, | ||
val cardPaymentMethodCreateParams: PaymentMethodCreateParams? = null | ||
) : StripeParamsModel, Parcelable { | ||
|
||
override fun toParamMap(): Map<String, Any> { | ||
val params: MutableMap<String, Any> = mutableMapOf() | ||
|
||
isDefault?.let { params["is_default"] = it } | ||
|
||
cardPaymentMethodCreateParams?.toParamMap()?.let { map -> | ||
(map["card"] as? Map<*, *>)?.let { card -> | ||
card["exp_month"]?.let { params["exp_month"] = it } | ||
card["exp_year"]?.let { params["exp_year"] = it } | ||
} | ||
ConsumerPaymentDetails.Card.getAddressFromMap(map)?.let { | ||
params[it.first] = it.second | ||
} | ||
} | ||
|
||
return params | ||
} | ||
} |