Support transaction history
Overview
The issuer application can show past payment transactions for a digital card.
After a payment completes, the issuer application receives a transaction notification. It forwards that notification to the D1 SDK, then retrieves the transaction history for the card.
Flow
Handle transaction notifications
After a transaction completes, the issuer application receives a transaction push notification.
Forward the message to the D1 SDK. If processing succeeds, the D1 SDK returns PushResponseKey.TYPE_TRANSACTION_NOTIFICATION with the cardId and lastCallTimestamp.
The issuer application can then refresh the transaction history for that card.
For notification payload handling details, see Message handling.
Retrieve transaction history
Call getTransactionHistory() to retrieve the payment history for a card.
The card must already be digitized before the issuer application calls getTransactionHistory().
SDK
fun getTransactionHistory(d1Task: D1Task, cardId: String) {
val d1PayWallet: D1PayWallet = d1Task.d1PayWallet
d1PayWallet.getTransactionHistory(cardId,
object : D1Task.Callback<TransactionHistory?> {
override fun onSuccess(data: TransactionHistory?) {
// Update the UI, for example by showing the transaction history list.
}
override fun onError(exception: D1Exception) {
// Handle the error.
}
}
)
}public void getTransactionHistory(@NonNull D1Task d1Task, @NonNull String cardId) {
D1PayWallet d1PayWallet = d1Task.getD1PayWallet();
d1PayWallet.getTransactionHistory(cardId,
new D1Task.Callback<TransactionHistory>() {
@Override
public void onSuccess(@Nullable TransactionHistory data) {
// Update the UI, for example by showing the transaction history list.
}
@Override
public void onError(@NonNull D1Exception exception) {
// Handle the error.
}
}
);
}Last updated
Was this helpful?