Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
Releasing for 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PatilShreyas committed Jun 3, 2019
1 parent 30c4a00 commit a4dee85
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
4 changes: 3 additions & 1 deletion EasyUpiPayment/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

version = "0.1"
version = "1.0"

android {
compileSdkVersion 28
Expand Down Expand Up @@ -32,10 +32,12 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.annotation:annotation:1.0.2'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

}

ext {
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ In your `build.gradle` file of app module, add below dependency to import this l

```gradle
dependencies {
implementation 'com.shreyaspatil:EasyUpiPayment:0.1-beta'
implementation 'com.shreyaspatil:EasyUpiPayment:1.0'
}
```

Expand All @@ -43,19 +43,20 @@ You can see below code, these are minimum and mandatory calls to enable payment
```java
final EasyUpiPayment easyUpiPayment = new EasyUpiPayment.Builder()
.with(this)
.setPayeeVpa("example@vpa")
.setPayeeName("Example")
.setDescription("Description or small note")
.setAmount("10.00")
.setPayeeVpa("EXAMPLE@VPA")
.setPayeeName("PAYEE_NAME")
.setTransactionId("UNIQUE_TRANSACTION_ID")
.setDescription("DESCRIPTION_OR_SMALL_NOT")
.setAmount("AMOUNT_IN_DECIMAL_XX.XX")
.build();
```
**Calls and Descriptions :**
* `with()` : **Mandatory** and this call takes `Activity` as a parameter and.
* `setPayeeVpa()` : **Mandatory** and takes VPA address of payee for e.g. ***`shreyas@upi`***
* `setTransactionId()` : This field is mandatory and used in Merchant Payments generated by PSPs.
* `setDescription()` : **Mandatory** and have to provide valid small note or description about payment. for e.g. *For Food*
* `setAmount()` : **Mandatory** and it takes amount in String decimal format (`xx.xx`) to be paid. *For e.g. 90.88* will pay Rs. 90.88.
* `setPayeeMerchantCode` : Payee Merchant code if present it should be passed.
* `setTransactionId()` : This field is used in Merchant Payments generated by PSPs.
* `setTransactionRefId()` : Transaction reference ID. This could be order number, subscription number, Bill ID, booking ID, insurance renewal reference, etc. Needed for merchant transactions and dynamic URL generation.
* `build()` : It will build and returns the `EasyUpiPayment` instance.

Expand All @@ -75,6 +76,7 @@ To register for callback events, you will have to set `PaymentStatusListener` wi
* `onTransactionCompleted()` - This method is invoked when transaction is completed. It may either `SUCCESS` or `FAILED`.
> **NOTE - If onTransactionCompleted() is invoked it doesn't means that payment is successful. It may fail but transaction is completed is the only purpose.**
* `onTransactionSuccess()` - Invoked when Payment is successful.
* `onTransactionSubmitted()` - Invoked when Payment is partially done/In waiting/Submitted/Pending.
* `onTransactionFailed()` - Invoked when Payment is unsuccessful/failed.
* `onTransactionCancelled()` - Invoked when Payment cancelled (User pressed back button or any reason).
```java
Expand All @@ -92,6 +94,13 @@ To register for callback events, you will have to set `PaymentStatusListener` wi
imageView.setImageResource(R.drawable.ic_success);
}

@Override
public void onTransactionSubmitted() {
// Payment Pending
Toast.makeText(this, "Pending | Submitted", Toast.LENGTH_SHORT).show();
imageView.setImageResource(R.drawable.ic_success);
}

@Override
public void onTransactionFailed() {
// Payment Failed
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ dependencies {
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

//EasyUpiPayment Library
implementation 'com.shreyaspatil:EasyUpiPayment:1.0'

//implementation 'com.shreyaspatil:EasyUpiPayment:0.1-beta'
implementation project(path: ':EasyUpiPayment')
//implementation project(path: ':EasyUpiPayment')
}
10 changes: 5 additions & 5 deletions app/src/main/java/com/example/easyupipayment/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ protected void onCreate(Bundle savedInstanceState) {
//Create instance of EasyUpiPayment
final EasyUpiPayment easyUpiPayment = new EasyUpiPayment.Builder()
.with(this)
.setPayeeVpa("9420788384@upi")
.setPayeeName("Sharad Shankar Patil")
.setTransactionId(String.valueOf(System.currentTimeMillis()))
.setDescription("Description or small note")
.setAmount("2.00")
.setPayeeVpa("EXAMPLE@VPA")
.setPayeeName("PAYEE_NAME")
.setTransactionId("UNIQUE_TRANSACTION_ID")
.setDescription("DESCRIPTION_OR_SMALL_NOT")
.setAmount("AMOUNT_IN_DECIMAL_XX.XX")
.build();

//Register Listener for Events
Expand Down

0 comments on commit a4dee85

Please sign in to comment.