Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion api-java-mixin.raml
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,9 @@ types:
return com.commercetools.api.models.common.ReferenceTypeId.PAYMENT;
}
PaymentDraft:
(java-extends): 'com.commercetools.api.models.CustomizableDraft<PaymentDraft>, com.commercetools.api.models.WithKey'
(java-extends): 'PaymentDraftMixin, com.commercetools.api.models.CustomizableDraft<PaymentDraft>, com.commercetools.api.models.WithKey'
PaymentMethodInfo:
(java-extends): 'PaymentMethodInfoMixin'
PaymentPagedQueryResponse:
(java-extends): 'com.commercetools.api.models.ResourcePagedQueryResponse<Payment>'
PaymentReference:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
@JsonDeserialize(as = PaymentDraftImpl.class)
public interface PaymentDraft extends com.commercetools.api.models.CustomizableDraft<PaymentDraft>,
public interface PaymentDraft extends PaymentDraftMixin, com.commercetools.api.models.CustomizableDraft<PaymentDraft>,
com.commercetools.api.models.WithKey, io.vrap.rmf.base.client.Draft<PaymentDraft> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
@JsonDeserialize(as = PaymentMethodInfoImpl.class)
public interface PaymentMethodInfo {
public interface PaymentMethodInfo extends PaymentMethodInfoMixin {

/**
* <p>Payment service that processes the Payment—for example, a PSP. The combination of <code>paymentInterface</code> and the <code>interfaceId</code> of a Payment is unique.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

package com.commercetools.api.models.payment;

import com.commercetools.api.models.WithKey;
import com.commercetools.api.models.type.CustomFields;
import com.commercetools.api.models.type.CustomFieldsDraft;

public interface PaymentDraftMixin extends WithKey {

public default PaymentResourceIdentifier toResourceIdentifier() {
if (getKey() != null)
return PaymentResourceIdentifier.builder().key(getKey()).build();
return null;
}

public void setCustom(final CustomFieldsDraft custom);

public default void setCustom(final CustomFields custom) {
this.setCustom(custom.toDraft());
}

public void setPaymentMethodInfo(final PaymentMethodInfoDraft paymentMethodInfo);

public default void setPaymentMethodInfo(final PaymentMethodInfo paymentMethodInfo) {
this.setPaymentMethodInfo(paymentMethodInfo.toDraft());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

package com.commercetools.api.models.payment;

import com.commercetools.api.models.common.LocalizedString;
import com.commercetools.api.models.payment_method.PaymentMethodToken;
import com.commercetools.api.models.type.CustomFields;

public interface PaymentMethodInfoMixin {

public String getPaymentInterface();

public String getMethod();

public LocalizedString getName();

public PaymentMethodToken getToken();

public String getInterfaceAccount();

public CustomFields getCustom();

public default PaymentMethodInfoDraft toDraft() {
return PaymentMethodInfoDraft.builder()
.name(getName())
.method(getMethod())
.paymentInterface(getPaymentInterface())
.token(getToken())
.interfaceAccount(getInterfaceAccount())
.custom(getCustom().toDraft())
.build();
}
}