Search in sources :

Example 11 with HyperwalletPayment

use of com.hyperwallet.clientsdk.model.HyperwalletPayment in project mirakl-hyperwallet-connector by paypal.

the class PayeeCreditNoteModelToHyperwalletPaymentConverter method convert.

/**
 * Method that retrieves a {@link CreditNoteModel} and returns a
 * {@link HyperwalletPayment}
 * @param source the source object {@link CreditNoteModel}
 * @return the returned object {@link HyperwalletPayment}
 */
@Override
public HyperwalletPayment convert(final CreditNoteModel source) {
    final HyperwalletPayment target = new HyperwalletPayment();
    target.setProgramToken(creditNotesHyperwalletSDKService.getProgramTokenByHyperwalletProgram(source.getHyperwalletProgram()));
    target.setDestinationToken(source.getDestinationToken());
    target.setClientPaymentId(source.getInvoiceNumber());
    target.setAmount(source.getCreditAmount());
    target.setCurrency(source.getCurrencyIsoCode());
    target.setPurpose(PURPOSE);
    return target;
}
Also used : HyperwalletPayment(com.hyperwallet.clientsdk.model.HyperwalletPayment)

Aggregations

HyperwalletPayment (com.hyperwallet.clientsdk.model.HyperwalletPayment)11 Test (org.junit.jupiter.api.Test)8 InvoiceModel (com.paypal.invoices.invoicesextract.model.InvoiceModel)5 HyperwalletException (com.hyperwallet.clientsdk.HyperwalletException)3 CreditNoteModel (com.paypal.invoices.invoicesextract.model.CreditNoteModel)3 LocalDateTime (java.time.LocalDateTime)2 Date (java.util.Date)2 Hyperwallet (com.hyperwallet.clientsdk.Hyperwallet)1