payu-intrepos / PayUCheckoutPro-Android

PayUCheckoutPro SDK for Android
9 stars 9 forks source link

Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject #24

Open WackyCodes opened 2 years ago

WackyCodes commented 2 years ago

Not found any solution!

I've check all the cases and checked many time mkey and salt key. There is no issue from my side but it's sending me same error !

Rahul-Hooda commented 2 years ago

@WackyCodes - Please drop a mail at mobile.integration@payu.in for quick help on this.

abhishekraics001 commented 1 year ago

is this issue been resolved or still pending?

Need help on an urgent basis it's also not mentioned in the document.

I am also facing the same issue with the test environment.

shahfaizalc commented 1 year ago

@abhishekraics001 Please drop a mail at mobile.integration@payu.in for quick help on this.

abhishekraics001 commented 1 year ago

Hi Team,

As I am trying to do the POC about your mobile payment SDK with a test/staging environment but unlucky i am getting errors like below Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

Project Label Gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.6.20" repositories { google() jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:7.3.0' //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { maven {url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"} google() jcenter() } }

task clean(type: Delete) { delete rootProject.buildDir }

App Lable griddle file

plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions' }

//apply plugin: 'kotlin-android-extensions' //apply plugin: 'com.android.application' //apply plugin: 'kotlin-android'

android { compileSdkVersion 33 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.payu.sampleapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" }

dataBinding {
    enabled = true
}
buildFeatures {
    viewBinding = true
}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles

getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' }

namespace 'com.payu.sampleapp'

}

dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'in.payu:payu-checkout-pro:2.0.2' implementation 'com.google.android.material:material:1.3.0' implementation 'in.payu:olamoney:1.2.1' // implementation 'in.payu:phonepe-intent:1.6.2' implementation 'in.payu:payu-gpay:1.5.1' implementation 'in.payu:native-otp-assist:1.3.1'

}

Credentils & Activity

private val email: String = @.***" private val phone = "9999999999" private val merchantName = "RH Group" private val surl = "https://payu.herokuapp.com/success" private val furl = "https://payu.herokuapp.com/failure" private val amount = "1.0"

//Test Key and Salt private val testKey = "DC2ahe" private val testSalt = "bjSejErX5TryGH0FOQVV0mrobKkskgi1"

/**

//Prod Key and Salt private val prodKey = "0MQaQP" private val prodSalt = ""

Thanks & Regards, Abhishek Rai +91- 8130740896

On Mon, 28 Nov 2022 at 19:36, shahfaizalc @.***> wrote:

@abhishekraics001 https://github.com/abhishekraics001 Please drop a mail at @.*** for quick help on this.

— Reply to this email directly, view it on GitHub https://github.com/payu-intrepos/PayUCheckoutPro-Android/issues/24#issuecomment-1329168423, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZRRGXGS2EHE55QKTGYH6DWKS37BANCNFSM5KIWPC4Q . You are receiving this because you were mentioned.Message ID: @.***>

abhishekraics001 commented 1 year ago

Hi Abhishek,

Please set isProduction to true when using Live Key and false when using testing key just set and then check because its related to environment or key salt error.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 28/11/2022 7:46 pm To: @. Cc: @.; @.; @.*** Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team, As I am trying to do the POC about your mobile payment SDK with a test/staging environment but unlucky i am getting errors like below Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject Project Label Gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.6.20" repositories { google() jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:7.3.0' //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { maven {url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"} google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }

App Lable griddle file

plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions' } //apply plugin: 'kotlin-android-extensions' //apply plugin: 'com.android.application' //apply plugin: 'kotlin-android'

android { compileSdkVersion 33 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.payu.sampleapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } dataBinding { enabled = true } buildFeatures { viewBinding = true } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } namespace 'com.payu.sampleapp' } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'in.payu:payu-checkout-pro:2.0.2' implementation 'com.google.android.material:material:1.3.0' implementation 'in.payu:olamoney:1.2.1' // implementation 'in.payu:phonepe-intent:1.6.2' implementation 'in.payu:payu-gpay:1.5.1' implementation 'in.payu:native-otp-assist:1.3.1' }

Credentils & Activity

private val email: String = @." private val phone = "9999999999" private val merchantName = "RH Group" private val surl = "https://payu.herokuapp.com/success" private val furl = "https://payu.herokuapp.com/failure" private val amount = "1.0" //Test Key and Salt private val testKey = "DC2ahe" private val testSalt = "bjSejErX5TryGH0FOQVV0mrobKkskgi1" / Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */ private val merchantAccessKey = "1642e42b3edc6d4e359dc3c090fadd53a336e57d9d79aa1fb3d0857373a082d0" private val merchantSecretKey = "8c896fcbae5a60eda0ed1369c71c4cbdb9f281b952f8e202e9f45aea21bf986d" //Prod Key and Salt private val prodKey = "0MQaQP" private val prodSalt = ""

Thanks & Regards, Abhishek Rai +91- 8130740896 On Mon, 28 Nov 2022 at 19:36, shahfaizalc @.***> wrote:

@abhishekraics001 Please drop a mail at @.*** for quick help on this.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

abhishekraics001 commented 1 year ago

Hi Rishabh,

This flag (isProduction) is there and passing values like true for production and falses for testing but it's still not working.

If possible pls share once test credentials with us for testing purposes.

Thanks & Regards, Abhishek Rai +91- 8130740896

On Tue, 29 Nov 2022 at 10:02, Mobile Integration @.***> wrote:

Hi Abhishek,

Please set isProduction to true when using Live Key and false when using testing key just set and then check because its related to environment or key salt error.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 28/11/2022 7:46 pm To: @. Cc: @.; @.; @.** Subject:* Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team,

As I am trying to do the POC about your mobile payment SDK with a test/staging environment but unlucky i am getting errors like below Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

Project Label Gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { ext.kotlin_version = "1.6.20" repositories { google() jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:7.3.0' //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }} allprojects { repositories { maven {url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"} google() jcenter() }} task clean(type: Delete) { delete rootProject.buildDir}

App Lable griddle file

plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions'}//apply plugin: 'kotlin-android-extensions'//apply plugin: 'com.android.application'//apply plugin: 'kotlin-android'

android { compileSdkVersion 33 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.payu.sampleapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } dataBinding { enabled = true } buildFeatures { viewBinding = true } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } namespace 'com.payu.sampleapp'} dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'in.payu:payu-checkout-pro:2.0.2' implementation 'com.google.android.material:material:1.3.0' implementation 'in.payu:olamoney:1.2.1'// implementation 'in.payu:phonepe-intent:1.6.2' implementation 'in.payu:payu-gpay:1.5.1' implementation 'in.payu:native-otp-assist:1.3.1'}

Credentils & Activity

private val email: String = @."private val phone = "9999999999"private val merchantName = "RH Group"private val surl = "https://payu.herokuapp.com/success"private val furl = "https://payu.herokuapp.com/failure"private val amount = "1.0"//Test Key and Saltprivate val testKey = "DC2ahe"private val testSalt = "bjSejErX5TryGH0FOQVV0mrobKkskgi1"/ Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */private val merchantAccessKey = "1642e42b3edc6d4e359dc3c090fadd53a336e57d9d79aa1fb3d0857373a082d0"private val merchantSecretKey = "8c896fcbae5a60eda0ed1369c71c4cbdb9f281b952f8e202e9f45aea21bf986d"//Prod Key and Saltprivate val prodKey = "0MQaQP"private val prodSalt = ""

Thanks & Regards, Abhishek Rai +91- 8130740896

On Mon, 28 Nov 2022 at 19:36, shahfaizalc @.***> wrote:

@abhishekraics001 https://github.com/abhishekraics001 Please drop a mail at @.*** for quick help on this.

— Reply to this email directly, view it on GitHub https://github.com/payu-intrepos/PayUCheckoutPro-Android/issues/24#issuecomment-1329168423, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZRRGXGS2EHE55QKTGYH6DWKS37BANCNFSM5KIWPC4Q . You are receiving this because you were mentioned.Message ID: @.***>

abhishekraics001 commented 1 year ago

Hi Abhishek,

Please use the below link for the testing credentials,

Link:- https://devguide.payu.in/mobile-sdk-ios/getting-started-with-ios-sdk/mobile-sdk-test-environment/

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 29/11/2022 5:35 pm To: @. Cc: @.; @.; @. Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Rishabh, This flag (isProduction) is there and passing values like true for production and falses for testing but it's still not working. If possible pls share once test credentials with us for testing purposes. Thanks & Regards, Abhishek Rai +91- 8130740896 On Tue, 29 Nov 2022 at 10:02, Mobile Integration @.> wrote: Hi Abhishek,

Please set isProduction to true when using Live Key and false when using testing key just set and then check because its related to environment or key salt error.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 28/11/2022 7:46 pm To: @. Cc: @.; @.; @.*** Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team, As I am trying to do the POC about your mobile payment SDK with a test/staging environment but unlucky i am getting errors like below Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject Project Label Gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.6.20" repositories { google() jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:7.3.0' //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { maven {url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"} google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }

App Lable griddle file

plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions' } //apply plugin: 'kotlin-android-extensions' //apply plugin: 'com.android.application' //apply plugin: 'kotlin-android'

android { compileSdkVersion 33 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.payu.sampleapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } dataBinding { enabled = true } buildFeatures { viewBinding = true } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } namespace 'com.payu.sampleapp' } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'in.payu:payu-checkout-pro:2.0.2' implementation 'com.google.android.material:material:1.3.0' implementation 'in.payu:olamoney:1.2.1' // implementation 'in.payu:phonepe-intent:1.6.2' implementation 'in.payu:payu-gpay:1.5.1' implementation 'in.payu:native-otp-assist:1.3.1' }

Credentils & Activity

private val email: String = @." private val phone = "9999999999" private val merchantName = "RH Group" private val surl = "https://payu.herokuapp.com/success" private val furl = "https://payu.herokuapp.com/failure" private val amount = "1.0" //Test Key and Salt private val testKey = "DC2ahe" private val testSalt = "bjSejErX5TryGH0FOQVV0mrobKkskgi1" / Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */ private val merchantAccessKey = "1642e42b3edc6d4e359dc3c090fadd53a336e57d9d79aa1fb3d0857373a082d0" private val merchantSecretKey = "8c896fcbae5a60eda0ed1369c71c4cbdb9f281b952f8e202e9f45aea21bf986d" //Prod Key and Salt private val prodKey = "0MQaQP" private val prodSalt = ""

