Skip to content

Commit

Permalink
added serializer, deserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
iulian03 committed Aug 7, 2024
1 parent 52a1cd1 commit 9f63135
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@ public PayIn deserialize(JsonElement json, Type typeOfT, JsonDeserializationCont
payInPaymentDetailsGiropay.setStatementDescriptor(object.get("StatementDescriptor").getAsString());
payIn.setPaymentDetails(payInPaymentDetailsGiropay);
break;
case BCMC:
PayInPaymentDetailsBancontact payInPaymentDetailsBancontact = new PayInPaymentDetailsBancontact();
if (object.has("StatementDescriptor") && !object.get("StatementDescriptor").isJsonNull())
payInPaymentDetailsBancontact.setStatementDescriptor(object.get("StatementDescriptor").getAsString());
if (object.has("DeepLinkURL") && !object.get("DeepLinkURL").isJsonNull())
payInPaymentDetailsBancontact.setDeepLinkUrl(object.get("DeepLinkURL").getAsString());
if (object.has("Recurring") && !object.get("Recurring").isJsonNull())
payInPaymentDetailsBancontact.setRecurring(object.get("Recurring").getAsBoolean());
payIn.setPaymentDetails(payInPaymentDetailsBancontact);
break;
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ public JsonElement serialize(PayIn src, Type typeOfSrc, JsonSerializationContext
case "PayInPaymentDetailsGiropay":
object.add("StatementDescriptor", context.serialize(((PayInPaymentDetailsGiropay) src.getPaymentDetails()).getStatementDescriptor()));
break;
case "PayInPaymentDetailsBancontact":
object.add("DeepLinkURL", context.serialize(((PayInPaymentDetailsBancontact) src.getPaymentDetails()).getDeepLinkUrl()));
object.add("StatementDescriptor", context.serialize(((PayInPaymentDetailsBancontact) src.getPaymentDetails()).getStatementDescriptor()));
object.add("Recurring", context.serialize(((PayInPaymentDetailsBancontact) src.getPaymentDetails()).getRecurring()));
break;
default:
return null;
}
Expand Down

0 comments on commit 9f63135

Please sign in to comment.