Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Card implement Parcelable #1777

Merged
merged 1 commit into from
Nov 1, 2019
Merged
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
7 changes: 5 additions & 2 deletions stripe/src/main/java/com/stripe/android/model/Card.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.stripe.android.model

import android.os.Parcelable
import androidx.annotation.DrawableRes
import androidx.annotation.IntRange
import androidx.annotation.Size
Expand All @@ -13,13 +14,15 @@ import com.stripe.android.model.StripeJsonUtils.optHash
import com.stripe.android.model.StripeJsonUtils.optInteger
import com.stripe.android.model.StripeJsonUtils.optString
import java.util.Calendar
import kotlinx.android.parcel.Parcelize
import org.json.JSONException
import org.json.JSONObject

/**
* A model object representing a Card in the Android SDK.
*/
data class Card private constructor(
@Parcelize
data class Card internal constructor(

/**
* @return the [number] of this card
Expand Down Expand Up @@ -149,7 +152,7 @@ data class Card private constructor(
* @return the [metadata] of this card
*/
val metadata: Map<String, String>?
) : StripeModel(), StripePaymentSource, StripeParamsModel {
) : StripeModel(), StripePaymentSource, StripeParamsModel, Parcelable {

@Retention(AnnotationRetention.SOURCE)
@StringDef(CardBrand.AMERICAN_EXPRESS, CardBrand.DISCOVER, CardBrand.JCB,
Expand Down