Thanks & Regards, Abhishek Rai +91- 8130740896 On Mon, 28 Nov 2022 at 19:36, shahfaizalc @.***> wrote:

@abhishekraics001 Please drop a mail at @.*** for quick help on this.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

abhishekraics001 commented 1 year ago

Hi Team,

I am getting the below error message when trying to test the payment with testing/production credentials but I have the same code base integrated in other project all are working fine but when integrating it other app get error message like below

Thanks & Regards, Abhishek Rai +91- 8130740896

On Tue, 29 Nov 2022 at 17:42, Mobile Integration @.***> wrote:

Hi Abhishek,

Please use the below link for the testing credentials,

Link:- https://devguide.payu.in/mobile-sdk-ios/getting-started-with-ios-sdk/mobile-sdk-test-environment/

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 29/11/2022 5:35 pm To: @. Cc: @.; @.; @.** Subject:* Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Rishabh,

This flag (isProduction) is there and passing values like true for production and falses for testing but it's still not working.

If possible pls share once test credentials with us for testing purposes.

Thanks & Regards, Abhishek Rai +91- 8130740896

On Tue, 29 Nov 2022 at 10:02, Mobile Integration < @.***> wrote:

Hi Abhishek,

Please set isProduction to true when using Live Key and false when using testing key just set and then check because its related to environment or key salt error.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 28/11/2022 7:46 pm To: @. Cc: @.; @.; @.** Subject:* Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team,

As I am trying to do the POC about your mobile payment SDK with a test/staging environment but unlucky i am getting errors like below Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

Project Label Gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { ext.kotlin_version = "1.6.20" repositories { google() jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:7.3.0' //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }} allprojects { repositories { maven {url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"} google() jcenter() }} task clean(type: Delete) { delete rootProject.buildDir}

App Lable griddle file

plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions'}//apply plugin: 'kotlin-android-extensions'//apply plugin: 'com.android.application'//apply plugin: 'kotlin-android'

android { compileSdkVersion 33 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.payu.sampleapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } dataBinding { enabled = true } buildFeatures { viewBinding = true } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } namespace 'com.payu.sampleapp'} dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'in.payu:payu-checkout-pro:2.0.2' implementation 'com.google.android.material:material:1.3.0' implementation 'in.payu:olamoney:1.2.1'// implementation 'in.payu:phonepe-intent:1.6.2' implementation 'in.payu:payu-gpay:1.5.1' implementation 'in.payu:native-otp-assist:1.3.1'}

Credentils & Activity

private val email: String = @."private val phone = "9999999999"private val merchantName = "RH Group"private val surl = "https://payu.herokuapp.com/success"private val furl = "https://payu.herokuapp.com/failure"private val amount = "1.0"//Test Key and Saltprivate val testKey = "DC2ahe"private val testSalt = "bjSejErX5TryGH0FOQVV0mrobKkskgi1"/ Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */private val merchantAccessKey = "1642e42b3edc6d4e359dc3c090fadd53a336e57d9d79aa1fb3d0857373a082d0"private val merchantSecretKey = "8c896fcbae5a60eda0ed1369c71c4cbdb9f281b952f8e202e9f45aea21bf986d"//Prod Key and Saltprivate val prodKey = "0MQaQP"private val prodSalt = ""

Thanks & Regards, Abhishek Rai +91- 8130740896

On Mon, 28 Nov 2022 at 19:36, shahfaizalc @.***> wrote:

@abhishekraics001 https://github.com/abhishekraics001 Please drop a mail at @.*** for quick help on this.

— Reply to this email directly, view it on GitHub https://github.com/payu-intrepos/PayUCheckoutPro-Android/issues/24#issuecomment-1329168423, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZRRGXGS2EHE55QKTGYH6DWKS37BANCNFSM5KIWPC4Q . You are receiving this because you were mentioned.Message ID: @.***>

abhishekraics001 commented 1 year ago

Hi Abhishek,

Can we have a call on your below given issue please schedule a call at 11 am and send me the joining link.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 3/12/2022 1:07 pm To: @. Cc: @.; @.; @.; @. Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team, I am getting the below error message when trying to test the payment with testing/production credentials but I have the same code base integrated in other project all are working fine but when integrating it other app get error message like below Error Message: Invalid Hash. Error Code: 5019

var totalAmount = ""; // Payment ammount private var email: String = ""; //user email id private var phone = ""; //user phone no private var fullName: String = ""; // user display name private var userTocken: String = ""; //userID val productName: String = "PMSC Products"; //Product Name private val merchantName = "PMSC "; //Marchant Name

private val surl = "https://payu.herokuapp.com/success" private val furl = "https://payu.herokuapp.com/failure" //Test Key and Salt private val testKey = "gtKFFx" private val testSalt = "4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW" //Prod Key and Salt private var prodKey = "gtKFFx"; // "DC2ahe" private var prodSalt = "4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW"; //""bjSejErX5TryGH0FOQVV0mrobKkskgi1" var isProduction = false; /* Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */ private val merchantAccessKey = "" private val merchantSecretKey = ""

// variable to track event time private var mLastClickTime: Long = 0

override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_payment) mContext = @.***

//prodKey = (applicationContext as App).allAppSettings.getValue(APIConst.KEY_MERCHANT) // prodSalt = (applicationContext as App).allAppSettings.getValue(APIConst.KEY_SALT) Log.d("Payu Details ", "PAYUBIZ_MERCHANT_KEY: $prodKey PAYUBIZ_SALT_KEY:$prodSalt")

    email = Utility().getSharePref(mContext, APIConst.EMAIL_ID)
    phone = Utility().getSharePref(mContext, APIConst.V_PHONE_NUMBER)
    fullName = Utility().getSharePref(mContext, APIConst.FIRST_NAME)
    userTocken = Utility().getSharePref(mContext, APIConst.USER_ID)

    totalAmount = (applicationContext as App).totalAmount  //totalAmount ="1"  Log.d("Total Payment", ""+totalAmount); 

//Open payment SDK/Page after 1 second object : CountDownTimer(1000, 1000) { override fun onTick(millisUntilFinished: Long) {

        }
        override fun onFinish() {
            startPayment();  }
    }.start()
}

fun startPayment() {
    // Preventing multiple clicks, using threshold of 1 second  if (SystemClock.elapsedRealtime() - mLastClickTime < 1000) {
        return  }
    mLastClickTime = SystemClock.elapsedRealtime()
    val paymentParams = preparePayUBizParams()

    //Init payment SDK/Page  initUiSdk(paymentParams)
}

fun preparePayUBizParams(): PayUPaymentParams {
    val vasForMobileSdkHash = HashGenerationUtils.generateHashFromSDK(
        "${prodKey}|${PayUCheckoutProConstants.CP_VAS_FOR_MOBILE_SDK}|${PayUCheckoutProConstants.CP_DEFAULT}|",  prodSalt  )
    val paymenRelatedDetailsHash = HashGenerationUtils.generateHashFromSDK(
        "${prodKey}|${PayUCheckoutProConstants.CP_PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK}|${"${prodKey}:$email"}|",  prodSalt  )

    val additionalParamsMap: HashMap<String, Any?> = HashMap()
    additionalParamsMap[PayUCheckoutProConstants.CP_UDF1] = "udf1"  additionalParamsMap[PayUCheckoutProConstants.CP_UDF2] = "udf2"  additionalParamsMap[PayUCheckoutProConstants.CP_UDF3] = "udf3"  additionalParamsMap[PayUCheckoutProConstants.CP_UDF4] = "udf4"  additionalParamsMap[PayUCheckoutProConstants.CP_UDF5] = "udf5" 

//Below params should be passed only when integrating Multi-currency support //TODO Please pass your own Merchant Access Key below as provided by your Key Account Manager at PayU. // additionalParamsMap[PayUCheckoutProConstants.CP_MERCHANT_ACCESS_KEY] = merchantAccessKey //Below param should be passed only when sodexo payment option is enabled and to show saved sodexo card // additionalParamsMap[PayUCheckoutProConstants.SODEXO_SOURCE_ID] = sodesosrcid // merchant has to pass this //Below hashes are static hashes and can be calculated and passed in additional params additionalParamsMap[PayUCheckoutProConstants.CP_VAS_FOR_MOBILE_SDK] = vasForMobileSdkHash additionalParamsMap[PayUCheckoutProConstants.CP_PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK] = paymenRelatedDetailsHash

    return PayUPaymentParams.Builder()
        .setAmount(totalAmount)
        .setIsProduction(isProduction)
        .setKey(prodKey)
        .setProductInfo(productName)
        .setPhone(phone)
        .setTransactionId(System.currentTimeMillis().toString())
        .setFirstName(fullName)
        .setEmail(email)
        .setSurl(surl)
        .setFurl(furl)
        .setUserCredential("${prodKey}:$email")
        .setAdditionalParams(additionalParamsMap)
        //.setPayUSIParams(siDetails)  //.setSplitPaymentDetails(if(switchSplitPayment!!.isChecked) splitPaymentDetails.toString() else null)  // pass here unique usertoken for user  .setUserToken(userTocken)
        .build()
}

