Skip to content

Commit

Permalink
Android SKD version updated v2.1.20, SDK source info updated (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
kishan-cashfree authored Sep 17, 2024
1 parent 0f7c7b7 commit b80c56c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.gridlayout:gridlayout:1.0.0'

implementation 'com.cashfree.pg:api:2.1.17'
implementation 'com.cashfree.pg:api:2.1.20'

implementation "com.facebook.react:react-native:+" // From node_modules
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void doUPIPayment(String cfPaymentString) {
Activity activity = getCurrentActivity();
CFUPIIntentCheckoutPayment cfupiIntentCheckoutPayment = DropPaymentParser.getUPICheckoutPayment(cfPaymentString);
cfupiIntentCheckoutPayment.setCfsdkFramework(CFPayment.CFSDKFramework.REACT_NATIVE);
cfupiIntentCheckoutPayment.setCfSDKFlavour(CFPayment.CFSDKFlavour.DROP);
cfupiIntentCheckoutPayment.setCfSDKFlavour(CFPayment.CFSDKFlavour.INTENT);
if (activity != null) {
CFPaymentGatewayService.getInstance().doPayment(activity, cfupiIntentCheckoutPayment);
} else {
Expand Down Expand Up @@ -149,6 +149,7 @@ public void doCardPayment(String data) {
.setCardExpiryMonth(cardObject.getString("cardExpiryMM"))
.setCardExpiryYear(cardObject.getString("cardExpiryYY"))
.setCVV(cardObject.getString("cardCvv"))
.setChannel("post")
.build();
}
} catch (Exception exception) {
Expand All @@ -161,6 +162,7 @@ public void doCardPayment(String data) {
.setCard(card)
.setSaveCardDetail(saveCard)
.build();
cardPayment.setCfSDKFlow(CFPayment.CFSDKFlow.WITH_CASHFREE_FULLSCREEN_LOADER);
cardPayment.setCfsdkFramework(CFPayment.CFSDKFramework.REACT_NATIVE);
cardPayment.setCfSDKFlavour(CFPayment.CFSDKFlavour.ELEMENT);
if (activity != null) {
Expand Down Expand Up @@ -225,6 +227,9 @@ public void doElementUPIPayment(String upiPaymentData) {
.setSession(cfSession)
.setCfUPI(cfupi)
.build();
cfupiPayment.setCfSDKFlow(CFPayment.CFSDKFlow.WITH_CASHFREE_FULLSCREEN_LOADER);
cfupiPayment.setCfsdkFramework(CFPayment.CFSDKFramework.REACT_NATIVE);
cfupiPayment.setCfSDKFlavour(CFPayment.CFSDKFlavour.ELEMENT);
Activity activity = getCurrentActivity();
if (activity != null) {
CFCorePaymentGatewayService.getInstance().doPayment(activity, cfupiPayment);
Expand Down
2 changes: 1 addition & 1 deletion example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export default class App extends Component {
}
};
render() {
let cfCard = React.createElement(CFCard, { cfSession: this.getSession(), style: { flex: 1 }, cardListener: this.handleCFCardInput, placeholder: 'Enter Card Number', placeholderTextColor: '#0000ff', underlineColorAndroid: 'transparent', cursorColor: 'gray', returnKeyType: 'next', ref: this.creditCardRef, onSubmitEditing: (e) => console.log('onSubmitEditing', e.nativeEvent.text, '::', e.target.value), onEndEditing: (e) => console.log('onEndEditing', e.nativeEvent.text, '::', e.target.value), onBlur: (e) => console.log('onBlur', e.nativeEvent.text, '::', e.target.value), onFocus: (e) => console.log('onFocus', e.nativeEvent.text, '::', e.target.value), onSelectionchange: (e) => console.log('onSelectionchange', e.nativeEvent.text, '::', e.target.value), onKeyPress: (e) => console.log('onSelectionchange', e.nativeEvent.text, '::', e.target.value) });
let cfCard = React.createElement(CFCard, { cfSession: this.getSession(), style: { flex: 1 }, cardListener: this.handleCFCardInput, placeholder: 'Enter Card Number', placeholderTextColor: '#0000ff', underlineColorAndroid: 'transparent', cursorColor: 'gray', returnKeyType: 'next', ref: this.creditCardRef, onSubmitEditing: (e) => console.log('onSubmitEditing'), onEndEditing: (e) => console.log('onEndEditing'), onBlur: (e) => console.log('onBlur'), onFocus: (e) => console.log('onFocus') });
return (React.createElement(ScrollView, null,
React.createElement(View, { style: styles.container },
React.createElement(View, { style: {
Expand Down
1 change: 0 additions & 1 deletion src/Card/CFCardComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ const CardInput = forwardRef(({ cfSession, cardListener, style, ...props }, ref)
const doPayment = (cardInfo) => {
try {
cardInfo.cardNumber = inputNumber.replaceAll(' ', '');
console.log('NonPciCard', JSON.stringify(cardInfo));
const cardPayment = new CFCardPayment(cfSession, cardInfo);
CFPaymentGatewayService.makePayment(cardPayment);
}
Expand Down

0 comments on commit b80c56c

Please sign in to comment.