diff --git a/.gradle/6.7.1/fileChanges/last-build.bin b/.gradle/6.7.1/fileChanges/last-build.bin new file mode 100644 index 00000000..f76dd238 Binary files /dev/null and b/.gradle/6.7.1/fileChanges/last-build.bin differ diff --git a/.gradle/6.7.1/fileHashes/fileHashes.lock b/.gradle/6.7.1/fileHashes/fileHashes.lock new file mode 100644 index 00000000..04c49ead Binary files /dev/null and b/.gradle/6.7.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/6.7.1/gc.properties b/.gradle/6.7.1/gc.properties new file mode 100644 index 00000000..e69de29b diff --git a/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock b/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 00000000..bb7b5829 Binary files /dev/null and b/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock differ diff --git a/.gradle/7.2/dependencies-accessors/gc.properties b/.gradle/7.2/dependencies-accessors/gc.properties new file mode 100644 index 00000000..e69de29b diff --git a/.gradle/7.2/fileChanges/last-build.bin b/.gradle/7.2/fileChanges/last-build.bin new file mode 100644 index 00000000..f76dd238 Binary files /dev/null and b/.gradle/7.2/fileChanges/last-build.bin differ diff --git a/.gradle/7.2/fileHashes/fileHashes.lock b/.gradle/7.2/fileHashes/fileHashes.lock new file mode 100644 index 00000000..8d33c876 Binary files /dev/null and b/.gradle/7.2/fileHashes/fileHashes.lock differ diff --git a/.gradle/7.2/gc.properties b/.gradle/7.2/gc.properties new file mode 100644 index 00000000..e69de29b diff --git a/.gradle/7.4/checksums/checksums.lock b/.gradle/7.4/checksums/checksums.lock new file mode 100644 index 00000000..4b42f805 Binary files /dev/null and b/.gradle/7.4/checksums/checksums.lock differ diff --git a/.gradle/7.4/checksums/md5-checksums.bin b/.gradle/7.4/checksums/md5-checksums.bin new file mode 100644 index 00000000..c8b43f76 Binary files /dev/null and b/.gradle/7.4/checksums/md5-checksums.bin differ diff --git a/.gradle/7.4/checksums/sha1-checksums.bin b/.gradle/7.4/checksums/sha1-checksums.bin new file mode 100644 index 00000000..948ca5ca Binary files /dev/null and b/.gradle/7.4/checksums/sha1-checksums.bin differ diff --git a/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock b/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 00000000..6f4a7cf3 Binary files /dev/null and b/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock differ diff --git a/.gradle/7.4/dependencies-accessors/gc.properties b/.gradle/7.4/dependencies-accessors/gc.properties new file mode 100644 index 00000000..e69de29b diff --git a/.gradle/7.4/executionHistory/executionHistory.bin b/.gradle/7.4/executionHistory/executionHistory.bin new file mode 100644 index 00000000..31c019cc Binary files /dev/null and b/.gradle/7.4/executionHistory/executionHistory.bin differ diff --git a/.gradle/7.4/executionHistory/executionHistory.lock b/.gradle/7.4/executionHistory/executionHistory.lock new file mode 100644 index 00000000..235675ef Binary files /dev/null and b/.gradle/7.4/executionHistory/executionHistory.lock differ diff --git a/.gradle/7.4/fileChanges/last-build.bin b/.gradle/7.4/fileChanges/last-build.bin new file mode 100644 index 00000000..f76dd238 Binary files /dev/null and b/.gradle/7.4/fileChanges/last-build.bin differ diff --git a/.gradle/7.4/fileHashes/fileHashes.bin b/.gradle/7.4/fileHashes/fileHashes.bin new file mode 100644 index 00000000..34b59db0 Binary files /dev/null and b/.gradle/7.4/fileHashes/fileHashes.bin differ diff --git a/.gradle/7.4/fileHashes/fileHashes.lock b/.gradle/7.4/fileHashes/fileHashes.lock new file mode 100644 index 00000000..d703a281 Binary files /dev/null and b/.gradle/7.4/fileHashes/fileHashes.lock differ diff --git a/.gradle/7.4/fileHashes/resourceHashesCache.bin b/.gradle/7.4/fileHashes/resourceHashesCache.bin new file mode 100644 index 00000000..cfecf281 Binary files /dev/null and b/.gradle/7.4/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/7.4/gc.properties b/.gradle/7.4/gc.properties new file mode 100644 index 00000000..e69de29b diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties index 495576a0..eccb23c1 100644 --- a/.gradle/buildOutputCleanup/cache.properties +++ b/.gradle/buildOutputCleanup/cache.properties @@ -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 diff --git a/.gradle/checksums/checksums.lock b/.gradle/checksums/checksums.lock new file mode 100644 index 00000000..2491938b Binary files /dev/null and b/.gradle/checksums/checksums.lock differ diff --git a/.gradle/checksums/md5-checksums.bin b/.gradle/checksums/md5-checksums.bin new file mode 100644 index 00000000..fbf06843 Binary files /dev/null and b/.gradle/checksums/md5-checksums.bin differ diff --git a/.gradle/checksums/sha1-checksums.bin b/.gradle/checksums/sha1-checksums.bin new file mode 100644 index 00000000..f6c6b655 Binary files /dev/null and b/.gradle/checksums/sha1-checksums.bin differ diff --git a/.gradle/configuration-cache/gc.properties b/.gradle/configuration-cache/gc.properties new file mode 100644 index 00000000..e69de29b diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe index a825dd3f..abb447ed 100644 Binary files a/.gradle/file-system.probe and b/.gradle/file-system.probe differ diff --git a/CHANGELOG.md b/CHANGELOG.md index 2339eea1..ef3486ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/README.md b/README.md index 1932b642..5768822e 100644 --- a/README.md +++ b/README.md @@ -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' } ``` diff --git a/goSellSDKSample/src/main/java/company/tap/sample/activity/MainActivity.java b/goSellSDKSample/src/main/java/company/tap/sample/activity/MainActivity.java index c09d0672..0b8fb141 100644 --- a/goSellSDKSample/src/main/java/company/tap/sample/activity/MainActivity.java +++ b/goSellSDKSample/src/main/java/company/tap/sample/activity/MainActivity.java @@ -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); @@ -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); } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d1bf7b3c..41dfb879 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/library/src/main/java/company/tap/gosellapi/internal/api/api_service/RetrofitHelper.java b/library/src/main/java/company/tap/gosellapi/internal/api/api_service/RetrofitHelper.java index 84774c1b..9e5686f9 100644 --- a/library/src/main/java/company/tap/gosellapi/internal/api/api_service/RetrofitHelper.java +++ b/library/src/main/java/company/tap/gosellapi/internal/api/api_service/RetrofitHelper.java @@ -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(); } diff --git a/library/src/main/java/company/tap/gosellapi/internal/api/models/CardIssuer.java b/library/src/main/java/company/tap/gosellapi/internal/api/models/CardIssuer.java index d93da4ef..d689fed5 100644 --- a/library/src/main/java/company/tap/gosellapi/internal/api/models/CardIssuer.java +++ b/library/src/main/java/company/tap/gosellapi/internal/api/models/CardIssuer.java @@ -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; @@ -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; diff --git a/library/src/main/java/company/tap/gosellapi/internal/api/models/Charge.java b/library/src/main/java/company/tap/gosellapi/internal/api/models/Charge.java index 0ecf603c..9279c0ad 100644 --- a/library/src/main/java/company/tap/gosellapi/internal/api/models/Charge.java +++ b/library/src/main/java/company/tap/gosellapi/internal/api/models/Charge.java @@ -84,6 +84,11 @@ public class Charge implements BaseResponse, Serializable { @SerializedName("threeDSecure") @Expose private boolean threeDSecure; + + + + + /* @SerializedName("save_card") @Expose private boolean saveCard;*/ @@ -140,6 +145,7 @@ public class Charge implements BaseResponse, Serializable { @Nullable private TopUp topup; + @Nullable public Card getCard() { return card; @@ -374,4 +380,6 @@ public Destinations getDestinations() { public TopUp getTopup() { return topup; } + + } diff --git a/library/src/main/java/company/tap/gosellapi/internal/api/models/Contract.java b/library/src/main/java/company/tap/gosellapi/internal/api/models/Contract.java new file mode 100644 index 00000000..0eaf7bf1 --- /dev/null +++ b/library/src/main/java/company/tap/gosellapi/internal/api/models/Contract.java @@ -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; + } +} diff --git a/library/src/main/java/company/tap/gosellapi/internal/api/models/Metdata.java b/library/src/main/java/company/tap/gosellapi/internal/api/models/Metdata.java new file mode 100644 index 00000000..2a1e079d --- /dev/null +++ b/library/src/main/java/company/tap/gosellapi/internal/api/models/Metdata.java @@ -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; +*/ +} diff --git a/library/src/main/java/company/tap/gosellapi/internal/api/models/PaymentAgreement.java b/library/src/main/java/company/tap/gosellapi/internal/api/models/PaymentAgreement.java new file mode 100644 index 00000000..a2e5892d --- /dev/null +++ b/library/src/main/java/company/tap/gosellapi/internal/api/models/PaymentAgreement.java @@ -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 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 getMetadata() { + return metadata; + } +} diff --git a/library/src/main/java/company/tap/gosellapi/internal/api/models/SaveCard.java b/library/src/main/java/company/tap/gosellapi/internal/api/models/SaveCard.java index 77295fff..2e44e703 100644 --- a/library/src/main/java/company/tap/gosellapi/internal/api/models/SaveCard.java +++ b/library/src/main/java/company/tap/gosellapi/internal/api/models/SaveCard.java @@ -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. * @@ -103,6 +105,13 @@ public CardIssuer getCardIssuer() { return card_issuer; } - + /** + * Gets topup + * @return + */ + @Nullable + public PaymentAgreement getPaymentAgreement() { + return paymentAgreement; + } }