private fun initUiSdk(payUPaymentParams: PayUPaymentParams) {
    PayUCheckoutPro.open(
        this,  payUPaymentParams,  getCheckoutProConfig(),  object : PayUCheckoutProListener {

            override fun onPaymentSuccess(response: Any) {
                paymentSuccess(response);  }

            override fun onPaymentFailure(response: Any) {
                Toast.makeText(mContext, "Transaction Failed", Toast.LENGTH_LONG).show()
                payMentFailed();  }

            override fun onPaymentCancel(isTxnInitiated: Boolean) {
                Toast.makeText(mContext, "Transaction Canceled", Toast.LENGTH_LONG).show()
                payMentFailed();  }

            override fun onError(errorResponse: ErrorResponse) {
                val errorMessage: String
                println("Error: Message: ${errorResponse.errorMessage} Error Code: ${errorResponse.errorCode}")
                if (errorResponse != null && errorResponse.errorMessage != null && errorResponse.errorMessage!!.isNotEmpty())
                    errorMessage = errorResponse.errorMessage!!
                else  errorMessage = resources.getString(R.string.some_error_occurred)
                showErrorMsg(errorMessage)
            }

            override fun generateHash(
                map: HashMap<String, String?>,  hashGenerationListener: PayUHashGenerationListener
            ) {
                if (map.containsKey(PayUCheckoutProConstants.CP_HASH_STRING)
                    && map.containsKey(PayUCheckoutProConstants.CP_HASH_STRING) != null  && map.containsKey(PayUCheckoutProConstants.CP_HASH_NAME)
                    && map.containsKey(PayUCheckoutProConstants.CP_HASH_NAME) != null  ) {

                    val hashData = map[PayUCheckoutProConstants.CP_HASH_STRING]
                    val hashName = map[PayUCheckoutProConstants.CP_HASH_NAME]
                    val hashType = map[PayUCheckoutProConstants.CP_HASH_TYPE]

                    var salt =  prodSalt; // binding.etSalt.text.toString()  if (map.containsKey(PayUCheckoutProConstants.CP_POST_SALT))
                        salt = salt.plus(map[PayUCheckoutProConstants.CP_POST_SALT])

                    var hash: String? = null 

//Below hash should be calculated only when integrating Multi-currency support. If not integrating MCP // then no need to have this if check. if (hashName.equals(PayUCheckoutProConstants.CP_LOOKUP_API_HASH, ignoreCase = true)){

                        //Calculate HmacSHA1 hash using the hashData and merchant secret key  hash = HashGenerationUtils.generateHashFromSDK( hashData!!, salt, merchantSecretKey )
                    }else if (hashType.equals(PayUCheckoutProConstants.CP_V2_HASH)){
                        hash = HashGenerationUtils.generateV2HashFromSDK(hashData!!,prodSalt); // HashGenerationUtils.generateV2HashFromSDK(hashData!!,binding.etSalt.text.toString())  } else {
                        //calculate SDH-512 hash using hashData and salt  hash = HashGenerationUtils.generateHashFromSDK(
                            hashData!!,  salt
                        )
                    }

                    if (!TextUtils.isEmpty(hash)) {
                        val hashMap: HashMap<String, String?> = HashMap()
                        hashMap[hashName!!] = hash!!
                        hashGenerationListener.onHashGenerated(hashMap)
                    }
                }
            }

            override fun setWebViewProperties(webView: WebView?, bank: Any?) {
            }
        })
}

private fun getCheckoutProConfig(): PayUCheckoutProConfig {
    OrderDetails
    val checkoutProConfig = PayUCheckoutProConfig()
    checkoutProConfig.paymentModesOrder = getCheckoutOrderList()
    checkoutProConfig.showCbToolbar = true; //!binding.switchHideCbToolBar.isChecked  checkoutProConfig.autoSelectOtp = false; //binding.switchAutoSelectOtp.isChecked  checkoutProConfig.autoApprove = false; //binding.switchAutoApprove.isChecked  checkoutProConfig.surePayCount =0; // binding.etSurePayCount.text.toString().toInt()  checkoutProConfig.cartDetails = ArrayList<OrderDetails>(); //reviewOrderAdapter?.getOrderDetailsList()  checkoutProConfig.showExitConfirmationOnPaymentScreen = true; // !binding.switchDiableCBDialog.isChecked  checkoutProConfig.showExitConfirmationOnCheckoutScreen =true ; //!binding.switchDiableUiDialog.isChecked  checkoutProConfig.merchantName = merchantName; //binding.etMerchantName.text.toString()  checkoutProConfig.merchantLogo = R.mipmap.ic_launcher ***@***.***/ic_launcher  checkoutProConfig.waitingTime = 3000  checkoutProConfig.merchantResponseTimeout = 3000  checkoutProConfig.customNoteDetails = ArrayList<CustomNote>();//getCustomeNoteDetails()  // uncomment below code to perform enforcement //        checkoutProConfig.enforcePaymentList = getEnforcePaymentList()  return checkoutProConfig
}

private fun getEnforcePaymentList(): ArrayList<HashMap<String, String>> {
    val enforceList = ArrayList<HashMap<String,String>>()
    enforceList.add(HashMap<String,String>().apply {  put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.NB.name)
        put(PayUCheckoutProConstants.ENFORCED_IBIBOCODE,"AXIB")

    })
    enforceList.add(HashMap<String,String>().apply {  put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.CARD.name)
        put(PayUCheckoutProConstants.CP_CARD_TYPE, CardType.CC.name)
        put(PayUCheckoutProConstants.CP_CARD_SCHEME, CardScheme.MAST.name)
    })
    return enforceList
}

private fun getCheckoutOrderList(): ArrayList<PaymentMode> {
    val checkoutOrderList = ArrayList<PaymentMode>()

    //For GooglePay  var isGooglePayEnable = true; //binding.switchShowGooglePay.isChecked  var isPhonePayEnable = true; //binding.switchShowPhonePe.isChecked  var isPayTmEnable = true; //binding.switchShowPaytm.isChecked 

if (isGooglePayEnable) checkoutOrderList.add( PaymentMode( PaymentType.UPI, PayUCheckoutProConstants.CP_GOOGLE_PAY ) ) if (isPhonePayEnable) checkoutOrderList.add( PaymentMode( PaymentType.WALLET, PayUCheckoutProConstants.CP_PHONEPE ) ) if (isPayTmEnable) checkoutOrderList.add( PaymentMode( PaymentType.WALLET, PayUCheckoutProConstants.CP_PAYTM ) ) return checkoutOrderList }

private fun showErrorMsg(message: String) {
    println("showSnackBar message: $message");  Toast.makeText(mContext, message, Toast.LENGTH_LONG).show()
}

fun payMentFailed(){
    val intent = Intent()
    intent.putExtra("status", "failed")
    setResult(Activity.RESULT_OK, intent)
    finish()
}

fun paymentSuccess(response: Any){
    response as HashMap<*, *>
    object : CountDownTimer(800,800){
        override fun onTick(millisUntilFinished: Long) {}
        override fun onFinish() {

            val payuRes = response[PayUCheckoutProConstants.CP_PAYU_RESPONSE].toString() ;  println("payuRes payuRes 2 ${payuRes}")

            val payuRes2 = response[PayUCheckoutProConstants.CP_MERCHANT_RESPONSE].toString() ;  println("payuRes payuRes2 2 ${payuRes2}")

           var obj = JSONObject(payuRes)
           var ID=  obj.getString("id");  var trxID =  obj.getString("txnid"); 

Toast.makeText(mContext, "Transaction Success. Transaction ID: $trxID", Toast.LENGTH_LONG).show()

            val intent = Intent()
            intent.putExtra("status", "success")
            intent.putExtra("transID", trxID)
            intent.putExtra("transResponse", payuRes)
            setResult(Activity.RESULT_OK, intent)

            finish()
        }
    }.start()

}

Thanks & Regards, Abhishek Rai +91- 8130740896 On Tue, 29 Nov 2022 at 17:42, Mobile Integration @.***> wrote: Hi Abhishek,

Please use the below link for the testing credentials,

Link:- https://devguide.payu.in/mobile-sdk-ios/getting-started-with-ios-sdk/mobile-sdk-test-environment/

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 29/11/2022 5:35 pm To: @. Cc: @.; @.; @. Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Rishabh, This flag (isProduction) is there and passing values like true for production and falses for testing but it's still not working. If possible pls share once test credentials with us for testing purposes. Thanks & Regards, Abhishek Rai +91- 8130740896 On Tue, 29 Nov 2022 at 10:02, Mobile Integration @.> wrote: Hi Abhishek,

Please set isProduction to true when using Live Key and false when using testing key just set and then check because its related to environment or key salt error.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 28/11/2022 7:46 pm To: @. Cc: @.; @.; @.*** Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team, As I am trying to do the POC about your mobile payment SDK with a test/staging environment but unlucky i am getting errors like below Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject Project Label Gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.6.20" repositories { google() jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:7.3.0' //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { maven {url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"} google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }

App Lable griddle file

plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions' } //apply plugin: 'kotlin-android-extensions' //apply plugin: 'com.android.application' //apply plugin: 'kotlin-android'

android { compileSdkVersion 33 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.payu.sampleapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } dataBinding { enabled = true } buildFeatures { viewBinding = true } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } namespace 'com.payu.sampleapp' } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'in.payu:payu-checkout-pro:2.0.2' implementation 'com.google.android.material:material:1.3.0' implementation 'in.payu:olamoney:1.2.1' // implementation 'in.payu:phonepe-intent:1.6.2' implementation 'in.payu:payu-gpay:1.5.1' implementation 'in.payu:native-otp-assist:1.3.1' }

Credentils & Activity

private val email: String = @." private val phone = "9999999999" private val merchantName = "RH Group" private val surl = "https://payu.herokuapp.com/success" private val furl = "https://payu.herokuapp.com/failure" private val amount = "1.0" //Test Key and Salt private val testKey = "DC2ahe" private val testSalt = "bjSejErX5TryGH0FOQVV0mrobKkskgi1" / Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */ private val merchantAccessKey = "1642e42b3edc6d4e359dc3c090fadd53a336e57d9d79aa1fb3d0857373a082d0" private val merchantSecretKey = "8c896fcbae5a60eda0ed1369c71c4cbdb9f281b952f8e202e9f45aea21bf986d" //Prod Key and Salt private val prodKey = "0MQaQP" private val prodSalt = ""

Thanks & Regards, Abhishek Rai +91- 8130740896 On Mon, 28 Nov 2022 at 19:36, shahfaizalc @.***> wrote:

@abhishekraics001 Please drop a mail at @.*** for quick help on this.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

abhishekraics001 commented 1 year ago

Hi Team, Can we connect right now? or you schedule a call for 4 PM today at your convenient?

