Skip to content

Commit

Permalink
fix trackings paypal endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaimoiseanu committed Mar 27, 2024
1 parent aefe4de commit 9c2121c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public PayIn deserialize(JsonElement json, Type typeOfT, JsonDeserializationCont
payInPaymentDetailsPayPal.setPaypalOrderID(object.get("PaypalOrderID").getAsString());
}
if (object.has("Trackings") && !object.get("Trackings").isJsonNull()) {
payInPaymentDetailsPayPal.setTrackings((PayPalWebTrackingData) context.deserialize(object.get("Trackings"), PayPalWebTrackingData.class));
Type listType = new TypeToken<ArrayList<PayPalWebTrackingData>>() {
}.getType();
payInPaymentDetailsPayPal.setTrackings((List<PayPalWebTrackingData>) context.deserialize(object.get("Trackings"), listType));
}

payIn.setPaymentDetails(payInPaymentDetailsPayPal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class PayInPaymentDetailsPayPal extends Dto implements PayInPaymentDetail
private String paypalBuyerAccountEmail;

@SerializedName("Trackings")
private PayPalWebTrackingData trackings;
private List<PayPalWebTrackingData> trackings;

public ShippingAddress getShippingAddress() {
return shippingAddress;
Expand Down Expand Up @@ -204,11 +204,11 @@ public PayInPaymentDetailsPayPal setPaypalOrderID(String paypalOrderID) {
return this;
}

public PayPalWebTrackingData getTrackings() {
public List<PayPalWebTrackingData> getTrackings() {
return trackings;
}

public PayInPaymentDetailsPayPal setTrackings(PayPalWebTrackingData trackings) {
public PayInPaymentDetailsPayPal setTrackings(List<PayPalWebTrackingData> trackings) {
this.trackings = trackings;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.mangopay.entities.subentities;

import com.google.gson.annotations.SerializedName;
import com.mangopay.core.Dto;
import com.mangopay.core.EntityBase;

public class PayPalWebTrackingData extends Dto {
public class PayPalWebTrackingData extends EntityBase {

/**
* The shipment’s tracking number provided by the carrier.
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/com/mangopay/core/mangopay.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Fri Feb 16 11:11:37 EET 2024
#Wed Mar 27 13:36:37 EET 2024
version=2.36.0

0 comments on commit 9c2121c

Please sign in to comment.