Skip to content

Commit

Permalink
chore: restore payment sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanskar2001 committed Feb 7, 2025
1 parent 3a404ec commit 5c305aa
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package io.hyperswitch.paymentsheet

import android.app.Activity
import android.app.Fragment
import android.content.res.ColorStateList
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.os.Parcelable
import androidx.annotation.ColorInt
import androidx.annotation.FontRes
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import android.support.annotation.ColorInt
import android.support.annotation.FontRes
import android.support.annotation.RequiresApi
import kotlinx.parcelize.Parcelize

/**
Expand All @@ -26,7 +26,7 @@ class PaymentSheet internal constructor(
* @param callback called with the result of the payment after the payment sheet is dismissed.
*/
constructor(
activity: FragmentActivity,
activity: Activity,
callback: PaymentSheetResultCallback
) : this(
DefaultPaymentSheetLauncher(activity, callback)
Expand Down Expand Up @@ -185,7 +185,6 @@ class PaymentSheet internal constructor(
putString("merchantDisplayName", merchantDisplayName)
putBundle("customer", customer?.bundle)
putBundle("googlePay", googlePay?.bundle)
putString("deviceBrand", Build.BRAND)
putBundle("defaultBillingDetails", defaultBillingDetails?.bundle)
putBundle("shippingDetails", shippingDetails?.bundle)
putBoolean("allowsDelayedPaymentMethods", allowsDelayedPaymentMethods)
Expand Down Expand Up @@ -510,6 +509,7 @@ class PaymentSheet internal constructor(
return "#" + s.substring(3) + s.substring(1, 3)
}

@RequiresApi(Build.VERSION_CODES.O)
constructor(
primary: Color? = null,
surface: Color? = null,
Expand Down Expand Up @@ -569,6 +569,7 @@ class PaymentSheet internal constructor(
return "#" + s.substring(3) + s.substring(1, 3)
}

@RequiresApi(Build.VERSION_CODES.O)
constructor(
color: Color?,
intensity: Float?
Expand Down Expand Up @@ -700,6 +701,7 @@ class PaymentSheet internal constructor(
}
}

@RequiresApi(Build.VERSION_CODES.O)
constructor(
background: Color?,
onBackground: Color?,
Expand Down Expand Up @@ -1052,7 +1054,7 @@ class PaymentSheet internal constructor(
*/
@JvmStatic
fun create(
activity: FragmentActivity,
activity: Activity,
paymentOptionCallback: PaymentOptionCallback,
paymentResultCallback: PaymentSheetResultCallback
): FlowController {
Expand Down

0 comments on commit 5c305aa

Please sign in to comment.