Requesting you're please confirm your availability.

Thanks & Regards, Abhishek Rai +91- 8130740896

On Mon, 5 Dec 2022 at 09:58, Mobile Integration @.***> wrote:

Hi Abhishek,

Can we have a call on your below given issue please schedule a call at 11 am and send me the joining link.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 3/12/2022 1:07 pm To: @. Cc: @.; @.; @.; @. Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team,

I am getting the below error message when trying to test the payment with testing/production credentials but I have the same code base integrated in other project all are working fine but when integrating it other app get error message like below

  • Error Message: Invalid Hash. Error Code: 5019*

    var totalAmount = ""; // Payment ammount private var email: String = ""; //user email id private var phone = ""; //user phone no private var fullName: String = ""; // user display name private var userTocken: String = ""; //userID val productName: String = "PMSC Products"; //Product Name private val merchantName = "PMSC "; //Marchant Name private val surl = "https://payu.herokuapp.com/success" private val furl = "https://payu.herokuapp.com/failure" //Test Key and Salt private val testKey = "gtKFFx" private val testSalt = "4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW" //Prod Key and Salt private var prodKey = "gtKFFx"; // "DC2ahe" private var prodSalt = "4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW"; //""bjSejErX5TryGH0FOQVV0mrobKkskgi1" var isProduction = false; /* Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */ private val merchantAccessKey = "" private val merchantSecretKey = "" // variable to track event time private var mLastClickTime: Long = 0

    override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_payment) mContext = @.*** //prodKey = (applicationContext as App).allAppSettings.getValue(APIConst.KEY_MERCHANT) // prodSalt = (applicationContext as App).allAppSettings.getValue(APIConst.KEY_SALT) Log.d("Payu Details ", "PAYUBIZ_MERCHANT_KEY: $prodKey PAYUBIZ_SALT_KEY:$prodSalt")

    email = Utility().getSharePref(mContext, APIConst.EMAIL_ID)
    phone = Utility().getSharePref(mContext, APIConst.V_PHONE_NUMBER)
    fullName = Utility().getSharePref(mContext, APIConst.FIRST_NAME)
    userTocken = Utility().getSharePref(mContext, APIConst.USER_ID)
    
    totalAmount = (applicationContext as App).totalAmount        //totalAmount ="1"        Log.d("Total Payment",  ""+totalAmount);
    //Open payment SDK/Page after 1 second        object : CountDownTimer(1000, 1000) {
        override fun onTick(millisUntilFinished: Long) {
    
        }
        override fun onFinish() {
            startPayment();            }
    }.start()

    }

    fun startPayment() { // Preventing multiple clicks, using threshold of 1 second if (SystemClock.elapsedRealtime() - mLastClickTime < 1000) { return } mLastClickTime = SystemClock.elapsedRealtime() val paymentParams = preparePayUBizParams()

    //Init payment SDK/Page        initUiSdk(paymentParams)

    }

    fun preparePayUBizParams(): PayUPaymentParams { val vasForMobileSdkHash = HashGenerationUtils.generateHashFromSDK( "${prodKey}|${PayUCheckoutProConstants.CP_VAS_FOR_MOBILE_SDK}|${PayUCheckoutProConstants.CP_DEFAULT}|", prodSalt ) val paymenRelatedDetailsHash = HashGenerationUtils.generateHashFromSDK( "${prodKey}|${PayUCheckoutProConstants.CP_PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK}|${"${prodKey}:$email"}|", prodSalt )

    val additionalParamsMap: HashMap<String, Any?> = HashMap()
    additionalParamsMap[PayUCheckoutProConstants.CP_UDF1] = "udf1"        additionalParamsMap[PayUCheckoutProConstants.CP_UDF2] = "udf2"        additionalParamsMap[PayUCheckoutProConstants.CP_UDF3] = "udf3"        additionalParamsMap[PayUCheckoutProConstants.CP_UDF4] = "udf4"        additionalParamsMap[PayUCheckoutProConstants.CP_UDF5] = "udf5"        //Below params should be passed only when integrating Multi-currency support        //TODO Please pass your own Merchant Access Key below as provided by your Key Account Manager at PayU.//        additionalParamsMap[PayUCheckoutProConstants.CP_MERCHANT_ACCESS_KEY] = merchantAccessKey        //Below param should be passed only when sodexo payment option is enabled and to show saved sodexo card//        additionalParamsMap[PayUCheckoutProConstants.SODEXO_SOURCE_ID] = sodesosrcid  // merchant has to pass this        //Below hashes are static hashes and can be calculated and passed in additional params        additionalParamsMap[PayUCheckoutProConstants.CP_VAS_FOR_MOBILE_SDK] = vasForMobileSdkHash
    additionalParamsMap[PayUCheckoutProConstants.CP_PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK] =
        paymenRelatedDetailsHash
    
    return PayUPaymentParams.Builder()
        .setAmount(totalAmount)
        .setIsProduction(isProduction)
        .setKey(prodKey)
        .setProductInfo(productName)
        .setPhone(phone)
        .setTransactionId(System.currentTimeMillis().toString())
        .setFirstName(fullName)
        .setEmail(email)
        .setSurl(surl)
        .setFurl(furl)
        .setUserCredential("${prodKey}:$email")
        .setAdditionalParams(additionalParamsMap)
        //.setPayUSIParams(siDetails)            //.setSplitPaymentDetails(if(switchSplitPayment!!.isChecked) splitPaymentDetails.toString() else null)            // pass here unique usertoken for user            .setUserToken(userTocken)
        .build()

    }

    private fun initUiSdk(payUPaymentParams: PayUPaymentParams) { PayUCheckoutPro.open( this, payUPaymentParams, getCheckoutProConfig(), object : PayUCheckoutProListener {

            override fun onPaymentSuccess(response: Any) {
                paymentSuccess(response);                }
    
            override fun onPaymentFailure(response: Any) {
                Toast.makeText(mContext, "Transaction Failed", Toast.LENGTH_LONG).show()
                payMentFailed();                }
    
            override fun onPaymentCancel(isTxnInitiated: Boolean) {
                Toast.makeText(mContext, "Transaction Canceled", Toast.LENGTH_LONG).show()
                payMentFailed();                }
    
            override fun onError(errorResponse: ErrorResponse) {
                val errorMessage: String
                println("Error: Message: ${errorResponse.errorMessage}  Error Code: ${errorResponse.errorCode}")
                if (errorResponse != null && errorResponse.errorMessage != null && errorResponse.errorMessage!!.isNotEmpty())
                    errorMessage = errorResponse.errorMessage!!
                else                        errorMessage = resources.getString(R.string.some_error_occurred)
                showErrorMsg(errorMessage)
            }
    
            override fun generateHash(
                map: HashMap<String, String?>,                    hashGenerationListener: PayUHashGenerationListener
            ) {
                if (map.containsKey(PayUCheckoutProConstants.CP_HASH_STRING)
                    && map.containsKey(PayUCheckoutProConstants.CP_HASH_STRING) != null                        && map.containsKey(PayUCheckoutProConstants.CP_HASH_NAME)
                    && map.containsKey(PayUCheckoutProConstants.CP_HASH_NAME) != null                    ) {
    
                    val hashData = map[PayUCheckoutProConstants.CP_HASH_STRING]
                    val hashName = map[PayUCheckoutProConstants.CP_HASH_NAME]
                    val hashType = map[PayUCheckoutProConstants.CP_HASH_TYPE]
    
                    var salt =  prodSalt; // binding.etSalt.text.toString()                        if (map.containsKey(PayUCheckoutProConstants.CP_POST_SALT))
                        salt = salt.plus(map[PayUCheckoutProConstants.CP_POST_SALT])
    
                    var hash: String? = null
                    //Below hash should be calculated only when integrating Multi-currency support. If not integrating MCP                        // then no need to have this if check.                        if (hashName.equals(PayUCheckoutProConstants.CP_LOOKUP_API_HASH, ignoreCase = true)){
    
                        //Calculate HmacSHA1 hash using the hashData and merchant secret key                            hash = HashGenerationUtils.generateHashFromSDK( hashData!!,  salt, merchantSecretKey  )
                    }else if (hashType.equals(PayUCheckoutProConstants.CP_V2_HASH)){
                        hash = HashGenerationUtils.generateV2HashFromSDK(hashData!!,prodSalt); // HashGenerationUtils.generateV2HashFromSDK(hashData!!,binding.etSalt.text.toString())                        } else {
                        //calculate SDH-512 hash using hashData and salt                            hash = HashGenerationUtils.generateHashFromSDK(
                            hashData!!,                                salt
                        )
                    }
    
                    if (!TextUtils.isEmpty(hash)) {
                        val hashMap: HashMap<String, String?> = HashMap()
                        hashMap[hashName!!] = hash!!
                        hashGenerationListener.onHashGenerated(hashMap)
                    }
                }
            }
    
            override fun setWebViewProperties(webView: WebView?, bank: Any?) {
            }
        })

    }

    private fun getCheckoutProConfig(): PayUCheckoutProConfig { OrderDetails val checkoutProConfig = PayUCheckoutProConfig() checkoutProConfig.paymentModesOrder = getCheckoutOrderList() checkoutProConfig.showCbToolbar = true; //!binding.switchHideCbToolBar.isChecked checkoutProConfig.autoSelectOtp = false; //binding.switchAutoSelectOtp.isChecked checkoutProConfig.autoApprove = false; //binding.switchAutoApprove.isChecked checkoutProConfig.surePayCount =0; // binding.etSurePayCount.text.toString().toInt() checkoutProConfig.cartDetails = ArrayList(); //reviewOrderAdapter?.getOrderDetailsList() checkoutProConfig.showExitConfirmationOnPaymentScreen = true; // !binding.switchDiableCBDialog.isChecked checkoutProConfig.showExitConfirmationOnCheckoutScreen =true ; //!binding.switchDiableUiDialog.isChecked checkoutProConfig.merchantName = merchantName; //binding.etMerchantName.text.toString() checkoutProConfig.merchantLogo = R.mipmap.ic_launcher @.***/ic_launcher checkoutProConfig.waitingTime = 3000 checkoutProConfig.merchantResponseTimeout = 3000 checkoutProConfig.customNoteDetails = ArrayList();//getCustomeNoteDetails() // uncomment below code to perform enforcement// checkoutProConfig.enforcePaymentList = getEnforcePaymentList() return checkoutProConfig }

    private fun getEnforcePaymentList(): ArrayList<HashMap<String, String>> { val enforceList = ArrayList<HashMap<String,String>>() enforceList.add(HashMap<String,String>().apply { put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.NB.name) put(PayUCheckoutProConstants.ENFORCED_IBIBOCODE,"AXIB")

    })
    enforceList.add(HashMap<String,String>().apply {            put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.CARD.name)
        put(PayUCheckoutProConstants.CP_CARD_TYPE, CardType.CC.name)
        put(PayUCheckoutProConstants.CP_CARD_SCHEME, CardScheme.MAST.name)
    })
    return enforceList

    }

    private fun getCheckoutOrderList(): ArrayList { val checkoutOrderList = ArrayList()

    //For GooglePay        var isGooglePayEnable = true; //binding.switchShowGooglePay.isChecked        var isPhonePayEnable = true; //binding.switchShowPhonePe.isChecked        var isPayTmEnable = true; //binding.switchShowPaytm.isChecked
    if (isGooglePayEnable) checkoutOrderList.add(
        PaymentMode(
            PaymentType.UPI,                PayUCheckoutProConstants.CP_GOOGLE_PAY            )
    )
    if (isPhonePayEnable) checkoutOrderList.add(
        PaymentMode(
            PaymentType.WALLET,                PayUCheckoutProConstants.CP_PHONEPE            )
    )
    if (isPayTmEnable) checkoutOrderList.add(
        PaymentMode(
            PaymentType.WALLET,                PayUCheckoutProConstants.CP_PAYTM            )
    )
    return checkoutOrderList

    }

    private fun showErrorMsg(message: String) { println("showSnackBar message: $message"); Toast.makeText(mContext, message, Toast.LENGTH_LONG).show() }

    fun payMentFailed(){ val intent = Intent() intent.putExtra("status", "failed") setResult(Activity.RESULT_OK, intent) finish() }

    fun paymentSuccess(response: Any){ response as HashMap<, > object : CountDownTimer(800,800){ override fun onTick(millisUntilFinished: Long) {} override fun onFinish() {

            val payuRes = response[PayUCheckoutProConstants.CP_PAYU_RESPONSE].toString() ;                println("payuRes payuRes 2 ${payuRes}")
    
            val payuRes2 = response[PayUCheckoutProConstants.CP_MERCHANT_RESPONSE].toString() ;                println("payuRes payuRes2 2 ${payuRes2}")
    
           var obj = JSONObject(payuRes)
           var ID=  obj.getString("id");                var trxID =  obj.getString("txnid");                Toast.makeText(mContext, "Transaction Success. Transaction ID: $trxID", Toast.LENGTH_LONG).show()
    
            val intent = Intent()
            intent.putExtra("status", "success")
            intent.putExtra("transID", trxID)
            intent.putExtra("transResponse", payuRes)
            setResult(Activity.RESULT_OK, intent)
    
            finish()
        }
    }.start()

    }

