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

Override payment method names #1380

Conversation

araratthehero
Copy link
Contributor

@araratthehero araratthehero commented Nov 9, 2023

Description

This change allows merchants to add custom information to payment methods, which will be shown instead of the values received in the payment methods api response.

  • For now we decided to add this functionality only for payment methods. If there is demand, we can support the same functionality for stored payment methods.
  • Additionally now we show the card name (Visa, Mastercard...), instead of Credit Card for stored payment methods.

Here is an example on how merchants can override payment method name when building DropInConfiguration:

DropInConfiguration.Builder(
    shopperLocale,
    environment,
    clientKey,
)
    .addCardConfiguration(getCardConfiguration())
    .addCashAppPayConfiguration(getCashAppPayConfiguration())
    ...
    .overridePaymentMethodName("scheme", "Custom card name")
    .build()

Checklist

  • Code is unit tested
  • Changes are tested manually
  • Link to related issues
  • Add relevant labels to PR

COAND-804

@araratthehero araratthehero added the Feature [PRs only] Indicates a new feature addition label Nov 9, 2023
@araratthehero araratthehero force-pushed the feature/override_payment_method_names_configuration_method branch 6 times, most recently from 4d8ba44 to 59d67e5 Compare November 10, 2023 13:36
@araratthehero araratthehero marked this pull request as ready for review November 10, 2023 13:51
@araratthehero araratthehero requested a review from a team as a code owner November 10, 2023 13:51
Add the necessary logic to override the name field of payment methods

COAND-804
Add tests for overridePaymentMethodInformation function.

COAND-804
COAND-804

diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 5ba0f46de..04bbf7767 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,21 +1,12 @@
 [//]: # (This file will be used for the release notes on GitHub when publishing.)
-[//]: # (Types of changes: `Added` `Changed` `Deprecated` `Removed` `Fixed` `Security`)
+[//]: # (Types of changes: `Breaking changes` `New` `Added` `Changed` `Deprecated` `Removed` `Fixed`)
 [//]: # (Example:)
 [//]: # (## Added)
 [//]: # ( - New payment method)
 [//]: # (## Changed)
 [//]: # ( - DropIn service's package changed from `com.adyen.dropin` to `com.adyen.dropin.services`)
-[//]: # ( # Deprecated)
+[//]: # (## Deprecated)
 [//]: # ( - Configurations public constructor are deprecated, please use each Configuration's builder to make a Configuration object)

-## Fixed
-- `@RestrictTo` annotations no longer cause false errors with Android Studio and Lint.
-- Using the layout inspector or having view attribute inspection enabled in the developer options no longer causes a crash when viewing a payment method.
-- Implementing the `:action` module no longer gives a duplicate class error caused by a duplicate namespace.
-- For Drop-in, dismissing the gift card payment method no longer prevents further interaction.
-
-## Changed
-- Dependency versions:
-  | Name                                                                                                   | Version                       |
-  |--------------------------------------------------------------------------------------------------------|-------------------------------|
-  | [AndroidX Compose BoM](https://developer.android.com/jetpack/compose/bom/bom-mapping)                  | **2023.09.01**                |
+## New
+- You can now override payment method names in drop in by using `DropInConfiguration.Builder.overridePaymentMethodName(type, name)`
@araratthehero araratthehero force-pushed the feature/override_payment_method_names_configuration_method branch from 4326ab8 to e44f359 Compare November 14, 2023 08:35
Copy link
Collaborator

@jreij jreij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@araratthehero araratthehero merged commit 9ebd55e into develop Nov 14, 2023
5 checks passed
@araratthehero araratthehero deleted the feature/override_payment_method_names_configuration_method branch November 14, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature [PRs only] Indicates a new feature addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants