Skip to content

Commit

Permalink
Sync changes from 1.7 to master
Browse files Browse the repository at this point in the history
  • Loading branch information
filipocelka authored Nov 6, 2024
2 parents e734336 + 8a24426 commit 36cb312
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# buildscript - project id
projectGroup=com.generalbytes.batm.public
projectVersion=1.8.1
projectVersion=1.8.2

# buildscript - common dependency versions
bitrafaelVersion=1.0.44
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,4 +876,19 @@ default List<ICustomString> getCustomStrings(String serialNumber, String customS
return new ArrayList<>();
}

/**
* Retrieves the data required to generate a receipt, including placeholder variables
* and any additional elements needed based on the specified template and transaction details.
*
* @param receiptTransferMethod The method used to send the receipt,
* determining the format and additional data required.
* @param transactionDetails The details of the transaction for which the receipt
* is being generated, providing values for relevant placeholders.
* @param template The template used for generating the receipt,
* which defines the structure and required placeholders.
* @return A {@link ReceiptData} instance containing all necessary data and placeholders
* for constructing the receipt according to the specified template.
*/
ReceiptData getReceiptData(ReceiptTransferMethod receiptTransferMethod, ITransactionDetails transactionDetails, String template);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.generalbytes.batm.server.extensions;

import java.util.Map;

/**
* Represents data necessary to generate a receipt message.
* This interface provides access to placeholder variables and embedded images
* that may be used within a receipt.
*/
public interface ReceiptData {

/**
* Retrieves a map of placeholder variables for the receipt.
* These variables contain values for all placeholders available for constructing
* a receipt message.
*
* <p>Each entry in the map represents a placeholder's name and its corresponding value.
* Placeholders are identified by their names without brackets. For example, a key
* {@code "text.crypto.amount"} corresponds to the value for the placeholder
* {@code {text.crypto.amount}} in the receipt template.</p>
*
* @return A map containing placeholder names as keys and their corresponding values.
*/
Map<String, String> getVariables();

/**
* Retrieves an array of embedded images to be included in the receipt email.
*
* <p>This method is specifically intended for email receipts
* ({@link ReceiptTransferMethod#EMAIL}), where embedded images are used.</p>
*
* @return An array of {@link IExtensionContext.EmbeddedEmailImage} objects,
* representing the images to embed in the email.
* @see IExtensionContext#sendHTMLMailAsync(String, String, String, String, String, IExtensionContext.EmbeddedEmailImage...)
*/
IExtensionContext.EmbeddedEmailImage[] getEmbeddedEmailImages();

}
Original file line number Diff line number Diff line change
Expand Up @@ -507,4 +507,9 @@ public void markTransactionAsWithdrawn(String remoteOrLocalTransactionId) {
@Override
public void unlockTransaction(String rid, Date serverTimeToUnlock) {
}

@Override
public ReceiptData getReceiptData(ReceiptTransferMethod receiptTransferMethod, ITransactionDetails transactionDetails, String template) {
return null;
}
}

0 comments on commit 36cb312

Please sign in to comment.