Thanks & Regards, Abhishek Rai +91- 8130740896

On Tue, 29 Nov 2022 at 17:42, Mobile Integration < @.***> wrote:

Hi Abhishek,

Please use the below link for the testing credentials,

Link:- https://devguide.payu.in/mobile-sdk-ios/getting-started-with-ios-sdk/mobile-sdk-test-environment/

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 29/11/2022 5:35 pm To: @. Cc: @.; @.; @.** Subject:* Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Rishabh,

This flag (isProduction) is there and passing values like true for production and falses for testing but it's still not working.

If possible pls share once test credentials with us for testing purposes.

Thanks & Regards, Abhishek Rai +91- 8130740896

On Tue, 29 Nov 2022 at 10:02, Mobile Integration < @.***> wrote:

Hi Abhishek,

Please set isProduction to true when using Live Key and false when using testing key just set and then check because its related to environment or key salt error.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 28/11/2022 7:46 pm To: @. Cc: @.; @.; @.** Subject:* Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team,

As I am trying to do the POC about your mobile payment SDK with a test/staging environment but unlucky i am getting errors like below Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

Project Label Gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { ext.kotlin_version = "1.6.20" repositories { google() jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:7.3.0' //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }} allprojects { repositories { maven {url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"} google() jcenter() }} task clean(type: Delete) { delete rootProject.buildDir}

App Lable griddle file

plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions'}//apply plugin: 'kotlin-android-extensions'//apply plugin: 'com.android.application'//apply plugin: 'kotlin-android'

android { compileSdkVersion 33 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.payu.sampleapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } dataBinding { enabled = true } buildFeatures { viewBinding = true } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } namespace 'com.payu.sampleapp'} dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'in.payu:payu-checkout-pro:2.0.2' implementation 'com.google.android.material:material:1.3.0' implementation 'in.payu:olamoney:1.2.1'// implementation 'in.payu:phonepe-intent:1.6.2' implementation 'in.payu:payu-gpay:1.5.1' implementation 'in.payu:native-otp-assist:1.3.1'}

Credentils & Activity

private val email: String = @."private val phone = "9999999999"private val merchantName = "RH Group"private val surl = "https://payu.herokuapp.com/success"private val furl = "https://payu.herokuapp.com/failure"private val amount = "1.0"//Test Key and Saltprivate val testKey = "DC2ahe"private val testSalt = "bjSejErX5TryGH0FOQVV0mrobKkskgi1"/ Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */private val merchantAccessKey = "1642e42b3edc6d4e359dc3c090fadd53a336e57d9d79aa1fb3d0857373a082d0"private val merchantSecretKey = "8c896fcbae5a60eda0ed1369c71c4cbdb9f281b952f8e202e9f45aea21bf986d"//Prod Key and Saltprivate val prodKey = "0MQaQP"private val prodSalt = ""

Thanks & Regards, Abhishek Rai +91- 8130740896

On Mon, 28 Nov 2022 at 19:36, shahfaizalc @.***> wrote:

@abhishekraics001 https://github.com/abhishekraics001 Please drop a mail at @.*** for quick help on this.

— Reply to this email directly, view it on GitHub https://github.com/payu-intrepos/PayUCheckoutPro-Android/issues/24#issuecomment-1329168423, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZRRGXGS2EHE55QKTGYH6DWKS37BANCNFSM5KIWPC4Q . You are receiving this because you were mentioned.Message ID: @.***>

abhishekraics001 commented 1 year ago

@abhishek Please send the meet link, we can connect now.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 5/12/2022 12:12 pm To: @. Cc: @.; @.; @.; @. Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team, Can we connect right now? or you schedule a call for 4 PM today at your convenient? Requesting you're please confirm your availability. Thanks & Regards, Abhishek Rai +91- 8130740896 On Mon, 5 Dec 2022 at 09:58, Mobile Integration @.***> wrote: Hi Abhishek,

Can we have a call on your below given issue please schedule a call at 11 am and send me the joining link.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 3/12/2022 1:07 pm To: @. Cc: @.; @.; @.; @. Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team, I am getting the below error message when trying to test the payment with testing/production credentials but I have the same code base integrated in other project all are working fine but when integrating it other app get error message like below Error Message: Invalid Hash. Error Code: 5019

var totalAmount = ""; // Payment ammount private var email: String = ""; //user email id private var phone = ""; //user phone no private var fullName: String = ""; // user display name private var userTocken: String = ""; //userID val productName: String = "PMSC Products"; //Product Name private val merchantName = "PMSC "; //Marchant Name

private val surl = "https://payu.herokuapp.com/success" private val furl = "https://payu.herokuapp.com/failure" //Test Key and Salt private val testKey = "gtKFFx" private val testSalt = "4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW" //Prod Key and Salt private var prodKey = "gtKFFx"; // "DC2ahe" private var prodSalt = "4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW"; //""bjSejErX5TryGH0FOQVV0mrobKkskgi1" var isProduction = false; /* Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */ private val merchantAccessKey = "" private val merchantSecretKey = ""

// variable to track event time private var mLastClickTime: Long = 0

override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_payment) mContext = @.***

//prodKey = (applicationContext as App).allAppSettings.getValue(APIConst.KEY_MERCHANT) // prodSalt = (applicationContext as App).allAppSettings.getValue(APIConst.KEY_SALT) Log.d("Payu Details ", "PAYUBIZ_MERCHANT_KEY: $prodKey PAYUBIZ_SALT_KEY:$prodSalt")

    email = Utility().getSharePref(mContext, APIConst.EMAIL_ID)
    phone = Utility().getSharePref(mContext, APIConst.V_PHONE_NUMBER)
    fullName = Utility().getSharePref(mContext, APIConst.FIRST_NAME)
    userTocken = Utility().getSharePref(mContext, APIConst.USER_ID)

    totalAmount = (applicationContext as App).totalAmount  //totalAmount ="1"  Log.d("Total Payment", ""+totalAmount); 

//Open payment SDK/Page after 1 second object : CountDownTimer(1000, 1000) { override fun onTick(millisUntilFinished: Long) {

        }
        override fun onFinish() {
            startPayment();  }
    }.start()
}

fun startPayment() {
    // Preventing multiple clicks, using threshold of 1 second  if (SystemClock.elapsedRealtime() - mLastClickTime < 1000) {
        return  }
    mLastClickTime = SystemClock.elapsedRealtime()
    val paymentParams = preparePayUBizParams()

    //Init payment SDK/Page  initUiSdk(paymentParams)
}

