Skip to content

Commit

Permalink
Update PaymentAgreement model to savecard response i.e verify api
Browse files Browse the repository at this point in the history
  • Loading branch information
AhlaamK-tap committed Aug 8, 2024
1 parent 7219b77 commit 4d533fa
Show file tree
Hide file tree
Showing 37 changed files with 199 additions and 17 deletions.
Binary file added .gradle/6.7.1/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/6.7.1/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/6.7.1/gc.properties
Empty file.
Binary file not shown.
Empty file.
Binary file added .gradle/7.2/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/7.2/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/7.2/gc.properties
Empty file.
Binary file added .gradle/7.4/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/7.4/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/7.4/checksums/sha1-checksums.bin
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added .gradle/7.4/executionHistory/executionHistory.bin
Binary file not shown.
Binary file added .gradle/7.4/executionHistory/executionHistory.lock
Binary file not shown.
Binary file added .gradle/7.4/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/7.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/7.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file added .gradle/7.4/fileHashes/resourceHashesCache.bin
Binary file not shown.
Empty file added .gradle/7.4/gc.properties
Empty file.
4 changes: 2 additions & 2 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Tue Jul 02 14:51:53 AST 2024
gradle.version=7.4.2
#Thu Aug 08 10:38:15 AST 2024
gradle.version=7.4
Binary file added .gradle/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/checksums/sha1-checksums.bin
Binary file not shown.
Empty file.
Binary file modified .gradle/file-system.probe
Binary file not shown.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## [3.19.17] - 2024-08-08
### Hot Fix:
- Hot fix for updating paymentagreement model.
### Impact on existing integrations:
- May need to update gradles to support latest apis.


