Skip to content

Commit

Permalink
Merge pull request #19 from cashfree/feature/loader_ui_element_flow_2…
Browse files Browse the repository at this point in the history
….1.16

Feature: UI laoder before order pay
  • Loading branch information
kishan-cashfree authored Jul 3, 2024
2 parents 7287485 + 2318b70 commit b4154a7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

implementation 'com.cashfree.pg:api:2.1.15'
implementation 'com.cashfree.pg:api:2.1.16'

androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/cashfree/sdk_sample/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.cashfree.pg.core.api.upi.CFUPI

data class Config(
// CFSession Inputs
val orderID: String = "order_4303292iMYeI9c7fQnDCXZvt5azb6ezYd",
val paymentSessionID: String = "session_WrhBTuY14P5r1mbQ7IFUhfQbdxHw6cxsNWGivf_XeOXHHvYsNo7Ci6uJQzQVMUk2AbcM8NKDjeTkREnhXA-YoxC3Zb6gXPLBvk6iZf_XB6H9",
val orderID: String = "order_4303292iSWwBghN1nOebKgo4P87Mg0dAI",
val paymentSessionID: String = "session_2APItsq13elTiiiC9zmxp-jPA_Q9x4LkZaQxI-Zn9hLNrj6VOnEkIZcgRMLD-X8yqOQradKcNYADtLW2FAbsGCPw54b_5v1O_odBF-Ex0o9M",
val environment: CFSession.Environment = CFSession.Environment.SANDBOX,

//Card Payment Inputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ public void doCardPayment(View view) {
.setCard(cfCard)
.build();
cfCardPayment.setTheme(theme);
/**
* To set Loader UI before order pay network call
*/
cfCardPayment.setLoaderEnable(true);

CFCorePaymentGatewayService.getInstance().doPayment(ElementCheckoutActivity.this, cfCardPayment);
} catch (CFException exception) {
exception.printStackTrace();
Expand Down Expand Up @@ -183,6 +188,10 @@ public void doCardEMIPayment(View view) {
.setCard(cfCard)
.build();
cfCardPayment.setTheme(theme);
/**
* To set Loader UI before order pay network call
*/
cfCardPayment.setLoaderEnable(true);
CFCorePaymentGatewayService.getInstance().doPayment(ElementCheckoutActivity.this, cfCardPayment);
} catch (CFException exception) {
exception.printStackTrace();
Expand Down Expand Up @@ -214,6 +223,10 @@ public void doNetBankingPayment(View view) {
.setCfNetBanking(cfNetBanking)
.build();
cfNetBankingPayment.setTheme(theme);
/**
* To set Loader UI before order pay network call
*/
cfNetBankingPayment.setLoaderEnable(true);
CFCorePaymentGatewayService.getInstance().doPayment(ElementCheckoutActivity.this, cfNetBankingPayment);
} catch (CFException exception) {
exception.printStackTrace();
Expand Down Expand Up @@ -253,6 +266,10 @@ public void doWalletPayment(View view) {
.setCfWallet(cfWallet)
.build();
cfWalletPayment.setTheme(theme);
/**
* To set Loader UI before order pay network call
*/
cfWalletPayment.setLoaderEnable(true);
CFCorePaymentGatewayService.getInstance().doPayment(ElementCheckoutActivity.this, cfWalletPayment);
} catch (CFException exception) {
exception.printStackTrace();
Expand Down Expand Up @@ -284,6 +301,10 @@ public void doPayLaterPayment(View view) {
.setCfPayLater(cfPayLater)
.build();
cfPayLaterPayment.setTheme(theme);
/**
* To set Loader UI before order pay network call
*/
cfPayLaterPayment.setLoaderEnable(true);
CFCorePaymentGatewayService.getInstance().doPayment(ElementCheckoutActivity.this, cfPayLaterPayment);
} catch (CFException exception) {
exception.printStackTrace();
Expand Down Expand Up @@ -336,6 +357,10 @@ private void initiatePayment(CFUPI.Mode mode, String id) {
.setCfUPI(cfupi)
.build();
cfupiPayment.setTheme(theme);
/**
* To set Loader UI before order pay network call
*/
cfupiPayment.setLoaderEnable(true);
CFCorePaymentGatewayService.getInstance().doPayment(ElementCheckoutActivity.this, cfupiPayment);
} catch (CFException exception) {
exception.printStackTrace();
Expand Down

0 comments on commit b4154a7

Please sign in to comment.