Skip to content

Commit

Permalink
Remove obsolete citi and ocbc (#312)
Browse files Browse the repository at this point in the history
* Remove ocbc_pao

* Remove ocbc_pao assets

* Remove citi_installment

* Remove citi_installment assets

* Fix unit tests

* Format
  • Loading branch information
AnasNaouchi authored Feb 15, 2024
1 parent ec6efca commit cf0466a
Show file tree
Hide file tree
Showing 26 changed files with 25 additions and 80 deletions.
4 changes: 0 additions & 4 deletions app/src/main/java/co/omise/android/example/PaymentSetting.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ object PaymentSetting {
R.string.payment_preference_installment_ktc_key,
R.string.payment_preference_installment_kbank_key,
R.string.payment_preference_installment_scb_key,
R.string.payment_preference_installment_citi_key,
R.string.payment_preference_installment_ttb_key,
R.string.payment_preference_installment_uob_key,
R.string.payment_preference_alipay_key,
Expand All @@ -40,7 +39,6 @@ object PaymentSetting {
R.string.payment_preference_fpx_key,
R.string.payment_preference_gcash_key,
R.string.payment_preference_kakaopay_key,
R.string.payment_preference_ocbc_pao_key,
R.string.payment_preference_ocbc_digital_key,
R.string.payment_preference_paynow_key,
R.string.payment_preference_promptpay_key,
Expand Down Expand Up @@ -85,7 +83,6 @@ object PaymentSetting {
context.getString(R.string.payment_preference_mobile_banking_bbl_key) -> SourceType.MobileBanking.Bbl
context.getString(R.string.payment_preference_mobile_banking_kbank_key) -> SourceType.MobileBanking.KBank
context.getString(R.string.payment_preference_mobile_banking_ktb_key) -> SourceType.MobileBanking.KTB
context.getString(R.string.payment_preference_ocbc_pao_key) -> SourceType.OcbcPao
context.getString(R.string.payment_preference_ocbc_digital_key) -> SourceType.OcbcDigital
context.getString(R.string.payment_preference_mobile_banking_scb_key) -> SourceType.MobileBanking.Scb
context.getString(R.string.payment_preference_installment_bay_key) -> SourceType.Installment.Bay
Expand All @@ -95,7 +92,6 @@ object PaymentSetting {
context.getString(R.string.payment_preference_installment_ktc_key) -> SourceType.Installment.Ktc
context.getString(R.string.payment_preference_installment_kbank_key) -> SourceType.Installment.KBank
context.getString(R.string.payment_preference_installment_scb_key) -> SourceType.Installment.Scb
context.getString(R.string.payment_preference_installment_citi_key) -> SourceType.Installment.Citi
context.getString(R.string.payment_preference_installment_ttb_key) -> SourceType.Installment.Ttb
context.getString(R.string.payment_preference_installment_uob_key) -> SourceType.Installment.Uob
context.getString(R.string.payment_preference_econtext_key) -> SourceType.Econtext
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<string name="payment_preference_mobile_banking_bbl_key" translatable="false">mobile_banking_bbl</string>
<string name="payment_preference_mobile_banking_kbank_key" translatable="false">mobile_banking_kbank</string>
<string name="payment_preference_mobile_banking_ktb_key" translatable="false">mobile_banking_ktb</string>
<string name="payment_preference_ocbc_pao_key" translatable="false">mobile_banking_ocbc_pao</string>
<string name="payment_preference_ocbc_digital_key" translatable="false">mobile_banking_ocbc</string>
<string name="payment_preference_installment_bay_key" translatable="false">installment_bay</string>
<string name="payment_preference_installment_first_choice_key" translatable="false">installment_first_choice</string>
Expand All @@ -37,7 +36,6 @@
<string name="payment_preference_installment_ktc_key" translatable="false">installment_ktc</string>
<string name="payment_preference_installment_kbank_key" translatable="false">installment_kbank</string>
<string name="payment_preference_installment_scb_key" translatable="false">installment_scb</string>
<string name="payment_preference_installment_citi_key" translatable="false">installment_citi</string>
<string name="payment_preference_installment_ttb_key" translatable="false">installment_ttb</string>
<string name="payment_preference_installment_uob_key" translatable="false">installment_uob</string>
<string name="payment_preference_dana_key" translatable="false">dana</string>
Expand Down Expand Up @@ -75,7 +73,6 @@
<string name="payment_preference_mobile_banking_scb_title" translatable="false">SCB - Mobile Banking</string>
<string name="payment_preference_mobile_banking_kbank_title" translatable="false">KBANK - Mobile Banking</string>
<string name="payment_preference_mobile_banking_ktb_title" translatable="false">KTB - Mobile Banking</string>
<string name="payment_preference_ocbc_pao_title" translatable="false">OCBC Pay Anyone</string>
<string name="payment_preference_ocbc_digital_title" translatable="false">OCBC Digital</string>
<string name="payment_preference_internet_banking_bay_title" translatable="false">BAY - Internet Banking</string>
<string name="payment_preference_internet_banking_bbl_title" translatable="false">BBL - Internet Banking</string>
Expand All @@ -90,7 +87,6 @@
<string name="payment_preference_installment_ktc_title" translatable="false">KTC - Installment</string>
<string name="payment_preference_installment_kbank_title" translatable="false">Kasikorn - Installment</string>
<string name="payment_preference_installment_scb_title" translatable="false">Siam Commercial - Installment</string>
<string name="payment_preference_installment_citi_title" translatable="false">Citi - Installment</string>
<string name="payment_preference_installment_ttb_title" translatable="false">TMBThanachart - Installment</string>
<string name="payment_preference_installment_uob_title" translatable="false">UOB - Installment</string>
<string name="payment_preference_dana_title" translatable="false">DANA</string>
Expand Down
10 changes: 0 additions & 10 deletions app/src/main/res/xml/preference_payment_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@
app:key="@string/payment_preference_installment_scb_key"
app:title="@string/payment_preference_installment_scb_title" />

<CheckBoxPreference
app:defaultValue="true"
app:key="@string/payment_preference_installment_citi_key"
app:title="@string/payment_preference_installment_citi_title" />

<CheckBoxPreference
app:defaultValue="true"
app:key="@string/payment_preference_installment_ttb_key"
Expand Down Expand Up @@ -188,11 +183,6 @@
app:key="@string/payment_preference_rabbit_linepay_key"
app:title="@string/payment_preference_rabbit_linepay_title" />

<CheckBoxPreference
app:defaultValue="true"
app:key="@string/payment_preference_ocbc_pao_key"
app:title="@string/payment_preference_ocbc_pao_title" />

<CheckBoxPreference
app:defaultValue="true"
app:key="@string/payment_preference_ocbc_digital_key"
Expand Down
8 changes: 0 additions & 8 deletions sdk/src/main/java/co/omise/android/models/SourceType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ sealed class SourceType(

object RabbitLinePay : SourceType("rabbit_linepay")

object OcbcPao : SourceType("mobile_banking_ocbc_pao")

object OcbcDigital : SourceType("mobile_banking_ocbc")

object Boost : SourceType("boost")
Expand Down Expand Up @@ -123,8 +121,6 @@ sealed class SourceType(

object Scb : Installment("installment_scb")

object Citi : Installment("installment_citi")

object Ttb : Installment("installment_ttb")

object Uob : Installment("installment_uob")
Expand All @@ -143,7 +139,6 @@ sealed class SourceType(
Ktc -> listOf(3, 4, 5, 6, 7, 8, 9, 10)
KBank -> listOf(3, 4, 6, 10)
Scb -> listOf(3, 4, 6, 9, 10)
Citi -> listOf(4, 5, 6, 7, 8, 9, 10)
Ttb -> listOf(3, 4, 6, 10, 12)
Uob -> listOf(3, 4, 6, 10)
is Unknown -> emptyList()
Expand Down Expand Up @@ -178,7 +173,6 @@ sealed class SourceType(
"installment_ktc" -> Installment.Ktc
"installment_kbank" -> Installment.KBank
"installment_scb" -> Installment.Scb
"installment_citi" -> Installment.Citi
"installment_ttb" -> Installment.Ttb
"installment_uob" -> Installment.Uob
"points_citi" -> PointsCiti
Expand All @@ -191,7 +185,6 @@ sealed class SourceType(
"kakaopay" -> Kakaopay
"touch_n_go" -> TouchNGo()
"rabbit_linepay" -> RabbitLinePay
"mobile_banking_ocbc_pao" -> OcbcPao
"mobile_banking_ocbc" -> OcbcDigital
"boost" -> Boost
"shopeepay" -> ShopeePay
Expand Down Expand Up @@ -240,7 +233,6 @@ val SourceType.Companion.allElements: List<SourceType>
SourceType.Installment.KBank,
SourceType.PointsCiti,
SourceType.Installment.Scb,
SourceType.Installment.Citi,
SourceType.Installment.Ttb,
SourceType.Installment.Uob,
SourceType.Atome,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ internal class PaymentChooserFragment : OmiseListFragment<PaymentMethodResource>
PaymentMethodResource.Kakaopay,
PaymentMethodResource.TouchNGo,
PaymentMethodResource.RabbitLinepay,
PaymentMethodResource.OcbcPao,
PaymentMethodResource.OcbcDigital,
PaymentMethodResource.Boost,
PaymentMethodResource.ShopeePay,
Expand Down
18 changes: 2 additions & 16 deletions sdk/src/main/java/co/omise/android/ui/PaymentMethodResources.kt
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,6 @@ internal sealed class PaymentMethodResource(
sourceType = SourceType.RabbitLinePay,
)

object OcbcPao : PaymentMethodResource(
iconRes = R.drawable.payment_ocbc_pao,
titleRes = R.string.payment_method_mobile_banking_ocbc_pao_title,
indicatorIconRes = R.drawable.ic_redirect,
sourceType = SourceType.OcbcPao,
)

object OcbcDigital : PaymentMethodResource(
iconRes = R.drawable.payment_ocbc_digital,
titleRes = R.string.payment_method_ocbc_digital_title,
Expand Down Expand Up @@ -432,13 +425,6 @@ internal sealed class InstallmentResource(
sourceType = SourceType.Installment.Scb,
)

object Citi : InstallmentResource(
iconRes = R.drawable.payment_citi,
titleRes = R.string.payment_method_installment_citi_title,
indicatorIconRes = R.drawable.ic_next,
sourceType = SourceType.Installment.Citi,
)

object Ttb : InstallmentResource(
iconRes = R.drawable.payment_ttb,
titleRes = R.string.payment_method_installment_ttb_title,
Expand Down Expand Up @@ -566,7 +552,7 @@ internal class FpxResource(
"kfh" -> R.drawable.payment_kfh
"maybank2e" -> R.drawable.payment_maybank
"maybank2u" -> R.drawable.payment_maybank
"ocbc" -> R.drawable.payment_ocbc
"ocbc" -> R.drawable.payment_ocbc_digital
"public" -> R.drawable.payment_publicbank
"rhb" -> R.drawable.payment_rhb
"sc" -> R.drawable.payment_sc
Expand Down Expand Up @@ -603,7 +589,7 @@ internal class DuitNowOBWResource(
"hsbc" -> R.drawable.payment_hsbc
"kfh" -> R.drawable.payment_kfh
"maybank2u" -> R.drawable.payment_maybank
"ocbc" -> R.drawable.payment_ocbc
"ocbc" -> R.drawable.payment_ocbc_digital
"public" -> R.drawable.payment_publicbank
"rhb" -> R.drawable.payment_rhb
"sc" -> R.drawable.payment_sc
Expand Down
Binary file removed sdk/src/main/res/drawable-hdpi/payment_citi.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-hdpi/payment_ocbc.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-hdpi/payment_ocbc_pao.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-mdpi/payment_citi.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-mdpi/payment_ocbc.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-mdpi/payment_ocbc_pao.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-xhdpi/payment_citi.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-xhdpi/payment_ocbc.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-xhdpi/payment_ocbc_pao.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-xxhdpi/payment_citi.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-xxhdpi/payment_ocbc.png
Binary file not shown.
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-xxxhdpi/payment_citi.png
Binary file not shown.
Binary file removed sdk/src/main/res/drawable-xxxhdpi/payment_ocbc.png
Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions sdk/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
<string name="payment_method_internet_banking_bay_title">アユタヤ銀行</string>
<string name="payment_method_internet_banking_bbl_title">バンコク銀行</string>
<string name="payment_method_mobile_banking_scb_title">SCB EASY</string>
<string name="payment_method_installment_citi_title">シティバンク</string>
<string name="payment_method_installment_ttb_title">TMBタナチャート銀行</string>
<string name="payment_method_installment_uob_title">ユナイテッド・オーバーシーズ銀行</string>
<string name="payment_method_internet_banking_title">インターネットバンク</string>
Expand Down Expand Up @@ -112,7 +111,6 @@
<string name="payment_method_mobile_banking_kbank_title">K PLUS</string>
<string name="payment_method_mobile_banking_ktb_title">Krungthai NEXT</string>
<string name="payment_method_ocbc_digital_title">OCBC Digital</string>
<string name="payment_method_mobile_banking_ocbc_pao_title">OCBC Pay Anyone</string>
<string name="payment_method_mobile_banking_bay_title">KMA</string>
<string name="payment_method_mobile_banking_bbl_title">Bualuang mBanking</string>
<string name="googlepay">Google Pay</string>
Expand Down
2 changes: 0 additions & 2 deletions sdk/src/main/res/values-th/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
<string name="payment_method_installment_kasikorn_title">ธนาคารกสิกรไทย</string>
<string name="payment_method_installment_ktc_title">เคทีซี</string>
<string name="payment_method_installment_scb_title">ธนาคารไทยพาณิชย์</string>
<string name="payment_method_installment_citi_title">ธนาคารซิตี้แบงก์์</string>
<string name="payment_method_installment_ttb_title">ธนาคารทีเอ็มบีธนชาต</string>
<string name="payment_method_installment_uob_title">ธนาคารยูโอบี</string>
<string name="payment_method_installments_title">ผ่อนชำระ</string>
Expand Down Expand Up @@ -112,7 +111,6 @@
<string name="payment_method_mobile_banking_kbank_title">K PLUS</string>
<string name="payment_method_mobile_banking_ktb_title">Krungthai NEXT</string>
<string name="payment_method_ocbc_digital_title">OCBC Digital</string>
<string name="payment_method_mobile_banking_ocbc_pao_title">OCBC Pay Anyone</string>
<string name="payment_method_mobile_banking_bay_title">KMA</string>
<string name="payment_method_mobile_banking_bbl_title">Bualuang mBanking</string>
<string name="googlepay">Google Pay</string>
Expand Down
2 changes: 0 additions & 2 deletions sdk/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
<string name="payment_method_installment_first_choice_title">Krungsri First Choice</string>
<string name="payment_method_installment_ktc_title">KTC</string>
<string name="payment_method_installment_scb_title">Siam Commercial Bank</string>
<string name="payment_method_installment_citi_title">Citibank</string>
<string name="payment_method_installment_ttb_title">TMBThanachart Bank</string>
<string name="payment_method_installment_uob_title">United Overseas Bank</string>
<string name="payment_method_installment_term_month_title">%d month</string>
Expand All @@ -101,7 +100,6 @@
<string name="payment_method_mobile_banking_kbank_title">K PLUS</string>
<string name="payment_method_mobile_banking_ktb_title">Krungthai NEXT</string>
<string name="payment_method_ocbc_digital_title">OCBC Digital</string>
<string name="payment_method_mobile_banking_ocbc_pao_title">OCBC Pay Anyone</string>

<string name="payment_method_internet_banking_bay_title">Bank of Ayudhya</string>
<string name="payment_method_internet_banking_bbl_title">Bangkok Bank</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class InstallmentChooserFragmentTest {
PaymentMethod(name = "installment_kbank"),
PaymentMethod(name = "installment_ktc"),
PaymentMethod(name = "installment_scb"),
PaymentMethod(name = "installment_citi"),
PaymentMethod(name = "installment_ttb"),
PaymentMethod(name = "installment_uob"),
)
Expand Down Expand Up @@ -75,12 +74,9 @@ class InstallmentChooserFragmentTest {

onView(
withListId(R.id.recycler_view).atPosition(7),
).check(matches(hasDescendant(withText(R.string.payment_method_installment_citi_title))))
onView(
withListId(R.id.recycler_view).atPosition(8),
).check(matches(hasDescendant(withText(R.string.payment_method_installment_ttb_title))))
onView(
withListId(R.id.recycler_view).atPosition(9),
withListId(R.id.recycler_view).atPosition(8),
).check(matches(hasDescendant(withText(R.string.payment_method_installment_uob_title))))

onView(withId(R.id.recycler_view)).check(matches(itemCount(paymentMethods.size)))
Expand Down
Loading

0 comments on commit cf0466a

Please sign in to comment.