## [3.19.14] - 2024-07-02
### Hot Fix:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ To integrate goSellSDK into your project add it in your **root** `build.gradle`
Step 2. Add the dependency
```java
dependencies {
implementation 'com.github.Tap-Payments:goSellSDK-AndroidX:3.19.14'
implementation 'com.github.Tap-Payments:goSellSDK-AndroidX:3.19.17'
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ public void paymentSucceed(@NonNull Charge charge) {
System.out.println("Payment Succeeded : expiry type :" + charge.getExpiry().getType());
System.out.println("Payment Succeeded : expiry period :" + charge.getExpiry().getPeriod());
}

saveCustomerRefInSession(charge);
configureSDKSession();
showDialog(charge.getId(), charge.getResponse().getMessage(), company.tap.gosellapi.R.drawable.ic_checkmark_normal);
Expand Down Expand Up @@ -498,13 +499,14 @@ public void cardSaved(@NonNull Charge charge) {
// Cast charge object to SaveCard first to get all the Card info.
if (charge instanceof SaveCard) {
System.out.println("Card Saved Succeeded : first six digits : " + ((SaveCard) charge).getCard().getFirstSix() + " last four :" + ((SaveCard) charge).getCard().getLast4());

System.out.println("Card Saved Succeeded : " + charge.getStatus());
System.out.println("Card Saved Succeeded : " + charge.getCard().getBrand());
System.out.println("Card Saved Succeeded : " + charge.getDescription());
System.out.println("Card Saved Succeeded : " + charge.getResponse().getMessage());
System.out.println("Card Saved Succeeded ID : " + ((SaveCard) charge).getPaymentAgreement().getId());
System.out.println("Card Saved Succeeded Contract: " + ((SaveCard) charge).getPaymentAgreement().getContract().getType());
}
System.out.println("Card Saved Succeeded : " + charge.getStatus());
System.out.println("Card Saved Succeeded : " + charge.getCard().getBrand());
System.out.println("Card Saved Succeeded : " + charge.getDescription());
System.out.println("Card Saved Succeeded : " + charge.getResponse().getMessage());
System.out.println("Card Saved Succeeded : " + ((SaveCard) charge).getCardIssuer().getName());
System.out.println("Card Saved Succeeded : " + ((SaveCard) charge).getCardIssuer().getId());
saveCustomerRefInSession(charge);
showDialog(charge.getId(), charge.getStatus().toString(), company.tap.gosellapi.R.drawable.ic_checkmark_normal);
}
Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun Feb 04 12:32:36 AST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static OkHttpClient getOkHttpClient() {
return chain.proceed(request);
});

httpClientBuilder.addInterceptor(new HttpLoggingInterceptor().setLevel(showDebug ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE));
httpClientBuilder.addInterceptor(new HttpLoggingInterceptor().setLevel(showDebug ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.BODY));

return httpClientBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package company.tap.gosellapi.internal.api.models;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
Expand All @@ -17,16 +18,16 @@ public final class CardIssuer implements Serializable {

@SerializedName("id")
@Expose
@NonNull
@Nullable
private String id;

@SerializedName("name")
@Expose
@NonNull private String name;
@Nullable private String name;

@SerializedName("country")
@Expose
@NonNull private String country;
@Nullable private String country;

public String getName() {
return name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public class Charge implements BaseResponse, Serializable {
@SerializedName("threeDSecure")
@Expose
private boolean threeDSecure;





/* @SerializedName("save_card")
@Expose
private boolean saveCard;*/
Expand Down Expand Up @@ -140,6 +145,7 @@ public class Charge implements BaseResponse, Serializable {
@Nullable private TopUp topup;



@Nullable
public Card getCard() {
return card;
Expand Down Expand Up @@ -374,4 +380,6 @@ public Destinations getDestinations() {
public TopUp getTopup() {
return topup;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package company.tap.gosellapi.internal.api.models;

import androidx.annotation.Nullable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

public class Contract implements Serializable {

@SerializedName("id")
@Expose
@Nullable
private String id;

@SerializedName("customer_id")
@Expose
@Nullable
private String customerId;


@SerializedName("type")
@Expose
@Nullable
private String type;


@Nullable
public String getId() {
return id;
}

@Nullable
public String getType() {
return type;
}

@Nullable
public String getCustomerId() {
return customerId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package company.tap.gosellapi.internal.api.models;

import androidx.annotation.Nullable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

public class Metdata implements Serializable {

/* @SerializedName("txn_type")
@Expose
@Nullable
private String txnType;
@SerializedName("txn_id")
@Expose
@Nullable
private String txnId;
@SerializedName("terminal_id")
@Expose
@Nullable
private String terminalId;
*/
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package company.tap.gosellapi.internal.api.models;

import androidx.annotation.Nullable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class PaymentAgreement implements Serializable {
@SerializedName("id")
@Expose
@Nullable
private String id;

@SerializedName("type")
@Expose
@Nullable
private String type;


@SerializedName("trace_id")
@Expose
@Nullable
private String traceId;

@SerializedName("total_payments_count")
@Expose
@Nullable
private int totalPaymentsCount;

@SerializedName("contract")
@Expose
@Nullable
private Contract contract;


@SerializedName("metadata")
@Expose
@Nullable
private Map<String,String> metadata;


/**
* get PaymentAgreement ID
* @return PaymentAgreement
*/
@Nullable
public String getId() {
return id;
} /**
* get PaymentAgreement type
* @return type
*/
@Nullable
public String getType() {
return type;
} /**
* get PaymentAgreement traceId
* @return PaymentAgreement
*/
@Nullable
public String getTraceId() {
return traceId;
} /**
* get PaymentAgreement totalPaymentsCount
* @return PaymentAgreement
*/
@Nullable
public int getTotalPaymentCount() {
return totalPaymentsCount;
}


@Nullable
public Contract getContract() {
return contract;
}
@Nullable
public Map<String,String> getMetadata() {
return metadata;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public final class SaveCard extends Charge{
@Expose
@Nullable private CardIssuer card_issuer;


@SerializedName("payment_agreement")
@Expose
@Nullable private PaymentAgreement paymentAgreement;
/**
* Is save card boolean.
*
Expand Down Expand Up @@ -103,6 +105,13 @@ public CardIssuer getCardIssuer() {
return card_issuer;
}


/**
* Gets topup
* @return
*/
@Nullable
public PaymentAgreement getPaymentAgreement() {
return paymentAgreement;
}

}

0 comments on commit 4d533fa

Please sign in to comment.