fun preparePayUBizParams(): PayUPaymentParams {
    val vasForMobileSdkHash = HashGenerationUtils.generateHashFromSDK(
        "${prodKey}|${PayUCheckoutProConstants.CP_VAS_FOR_MOBILE_SDK}|${PayUCheckoutProConstants.CP_DEFAULT}|",  prodSalt  )
    val paymenRelatedDetailsHash = HashGenerationUtils.generateHashFromSDK(
        "${prodKey}|${PayUCheckoutProConstants.CP_PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK}|${"${prodKey}:$email"}|",  prodSalt  )

    val additionalParamsMap: HashMap<String, Any?> = HashMap()
    additionalParamsMap[PayUCheckoutProConstants.CP_UDF1] = "udf1"  additionalParamsMap[PayUCheckoutProConstants.CP_UDF2] = "udf2"  additionalParamsMap[PayUCheckoutProConstants.CP_UDF3] = "udf3"  additionalParamsMap[PayUCheckoutProConstants.CP_UDF4] = "udf4"  additionalParamsMap[PayUCheckoutProConstants.CP_UDF5] = "udf5" 

//Below params should be passed only when integrating Multi-currency support //TODO Please pass your own Merchant Access Key below as provided by your Key Account Manager at PayU. // additionalParamsMap[PayUCheckoutProConstants.CP_MERCHANT_ACCESS_KEY] = merchantAccessKey //Below param should be passed only when sodexo payment option is enabled and to show saved sodexo card // additionalParamsMap[PayUCheckoutProConstants.SODEXO_SOURCE_ID] = sodesosrcid // merchant has to pass this //Below hashes are static hashes and can be calculated and passed in additional params additionalParamsMap[PayUCheckoutProConstants.CP_VAS_FOR_MOBILE_SDK] = vasForMobileSdkHash additionalParamsMap[PayUCheckoutProConstants.CP_PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK] = paymenRelatedDetailsHash

    return PayUPaymentParams.Builder()
        .setAmount(totalAmount)
        .setIsProduction(isProduction)
        .setKey(prodKey)
        .setProductInfo(productName)
        .setPhone(phone)
        .setTransactionId(System.currentTimeMillis().toString())
        .setFirstName(fullName)
        .setEmail(email)
        .setSurl(surl)
        .setFurl(furl)
        .setUserCredential("${prodKey}:$email")
        .setAdditionalParams(additionalParamsMap)
        //.setPayUSIParams(siDetails)  //.setSplitPaymentDetails(if(switchSplitPayment!!.isChecked) splitPaymentDetails.toString() else null)  // pass here unique usertoken for user  .setUserToken(userTocken)
        .build()
}

private fun initUiSdk(payUPaymentParams: PayUPaymentParams) {
    PayUCheckoutPro.open(
        this,  payUPaymentParams,  getCheckoutProConfig(),  object : PayUCheckoutProListener {

            override fun onPaymentSuccess(response: Any) {
                paymentSuccess(response);  }

            override fun onPaymentFailure(response: Any) {
                Toast.makeText(mContext, "Transaction Failed", Toast.LENGTH_LONG).show()
                payMentFailed();  }

            override fun onPaymentCancel(isTxnInitiated: Boolean) {
                Toast.makeText(mContext, "Transaction Canceled", Toast.LENGTH_LONG).show()
                payMentFailed();  }

            override fun onError(errorResponse: ErrorResponse) {
                val errorMessage: String
                println("Error: Message: ${errorResponse.errorMessage} Error Code: ${errorResponse.errorCode}")
                if (errorResponse != null && errorResponse.errorMessage != null && errorResponse.errorMessage!!.isNotEmpty())
                    errorMessage = errorResponse.errorMessage!!
                else  errorMessage = resources.getString(R.string.some_error_occurred)
                showErrorMsg(errorMessage)
            }

            override fun generateHash(
                map: HashMap<String, String?>,  hashGenerationListener: PayUHashGenerationListener
            ) {
                if (map.containsKey(PayUCheckoutProConstants.CP_HASH_STRING)
                    && map.containsKey(PayUCheckoutProConstants.CP_HASH_STRING) != null  && map.containsKey(PayUCheckoutProConstants.CP_HASH_NAME)
                    && map.containsKey(PayUCheckoutProConstants.CP_HASH_NAME) != null  ) {

                    val hashData = map[PayUCheckoutProConstants.CP_HASH_STRING]
                    val hashName = map[PayUCheckoutProConstants.CP_HASH_NAME]
                    val hashType = map[PayUCheckoutProConstants.CP_HASH_TYPE]

                    var salt =  prodSalt; // binding.etSalt.text.toString()  if (map.containsKey(PayUCheckoutProConstants.CP_POST_SALT))
                        salt = salt.plus(map[PayUCheckoutProConstants.CP_POST_SALT])

                    var hash: String? = null 

//Below hash should be calculated only when integrating Multi-currency support. If not integrating MCP // then no need to have this if check. if (hashName.equals(PayUCheckoutProConstants.CP_LOOKUP_API_HASH, ignoreCase = true)){

                        //Calculate HmacSHA1 hash using the hashData and merchant secret key  hash = HashGenerationUtils.generateHashFromSDK( hashData!!, salt, merchantSecretKey )
                    }else if (hashType.equals(PayUCheckoutProConstants.CP_V2_HASH)){
                        hash = HashGenerationUtils.generateV2HashFromSDK(hashData!!,prodSalt); // HashGenerationUtils.generateV2HashFromSDK(hashData!!,binding.etSalt.text.toString())  } else {
                        //calculate SDH-512 hash using hashData and salt  hash = HashGenerationUtils.generateHashFromSDK(
                            hashData!!,  salt
                        )
                    }

                    if (!TextUtils.isEmpty(hash)) {
                        val hashMap: HashMap<String, String?> = HashMap()
                        hashMap[hashName!!] = hash!!
                        hashGenerationListener.onHashGenerated(hashMap)
                    }
                }
            }

            override fun setWebViewProperties(webView: WebView?, bank: Any?) {
            }
        })
}

private fun getCheckoutProConfig(): PayUCheckoutProConfig {
    OrderDetails
    val checkoutProConfig = PayUCheckoutProConfig()
    checkoutProConfig.paymentModesOrder = getCheckoutOrderList()
    checkoutProConfig.showCbToolbar = true; //!binding.switchHideCbToolBar.isChecked  checkoutProConfig.autoSelectOtp = false; //binding.switchAutoSelectOtp.isChecked  checkoutProConfig.autoApprove = false; //binding.switchAutoApprove.isChecked  checkoutProConfig.surePayCount =0; // binding.etSurePayCount.text.toString().toInt()  checkoutProConfig.cartDetails = ArrayList<OrderDetails>(); //reviewOrderAdapter?.getOrderDetailsList()  checkoutProConfig.showExitConfirmationOnPaymentScreen = true; // !binding.switchDiableCBDialog.isChecked  checkoutProConfig.showExitConfirmationOnCheckoutScreen =true ; //!binding.switchDiableUiDialog.isChecked  checkoutProConfig.merchantName = merchantName; //binding.etMerchantName.text.toString()  checkoutProConfig.merchantLogo = R.mipmap.ic_launcher ***@***.***/ic_launcher  checkoutProConfig.waitingTime = 3000  checkoutProConfig.merchantResponseTimeout = 3000  checkoutProConfig.customNoteDetails = ArrayList<CustomNote>();//getCustomeNoteDetails()  // uncomment below code to perform enforcement //        checkoutProConfig.enforcePaymentList = getEnforcePaymentList()  return checkoutProConfig
}

private fun getEnforcePaymentList(): ArrayList<HashMap<String, String>> {
    val enforceList = ArrayList<HashMap<String,String>>()
    enforceList.add(HashMap<String,String>().apply {  put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.NB.name)
        put(PayUCheckoutProConstants.ENFORCED_IBIBOCODE,"AXIB")

    })
    enforceList.add(HashMap<String,String>().apply {  put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.CARD.name)
        put(PayUCheckoutProConstants.CP_CARD_TYPE, CardType.CC.name)
        put(PayUCheckoutProConstants.CP_CARD_SCHEME, CardScheme.MAST.name)
    })
    return enforceList
}

private fun getCheckoutOrderList(): ArrayList<PaymentMode> {
    val checkoutOrderList = ArrayList<PaymentMode>()

    //For GooglePay  var isGooglePayEnable = true; //binding.switchShowGooglePay.isChecked  var isPhonePayEnable = true; //binding.switchShowPhonePe.isChecked  var isPayTmEnable = true; //binding.switchShowPaytm.isChecked 

if (isGooglePayEnable) checkoutOrderList.add( PaymentMode( PaymentType.UPI, PayUCheckoutProConstants.CP_GOOGLE_PAY ) ) if (isPhonePayEnable) checkoutOrderList.add( PaymentMode( PaymentType.WALLET, PayUCheckoutProConstants.CP_PHONEPE ) ) if (isPayTmEnable) checkoutOrderList.add( PaymentMode( PaymentType.WALLET, PayUCheckoutProConstants.CP_PAYTM ) ) return checkoutOrderList }

private fun showErrorMsg(message: String) {
    println("showSnackBar message: $message");  Toast.makeText(mContext, message, Toast.LENGTH_LONG).show()
}

fun payMentFailed(){
    val intent = Intent()
    intent.putExtra("status", "failed")
    setResult(Activity.RESULT_OK, intent)
    finish()
}

fun paymentSuccess(response: Any){
    response as HashMap<*, *>
    object : CountDownTimer(800,800){
        override fun onTick(millisUntilFinished: Long) {}
        override fun onFinish() {

            val payuRes = response[PayUCheckoutProConstants.CP_PAYU_RESPONSE].toString() ;  println("payuRes payuRes 2 ${payuRes}")

            val payuRes2 = response[PayUCheckoutProConstants.CP_MERCHANT_RESPONSE].toString() ;  println("payuRes payuRes2 2 ${payuRes2}")

           var obj = JSONObject(payuRes)
           var ID=  obj.getString("id");  var trxID =  obj.getString("txnid"); 

Toast.makeText(mContext, "Transaction Success. Transaction ID: $trxID", Toast.LENGTH_LONG).show()

            val intent = Intent()
            intent.putExtra("status", "success")
            intent.putExtra("transID", trxID)
            intent.putExtra("transResponse", payuRes)
            setResult(Activity.RESULT_OK, intent)

            finish()
        }
    }.start()

}

Thanks & Regards, Abhishek Rai +91- 8130740896 On Tue, 29 Nov 2022 at 17:42, Mobile Integration @.***> wrote: Hi Abhishek,

