-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39dcc8d
commit 2d90bdd
Showing
10 changed files
with
387 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
JazzCashLib/src/main/java/com/nouman/jazzcashlib/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
241 changes: 217 additions & 24 deletions
241
JazzCashLib/src/main/java/com/nouman/jazzcashlib/JazzCash.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 36 additions & 1 deletion
37
app/src/main/java/com/nouman/hexabytestudios/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,59 @@ | ||
package com.nouman.hexabytestudios; | ||
|
||
import androidx.activity.result.ActivityResult; | ||
import androidx.activity.result.ActivityResultCallback; | ||
import androidx.activity.result.ActivityResultLauncher; | ||
import androidx.activity.result.contract.ActivityResultContracts; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.Toast; | ||
|
||
import com.nouman.jazzcashlib.Constants; | ||
import com.nouman.jazzcashlib.JazzCashResponse; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
Button BuyNow; | ||
Button BuyNow,BuyNowActivityResult; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
BuyNow = findViewById(R.id.buyNow); | ||
BuyNowActivityResult = findViewById(R.id.buyNowActivityResult); | ||
|
||
// for result on next screen// | ||
BuyNow.setOnClickListener(view -> { | ||
Intent intent = new Intent(MainActivity.this, PaymentActivity.class); | ||
intent.putExtra("price", "1500.00"); | ||
startActivity(intent); | ||
}); | ||
|
||
|
||
// for result on this screen | ||
BuyNowActivityResult.setOnClickListener(view -> { | ||
Intent intent = new Intent(MainActivity.this, PaymentActivity.class); | ||
intent.putExtra("price", "1500.00"); | ||
jazzCashLauncher.launch(intent); | ||
|
||
}); | ||
} | ||
|
||
ActivityResultLauncher<Intent> jazzCashLauncher = registerForActivityResult( | ||
new ActivityResultContracts.StartActivityForResult(), | ||
new ActivityResultCallback<ActivityResult>() { | ||
@Override | ||
public void onActivityResult(ActivityResult result) { | ||
if (result.getResultCode() == Activity.RESULT_OK) { | ||
Intent data = result.getData(); | ||
JazzCashResponse jazzCashResponse = (JazzCashResponse) data.getSerializableExtra(Constants.jazzCashResponse); | ||
Toast.makeText(MainActivity.this, jazzCashResponse.getPpResponseMessage(), Toast.LENGTH_SHORT).show(); | ||
} | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Jan 31 13:33:08 PKT 2022 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |