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

Google Pay improvements #1853

Open
wants to merge 44 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e3be930
Add play services coroutines
OscarSpruit May 14, 2024
555b670
Setup wrapper view and fragment for Google Pay
OscarSpruit May 15, 2024
d36f0b5
Implement new Google Pay flow
OscarSpruit May 15, 2024
1044631
Implement new flow in examples
OscarSpruit May 15, 2024
bf5d79f
Improve compose example
OscarSpruit May 15, 2024
335d62f
Use new flow in drop-in
OscarSpruit Jun 10, 2024
fbb5d24
Deprecate old methods
OscarSpruit Jun 10, 2024
5fc6b54
Use a flow to trigger the payment data launcher
OscarSpruit Jun 13, 2024
a046909
Use submit() to start Google Pay flow
OscarSpruit Jun 13, 2024
ab81227
Move PaymentsClient to constructor
OscarSpruit Jun 13, 2024
63ec39b
Add release note
OscarSpruit Jun 13, 2024
5e131bf
Run apiDump
OscarSpruit Jun 24, 2024
ea3eed6
Fix build after rebase
OscarSpruit Sep 20, 2024
bf76474
Add configuration for submit button visibility in Google Pay
OscarSpruit Jun 26, 2024
44b5bc1
Show pay button within component
OscarSpruit Jun 26, 2024
1f1db29
Support blocking interaction for GooglePayComponent
OscarSpruit Oct 10, 2024
095b74d
Add tests for GooglePayComponentParamsMapper
OscarSpruit Oct 10, 2024
865cf62
Add more tests for DefaultGooglePayDelegate
OscarSpruit Oct 10, 2024
66aaf27
Allow to programmatically style the Google Pay button
OscarSpruit Oct 11, 2024
191eca8
Allow styling of Google Pay button through XML
OscarSpruit Oct 11, 2024
d78cbd0
Add kdocs to public api
OscarSpruit Oct 11, 2024
91ced7b
Dump public api
OscarSpruit Oct 11, 2024
415953a
Automatically use dark/light button theme based on app theme
OscarSpruit Oct 15, 2024
7094661
Display toolbar in drop-in Google Pay fragment
OscarSpruit Oct 15, 2024
e1da004
Add release note
OscarSpruit Oct 15, 2024
095cc7f
Move Cash apps loading indicator to ui-core
OscarSpruit Oct 16, 2024
3cc83a5
Add translations
OscarSpruit Oct 16, 2024
db1e935
Show loading state in Google Pay
OscarSpruit Oct 18, 2024
bac4adf
Show loading state in Twint
OscarSpruit Oct 18, 2024
b5be457
Show loading state in iDeal
OscarSpruit Oct 18, 2024
7ed1883
Show loading state in instant payments
OscarSpruit Oct 18, 2024
2d18d3c
Remove loading indicator of internal GooglePayFragment
OscarSpruit Oct 23, 2024
0e34a06
Add release note about changed styles and strings
OscarSpruit Oct 23, 2024
327085a
Correct deprecation messages
OscarSpruit Oct 30, 2024
6e4e598
Add coroutine scope to PayButton initialization
OscarSpruit Oct 30, 2024
65fa8ed
Extract Google Pay availability into new class
OscarSpruit Oct 30, 2024
3610c99
Check Google Pay availability when creating the component
OscarSpruit Oct 30, 2024
68f2456
Hide Google Pay button when Google Pay is unavailable
OscarSpruit Oct 30, 2024
0c7b002
Convert ResultState into a data class
OscarSpruit Oct 30, 2024
a7620ed
Remove manual availability check from example integration
OscarSpruit Oct 30, 2024
bf0847c
Use output data to manage internal state
OscarSpruit Oct 30, 2024
e65d1d5
Dump public api spec
OscarSpruit Oct 31, 2024
9152ea3
Add docs for Google Pay
OscarSpruit Nov 5, 2024
afc18b0
Improve migration guide
OscarSpruit Nov 13, 2024
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
23 changes: 20 additions & 3 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@
[//]: # (## Deprecated)
[//]: # ( - Configurations public constructor are deprecated, please use each Configuration's builder to make a Configuration object)

## New
- Launch Google Pay with `submit()` to get rid of the deprecated activity result handling.
OscarSpruit marked this conversation as resolved.
Show resolved Hide resolved
- For drop-in, show a toolbar on every intermediary screen, so shoppers can always easily navigate back.

## Fixed
- For the Address Lookup functionality:
- Address data is now correctly saved to `PaymentComponentData`.
- Address fields that were edited manually no longer lose their state when starting Lookup mode.

## Improved

## Changed
- Dependency versions:
| Name | Version |
|--------------------------------------------------------------------------------------------------------|-------------------------------|
| | |

## Deprecated
- The styles and strings for the Cash App Pay loading indicator. Use the new styles and strings instead.
| Previous | Now |
|-----------------------------------------------------------|------------------------------------------------------------------|
| `AdyenCheckout.CashAppPay.ProgressBar` | `AdyenCheckout.ProcessingPaymentView.ProgressBar` |
| `AdyenCheckout.CashAppPay.WaitingDescriptionTextView` | `AdyenCheckout.ProcessingPaymentView.WaitingDescriptionTextView` |
| `cash_app_pay_waiting_text` | `checkout_processing_payment` |
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ package com.adyen.checkout.cashapppay.internal.ui
import android.content.Context
import com.adyen.checkout.cashapppay.internal.ui.view.CashAppPayButtonView
import com.adyen.checkout.cashapppay.internal.ui.view.CashAppPayView
import com.adyen.checkout.cashapppay.internal.ui.view.CashAppPayWaitingView
import com.adyen.checkout.ui.core.internal.ui.ButtonComponentViewType
import com.adyen.checkout.ui.core.internal.ui.ButtonViewProvider
import com.adyen.checkout.ui.core.internal.ui.ComponentView
import com.adyen.checkout.ui.core.internal.ui.ComponentViewType
import com.adyen.checkout.ui.core.internal.ui.ViewProvider
import com.adyen.checkout.ui.core.internal.ui.view.PayButton
import com.adyen.checkout.ui.core.internal.ui.view.ProcessingPaymentView

internal object CashAppPayViewProvider : ViewProvider {

Expand All @@ -26,7 +26,7 @@ internal object CashAppPayViewProvider : ViewProvider {
context: Context,
): ComponentView = when (viewType) {
CashAppPayComponentViewType -> CashAppPayView(context)
PaymentInProgressViewType -> CashAppPayWaitingView(context)
PaymentInProgressViewType -> ProcessingPaymentView(context)
else -> throw IllegalArgumentException("Unsupported view type")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import com.adyen.checkout.cashapppay.databinding.CashAppPayButtonViewBinding
import com.adyen.checkout.ui.core.internal.ui.ButtonDelegate
import com.adyen.checkout.ui.core.internal.ui.view.PayButton
import kotlinx.coroutines.CoroutineScope

internal class CashAppPayButtonView @JvmOverloads constructor(
context: Context,
Expand All @@ -22,6 +24,8 @@ internal class CashAppPayButtonView @JvmOverloads constructor(

private val binding = CashAppPayButtonViewBinding.inflate(LayoutInflater.from(context), this)

override fun initialize(delegate: ButtonDelegate, coroutineScope: CoroutineScope) = Unit

override fun setEnabled(enabled: Boolean) {
binding.payButton.isEnabled = enabled
}
Expand Down
1 change: 0 additions & 1 deletion cashapppay/src/main/res/template/values/strings.xml.tt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">%%storeDetails%%</string>
<string name="cash_app_pay_waiting_text">%%paypal.processingPayment%%</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">حفظ لمدفوعاتي القادمة</string>
<string name="cash_app_pay_waiting_text">جارِ معالجة المدفوعات…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-bg-rBG/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Запазване за следващото ми плащане</string>
<string name="cash_app_pay_waiting_text">Обработка на плащането…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-ca-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Desa\'l per al meu proper pagament</string>
<string name="cash_app_pay_waiting_text">S\'esta processant el pagament…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Uložit pro příští platby</string>
<string name="cash_app_pay_waiting_text">Zpracování platby…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-da-rDK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Gem til min næste betaling</string>
<string name="cash_app_pay_waiting_text">Behandler betaling…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Für zukünftige Zahlvorgänge speichern</string>
<string name="cash_app_pay_waiting_text">Zahlung wird verarbeitet…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-el-rGR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Αποθήκευση για την επόμενη πληρωμή μου</string>
<string name="cash_app_pay_waiting_text">Επεξεργασία πληρωμής…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-es-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Recordar para mi próximo pago</string>
<string name="cash_app_pay_waiting_text">Procesando pago…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-et-rEE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Salvesta mu järgmise makse jaoks</string>
<string name="cash_app_pay_waiting_text">Makse töötlemine …</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-fi-rFI/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Tallenna seuraavaa maksuani varten</string>
<string name="cash_app_pay_waiting_text">Maksua käsitellään…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-fr-rFR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Sauvegarder pour mon prochain paiement</string>
<string name="cash_app_pay_waiting_text">Traitement du paiement en cours…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-hr-rHR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Pohrani za moje sljedeće plaćanje</string>
<string name="cash_app_pay_waiting_text">Obrada plaćanja u tijeku…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-hu-rHU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Mentés a következő fizetéshez</string>
<string name="cash_app_pay_waiting_text">Fizetés feldolgozása…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-is-rIS/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Spara fyrir næstu greiðslu</string>
<string name="cash_app_pay_waiting_text">Unnið úr greiðslu…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-it-rIT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Salva per il prossimo pagamento</string>
<string name="cash_app_pay_waiting_text">Elaborazione del pagamento in corso…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-ja-rJP/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">次回のお支払いのため詳細を保存</string>
<string name="cash_app_pay_waiting_text">支払いを処理しています…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-ko-rKR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">다음 결제를 위해 이 수단 저장</string>
<string name="cash_app_pay_waiting_text">결제 처리 중…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-lt-rLT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Išsaugoti kitam mokėjimui</string>
<string name="cash_app_pay_waiting_text">Mokėjimas apdorojamas…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-lv-rLV/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Saglabāt manam nākamajam maksājumam</string>
<string name="cash_app_pay_waiting_text">Notiek maksājuma apstrāde…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-nb-rNO/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Lagre til min neste betaling</string>
<string name="cash_app_pay_waiting_text">Behandler betaling…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-nl-rNL/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Bewaar voor mijn volgende betaling</string>
<string name="cash_app_pay_waiting_text">Betaling wordt verwerkt…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-pl-rPL/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Zapisz na potrzeby następnej płatności</string>
<string name="cash_app_pay_waiting_text">Przetwarzanie płatności…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Salvar para meu próximo pagamento</string>
<string name="cash_app_pay_waiting_text">Processando pagamento…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-pt-rPT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Guardar para o meu próximo pagamento</string>
<string name="cash_app_pay_waiting_text">A processar pagamento…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-ro-rRO/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Salvează pentru următoarea mea plată</string>
<string name="cash_app_pay_waiting_text">Se prelucrează plata…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-ru-rRU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Сохранить для следующего платежа</string>
<string name="cash_app_pay_waiting_text">Платеж обрабатывается…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-sk-rSK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Uložiť pre moju ďalšiu platbu</string>
<string name="cash_app_pay_waiting_text">Platba sa spracúva.</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-sl-rSI/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Shrani za moje naslednje plačilo</string>
<string name="cash_app_pay_waiting_text">Obdelava plačila…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-sv-rSE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Spara till min nästa betalning</string>
<string name="cash_app_pay_waiting_text">Behandlar betalning…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">保存以便下次支付使用</string>
<string name="cash_app_pay_waiting_text">正在处理付款…</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">儲存以供下次付款使用</string>
<string name="cash_app_pay_waiting_text">正在處理付款……</string>
</resources>
1 change: 0 additions & 1 deletion cashapppay/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

<resources>
<string name="cash_app_pay_store_payment_method">Save for my next payment</string>
<string name="cash_app_pay_waiting_text">Processing payment…</string>
</resources>
13 changes: 0 additions & 13 deletions cashapppay/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,5 @@
<item name="android:textSize">18sp</item>
</style>

<style name="AdyenCheckout.CashAppPay.ProgressBar">
<item name="android:layout_width">24dp</item>
<item name="android:layout_height">24dp</item>
<item name="android:indeterminateTint">?android:attr/colorPrimary</item>
</style>

<style name="AdyenCheckout.CashAppPay.WaitingDescriptionTextView">
<item name="android:text">@string/cash_app_pay_waiting_text</item>
<item name="android:textIsSelectable">false</item>
<item name="android:layout_marginStart">8dp</item>
<item name="android:layout_marginEnd">8dp</item>
</style>

<style name="AdyenCheckout.CashAppPay.Button" parent="CAPButtonStyle.Light" />
</resources>
5 changes: 5 additions & 0 deletions components-core/api/components-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,11 @@ public final class com/adyen/checkout/components/core/PaymentMethodTypes {
public final fun getUNSUPPORTED_PAYMENT_METHODS ()Ljava/util/List;
}

public class com/adyen/checkout/components/core/PaymentMethodUnavailableException : com/adyen/checkout/core/exception/CheckoutException {
public fun <init> (Ljava/lang/String;Ljava/lang/Throwable;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
}

public final class com/adyen/checkout/components/core/PaymentMethodsApiResponse : com/adyen/checkout/core/internal/data/model/ModelObject {
public static final field CREATOR Landroid/os/Parcelable$Creator;
public static final field Companion Lcom/adyen/checkout/components/core/PaymentMethodsApiResponse$Companion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
*/
package com.adyen.checkout.components.core

interface ComponentAvailableCallback {
fun interface ComponentAvailableCallback {
fun onAvailabilityResult(isAvailable: Boolean, paymentMethod: PaymentMethod)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2024 Adyen N.V.
*
* This file is open source and available under the MIT license. See the LICENSE file for more info.
*
* Created by oscars on 30/10/2024.
*/

package com.adyen.checkout.components.core

import com.adyen.checkout.core.exception.CheckoutException

open class PaymentMethodUnavailableException(
message: String,
cause: Throwable? = null
) : CheckoutException(message, cause)
Loading