Please use the below link for the testing credentials,

Link:- https://devguide.payu.in/mobile-sdk-ios/getting-started-with-ios-sdk/mobile-sdk-test-environment/

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 29/11/2022 5:35 pm To: @. Cc: @.; @.; @. Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Rishabh, This flag (isProduction) is there and passing values like true for production and falses for testing but it's still not working. If possible pls share once test credentials with us for testing purposes. Thanks & Regards, Abhishek Rai +91- 8130740896 On Tue, 29 Nov 2022 at 10:02, Mobile Integration @.> wrote: Hi Abhishek,

Please set isProduction to true when using Live Key and false when using testing key just set and then check because its related to environment or key salt error.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 28/11/2022 7:46 pm To: @. Cc: @.; @.; @.*** Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team, As I am trying to do the POC about your mobile payment SDK with a test/staging environment but unlucky i am getting errors like below Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject Project Label Gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.6.20" repositories { google() jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:7.3.0' //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { maven {url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"} google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }

App Lable griddle file

plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions' } //apply plugin: 'kotlin-android-extensions' //apply plugin: 'com.android.application' //apply plugin: 'kotlin-android'

android { compileSdkVersion 33 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.payu.sampleapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } dataBinding { enabled = true } buildFeatures { viewBinding = true } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } namespace 'com.payu.sampleapp' } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'in.payu:payu-checkout-pro:2.0.2' implementation 'com.google.android.material:material:1.3.0' implementation 'in.payu:olamoney:1.2.1' // implementation 'in.payu:phonepe-intent:1.6.2' implementation 'in.payu:payu-gpay:1.5.1' implementation 'in.payu:native-otp-assist:1.3.1' }

Credentils & Activity

private val email: String = @." private val phone = "9999999999" private val merchantName = "RH Group" private val surl = "https://payu.herokuapp.com/success" private val furl = "https://payu.herokuapp.com/failure" private val amount = "1.0" //Test Key and Salt private val testKey = "DC2ahe" private val testSalt = "bjSejErX5TryGH0FOQVV0mrobKkskgi1" / Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */ private val merchantAccessKey = "1642e42b3edc6d4e359dc3c090fadd53a336e57d9d79aa1fb3d0857373a082d0" private val merchantSecretKey = "8c896fcbae5a60eda0ed1369c71c4cbdb9f281b952f8e202e9f45aea21bf986d" //Prod Key and Salt private val prodKey = "0MQaQP" private val prodSalt = ""

Thanks & Regards, Abhishek Rai +91- 8130740896 On Mon, 28 Nov 2022 at 19:36, shahfaizalc @.***> wrote:

@abhishekraics001 Please drop a mail at @.*** for quick help on this.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

abhishekraics001 commented 1 year ago

Hi Team,

Thanks for your quick response.

Please find below the Google Meet meeting https://meet.google.com/mfo-vdkx-gfi link for evaluating this issue.

https://meet.google.com/mfo-vdkx-gfi

Thanks & Regards, Abhishek Rai +91- 8130740896

On Mon, 5 Dec 2022 at 12:31, Mobile Integration @.***> wrote:

@abhishek Please send the meet link, we can connect now.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 5/12/2022 12:12 pm To: @. Cc: @.; @.; @.; @. Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team, Can we connect right now? or you schedule a call for 4 PM today at your convenient?

Requesting you're please confirm your availability.

Thanks & Regards, Abhishek Rai +91- 8130740896

On Mon, 5 Dec 2022 at 09:58, Mobile Integration < @.***> wrote:

Hi Abhishek,

Can we have a call on your below given issue please schedule a call at 11 am and send me the joining link.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 3/12/2022 1:07 pm To: @. Cc: @.; @.; @.; @. Subject: Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team,

I am getting the below error message when trying to test the payment with testing/production credentials but I have the same code base integrated in other project all are working fine but when integrating it other app get error message like below

  • Error Message: Invalid Hash. Error Code: 5019*

    var totalAmount = ""; // Payment ammount private var email: String = ""; //user email id private var phone = ""; //user phone no private var fullName: String = ""; // user display name private var userTocken: String = ""; //userID val productName: String = "PMSC Products"; //Product Name private val merchantName = "PMSC "; //Marchant Name private val surl = "https://payu.herokuapp.com/success" private val furl = "https://payu.herokuapp.com/failure" //Test Key and Salt private val testKey = "gtKFFx" private val testSalt = "4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW" //Prod Key and Salt private var prodKey = "gtKFFx"; // "DC2ahe" private var prodSalt = "4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW"; //""bjSejErX5TryGH0FOQVV0mrobKkskgi1" var isProduction = false; /* Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */ private val merchantAccessKey = "" private val merchantSecretKey = "" // variable to track event time private var mLastClickTime: Long = 0

    override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_payment) mContext = @.*** //prodKey = (applicationContext as App).allAppSettings.getValue(APIConst.KEY_MERCHANT) // prodSalt = (applicationContext as App).allAppSettings.getValue(APIConst.KEY_SALT) Log.d("Payu Details ", "PAYUBIZ_MERCHANT_KEY: $prodKey PAYUBIZ_SALT_KEY:$prodSalt")

    email = Utility().getSharePref(mContext, APIConst.EMAIL_ID)
    phone = Utility().getSharePref(mContext, APIConst.V_PHONE_NUMBER)
    fullName = Utility().getSharePref(mContext, APIConst.FIRST_NAME)
    userTocken = Utility().getSharePref(mContext, APIConst.USER_ID)
    
    totalAmount = (applicationContext as App).totalAmount        //totalAmount ="1"        Log.d("Total Payment",  ""+totalAmount);
    //Open payment SDK/Page after 1 second        object : CountDownTimer(1000, 1000) {
        override fun onTick(millisUntilFinished: Long) {
    
        }
        override fun onFinish() {
            startPayment();            }
    }.start()

    }

    fun startPayment() { // Preventing multiple clicks, using threshold of 1 second if (SystemClock.elapsedRealtime() - mLastClickTime < 1000) { return } mLastClickTime = SystemClock.elapsedRealtime() val paymentParams = preparePayUBizParams()

    //Init payment SDK/Page        initUiSdk(paymentParams)

    }

    fun preparePayUBizParams(): PayUPaymentParams { val vasForMobileSdkHash = HashGenerationUtils.generateHashFromSDK( "${prodKey}|${PayUCheckoutProConstants.CP_VAS_FOR_MOBILE_SDK}|${PayUCheckoutProConstants.CP_DEFAULT}|", prodSalt ) val paymenRelatedDetailsHash = HashGenerationUtils.generateHashFromSDK( "${prodKey}|${PayUCheckoutProConstants.CP_PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK}|${"${prodKey}:$email"}|", prodSalt )

    val additionalParamsMap: HashMap<String, Any?> = HashMap()
    additionalParamsMap[PayUCheckoutProConstants.CP_UDF1] = "udf1"        additionalParamsMap[PayUCheckoutProConstants.CP_UDF2] = "udf2"        additionalParamsMap[PayUCheckoutProConstants.CP_UDF3] = "udf3"        additionalParamsMap[PayUCheckoutProConstants.CP_UDF4] = "udf4"        additionalParamsMap[PayUCheckoutProConstants.CP_UDF5] = "udf5"        //Below params should be passed only when integrating Multi-currency support        //TODO Please pass your own Merchant Access Key below as provided by your Key Account Manager at PayU.//        additionalParamsMap[PayUCheckoutProConstants.CP_MERCHANT_ACCESS_KEY] = merchantAccessKey        //Below param should be passed only when sodexo payment option is enabled and to show saved sodexo card//        additionalParamsMap[PayUCheckoutProConstants.SODEXO_SOURCE_ID] = sodesosrcid  // merchant has to pass this        //Below hashes are static hashes and can be calculated and passed in additional params        additionalParamsMap[PayUCheckoutProConstants.CP_VAS_FOR_MOBILE_SDK] = vasForMobileSdkHash
    additionalParamsMap[PayUCheckoutProConstants.CP_PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK] =
        paymenRelatedDetailsHash
    
    return PayUPaymentParams.Builder()
        .setAmount(totalAmount)
        .setIsProduction(isProduction)
        .setKey(prodKey)
        .setProductInfo(productName)
        .setPhone(phone)
        .setTransactionId(System.currentTimeMillis().toString())
        .setFirstName(fullName)
        .setEmail(email)
        .setSurl(surl)
        .setFurl(furl)
        .setUserCredential("${prodKey}:$email")
        .setAdditionalParams(additionalParamsMap)
        //.setPayUSIParams(siDetails)            //.setSplitPaymentDetails(if(switchSplitPayment!!.isChecked) splitPaymentDetails.toString() else null)            // pass here unique usertoken for user            .setUserToken(userTocken)
        .build()

    }

    private fun initUiSdk(payUPaymentParams: PayUPaymentParams) { PayUCheckoutPro.open( this, payUPaymentParams, getCheckoutProConfig(), object : PayUCheckoutProListener {

            override fun onPaymentSuccess(response: Any) {
                paymentSuccess(response);                }
    
            override fun onPaymentFailure(response: Any) {
                Toast.makeText(mContext, "Transaction Failed", Toast.LENGTH_LONG).show()
                payMentFailed();                }
    
            override fun onPaymentCancel(isTxnInitiated: Boolean) {
                Toast.makeText(mContext, "Transaction Canceled", Toast.LENGTH_LONG).show()
                payMentFailed();                }
    
            override fun onError(errorResponse: ErrorResponse) {
                val errorMessage: String
                println("Error: Message: ${errorResponse.errorMessage}  Error Code: ${errorResponse.errorCode}")
                if (errorResponse != null && errorResponse.errorMessage != null && errorResponse.errorMessage!!.isNotEmpty())
                    errorMessage = errorResponse.errorMessage!!
                else                        errorMessage = resources.getString(R.string.some_error_occurred)
                showErrorMsg(errorMessage)
            }
    
            override fun generateHash(
                map: HashMap<String, String?>,                    hashGenerationListener: PayUHashGenerationListener
            ) {
                if (map.containsKey(PayUCheckoutProConstants.CP_HASH_STRING)
                    && map.containsKey(PayUCheckoutProConstants.CP_HASH_STRING) != null                        && map.containsKey(PayUCheckoutProConstants.CP_HASH_NAME)
                    && map.containsKey(PayUCheckoutProConstants.CP_HASH_NAME) != null                    ) {
    
                    val hashData = map[PayUCheckoutProConstants.CP_HASH_STRING]
                    val hashName = map[PayUCheckoutProConstants.CP_HASH_NAME]
                    val hashType = map[PayUCheckoutProConstants.CP_HASH_TYPE]
    
                    var salt =  prodSalt; // binding.etSalt.text.toString()                        if (map.containsKey(PayUCheckoutProConstants.CP_POST_SALT))
                        salt = salt.plus(map[PayUCheckoutProConstants.CP_POST_SALT])
    
                    var hash: String? = null
                    //Below hash should be calculated only when integrating Multi-currency support. If not integrating MCP                        // then no need to have this if check.                        if (hashName.equals(PayUCheckoutProConstants.CP_LOOKUP_API_HASH, ignoreCase = true)){
    
                        //Calculate HmacSHA1 hash using the hashData and merchant secret key                            hash = HashGenerationUtils.generateHashFromSDK( hashData!!,  salt, merchantSecretKey  )
                    }else if (hashType.equals(PayUCheckoutProConstants.CP_V2_HASH)){
                        hash = HashGenerationUtils.generateV2HashFromSDK(hashData!!,prodSalt); // HashGenerationUtils.generateV2HashFromSDK(hashData!!,binding.etSalt.text.toString())                        } else {
                        //calculate SDH-512 hash using hashData and salt                            hash = HashGenerationUtils.generateHashFromSDK(
                            hashData!!,                                salt
                        )
                    }
    
                    if (!TextUtils.isEmpty(hash)) {
                        val hashMap: HashMap<String, String?> = HashMap()
                        hashMap[hashName!!] = hash!!
                        hashGenerationListener.onHashGenerated(hashMap)
                    }
                }
            }
    
            override fun setWebViewProperties(webView: WebView?, bank: Any?) {
            }
        })

    }

    private fun getCheckoutProConfig(): PayUCheckoutProConfig { OrderDetails val checkoutProConfig = PayUCheckoutProConfig() checkoutProConfig.paymentModesOrder = getCheckoutOrderList() checkoutProConfig.showCbToolbar = true; //!binding.switchHideCbToolBar.isChecked checkoutProConfig.autoSelectOtp = false; //binding.switchAutoSelectOtp.isChecked checkoutProConfig.autoApprove = false; //binding.switchAutoApprove.isChecked checkoutProConfig.surePayCount =0; // binding.etSurePayCount.text.toString().toInt() checkoutProConfig.cartDetails = ArrayList(); //reviewOrderAdapter?.getOrderDetailsList() checkoutProConfig.showExitConfirmationOnPaymentScreen = true; // !binding.switchDiableCBDialog.isChecked checkoutProConfig.showExitConfirmationOnCheckoutScreen =true ; //!binding.switchDiableUiDialog.isChecked checkoutProConfig.merchantName = merchantName; //binding.etMerchantName.text.toString() checkoutProConfig.merchantLogo = R.mipmap.ic_launcher @.***/ic_launcher checkoutProConfig.waitingTime = 3000 checkoutProConfig.merchantResponseTimeout = 3000 checkoutProConfig.customNoteDetails = ArrayList();//getCustomeNoteDetails() // uncomment below code to perform enforcement// checkoutProConfig.enforcePaymentList = getEnforcePaymentList() return checkoutProConfig }

    private fun getEnforcePaymentList(): ArrayList<HashMap<String, String>> { val enforceList = ArrayList<HashMap<String,String>>() enforceList.add(HashMap<String,String>().apply { put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.NB.name) put(PayUCheckoutProConstants.ENFORCED_IBIBOCODE,"AXIB")

    })
    enforceList.add(HashMap<String,String>().apply {            put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.CARD.name)
        put(PayUCheckoutProConstants.CP_CARD_TYPE, CardType.CC.name)
        put(PayUCheckoutProConstants.CP_CARD_SCHEME, CardScheme.MAST.name)
    })
    return enforceList

    }

    private fun getCheckoutOrderList(): ArrayList { val checkoutOrderList = ArrayList()

    //For GooglePay        var isGooglePayEnable = true; //binding.switchShowGooglePay.isChecked        var isPhonePayEnable = true; //binding.switchShowPhonePe.isChecked        var isPayTmEnable = true; //binding.switchShowPaytm.isChecked
    if (isGooglePayEnable) checkoutOrderList.add(
        PaymentMode(
            PaymentType.UPI,                PayUCheckoutProConstants.CP_GOOGLE_PAY            )
    )
    if (isPhonePayEnable) checkoutOrderList.add(
        PaymentMode(
            PaymentType.WALLET,                PayUCheckoutProConstants.CP_PHONEPE            )
    )
    if (isPayTmEnable) checkoutOrderList.add(
        PaymentMode(
            PaymentType.WALLET,                PayUCheckoutProConstants.CP_PAYTM            )
    )
    return checkoutOrderList

    }

    private fun showErrorMsg(message: String) { println("showSnackBar message: $message"); Toast.makeText(mContext, message, Toast.LENGTH_LONG).show() }

    fun payMentFailed(){ val intent = Intent() intent.putExtra("status", "failed") setResult(Activity.RESULT_OK, intent) finish() }

    fun paymentSuccess(response: Any){ response as HashMap<, > object : CountDownTimer(800,800){ override fun onTick(millisUntilFinished: Long) {} override fun onFinish() {

            val payuRes = response[PayUCheckoutProConstants.CP_PAYU_RESPONSE].toString() ;                println("payuRes payuRes 2 ${payuRes}")
    
            val payuRes2 = response[PayUCheckoutProConstants.CP_MERCHANT_RESPONSE].toString() ;                println("payuRes payuRes2 2 ${payuRes2}")
    
           var obj = JSONObject(payuRes)
           var ID=  obj.getString("id");                var trxID =  obj.getString("txnid");                Toast.makeText(mContext, "Transaction Success. Transaction ID: $trxID", Toast.LENGTH_LONG).show()
    
            val intent = Intent()
            intent.putExtra("status", "success")
            intent.putExtra("transID", trxID)
            intent.putExtra("transResponse", payuRes)
            setResult(Activity.RESULT_OK, intent)
    
            finish()
        }
    }.start()

    }

Thanks & Regards, Abhishek Rai +91- 8130740896

On Tue, 29 Nov 2022 at 17:42, Mobile Integration < @.***> wrote:

Hi Abhishek,

Please use the below link for the testing credentials,

Link:- https://devguide.payu.in/mobile-sdk-ios/getting-started-with-ios-sdk/mobile-sdk-test-environment/

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 29/11/2022 5:35 pm To: @. Cc: @.; @.; @.** Subject:* Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Rishabh,

This flag (isProduction) is there and passing values like true for production and falses for testing but it's still not working.

If possible pls share once test credentials with us for testing purposes.

Thanks & Regards, Abhishek Rai +91- 8130740896

On Tue, 29 Nov 2022 at 10:02, Mobile Integration < @.***> wrote:

Hi Abhishek,

Please set isProduction to true when using Live Key and false when using testing key just set and then check because its related to environment or key salt error.

Thanks & Regards Rishabh Jaiswal Mobile Integration Team, PayU India

--------------- Original Message --------------- From: Abhishek Rai @. Sent: 28/11/2022 7:46 pm To: @. Cc: @.; @.; @.** Subject:* Re: [payu-intrepos/PayUCheckoutPro-Android] Value Hi Team,

As I am trying to do the POC about your mobile payment SDK with a test/staging environment but unlucky i am getting errors like below Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

Project Label Gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { ext.kotlin_version = "1.6.20" repositories { google() jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:7.3.0' //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }} allprojects { repositories { maven {url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"} google() jcenter() }} task clean(type: Delete) { delete rootProject.buildDir}

App Lable griddle file

plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions'}//apply plugin: 'kotlin-android-extensions'//apply plugin: 'com.android.application'//apply plugin: 'kotlin-android'

android { compileSdkVersion 33 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.payu.sampleapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } dataBinding { enabled = true } buildFeatures { viewBinding = true } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } namespace 'com.payu.sampleapp'} dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'in.payu:payu-checkout-pro:2.0.2' implementation 'com.google.android.material:material:1.3.0' implementation 'in.payu:olamoney:1.2.1'// implementation 'in.payu:phonepe-intent:1.6.2' implementation 'in.payu:payu-gpay:1.5.1' implementation 'in.payu:native-otp-assist:1.3.1'}

Credentils & Activity

private val email: String = @."private val phone = "9999999999"private val merchantName = "RH Group"private val surl = "https://payu.herokuapp.com/success"private val furl = "https://payu.herokuapp.com/failure"private val amount = "1.0"//Test Key and Saltprivate val testKey = "DC2ahe"private val testSalt = "bjSejErX5TryGH0FOQVV0mrobKkskgi1"/ Enter below keys when integrating Multi Currency Payments. To get these credentials, please reach out to your Key Account Manager at PayU */private val merchantAccessKey = "1642e42b3edc6d4e359dc3c090fadd53a336e57d9d79aa1fb3d0857373a082d0"private val merchantSecretKey = "8c896fcbae5a60eda0ed1369c71c4cbdb9f281b952f8e202e9f45aea21bf986d"//Prod Key and Saltprivate val prodKey = "0MQaQP"private val prodSalt = ""

Thanks & Regards, Abhishek Rai +91- 8130740896

On Mon, 28 Nov 2022 at 19:36, shahfaizalc @.***> wrote:

@abhishekraics001 https://github.com/abhishekraics001 Please drop a mail at @.*** for quick help on this.

— Reply to this email directly, view it on GitHub https://github.com/payu-intrepos/PayUCheckoutPro-Android/issues/24#issuecomment-1329168423, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZRRGXGS2EHE55QKTGYH6DWKS37BANCNFSM5KIWPC4Q . You are receiving this because you were mentioned.Message ID: @.*** com>