wallet-core: return transactionId whenever a transaction is created
This commit is contained in:
parent
c3ef842df0
commit
0b4d900088
@ -396,9 +396,16 @@ export interface PrepareTipResult {
|
|||||||
/**
|
/**
|
||||||
* Unique ID for the tip assigned by the wallet.
|
* Unique ID for the tip assigned by the wallet.
|
||||||
* Typically different from the merchant-generated tip ID.
|
* Typically different from the merchant-generated tip ID.
|
||||||
|
*
|
||||||
|
* @deprecated use transactionId instead
|
||||||
*/
|
*/
|
||||||
walletTipId: string;
|
walletTipId: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tip transaction ID.
|
||||||
|
*/
|
||||||
|
transactionId: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Has the tip already been accepted?
|
* Has the tip already been accepted?
|
||||||
*/
|
*/
|
||||||
@ -447,6 +454,7 @@ export const codecForPrepareTipResult = (): Codec<PrepareTipResult> =>
|
|||||||
.property("merchantBaseUrl", codecForString())
|
.property("merchantBaseUrl", codecForString())
|
||||||
.property("expirationTimestamp", codecForTimestamp)
|
.property("expirationTimestamp", codecForTimestamp)
|
||||||
.property("walletTipId", codecForString())
|
.property("walletTipId", codecForString())
|
||||||
|
.property("transactionId", codecForString())
|
||||||
.build("PrepareTipResult");
|
.build("PrepareTipResult");
|
||||||
|
|
||||||
export interface BenchmarkResult {
|
export interface BenchmarkResult {
|
||||||
@ -2150,6 +2158,8 @@ export interface PreparePeerPushCreditResponse {
|
|||||||
amountRaw: AmountString;
|
amountRaw: AmountString;
|
||||||
amountEffective: AmountString;
|
amountEffective: AmountString;
|
||||||
peerPushPaymentIncomingId: string;
|
peerPushPaymentIncomingId: string;
|
||||||
|
|
||||||
|
transactionId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PreparePeerPullDebitResponse {
|
export interface PreparePeerPullDebitResponse {
|
||||||
@ -2163,6 +2173,8 @@ export interface PreparePeerPullDebitResponse {
|
|||||||
amountEffective: AmountString;
|
amountEffective: AmountString;
|
||||||
|
|
||||||
peerPullPaymentIncomingId: string;
|
peerPullPaymentIncomingId: string;
|
||||||
|
|
||||||
|
transactionId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const codecForPreparePeerPushCreditRequest =
|
export const codecForPreparePeerPushCreditRequest =
|
||||||
|
@ -825,6 +825,10 @@ export async function preparePeerPushCredit(
|
|||||||
contractTerms: existing.existingContractTerms,
|
contractTerms: existing.existingContractTerms,
|
||||||
peerPushPaymentIncomingId:
|
peerPushPaymentIncomingId:
|
||||||
existing.existingPushInc.peerPushPaymentIncomingId,
|
existing.existingPushInc.peerPushPaymentIncomingId,
|
||||||
|
transactionId: constructTransactionIdentifier({
|
||||||
|
tag: TransactionType.PeerPushCredit,
|
||||||
|
peerPushPaymentIncomingId: existing.existingPushInc.peerPushPaymentIncomingId,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -907,6 +911,10 @@ export async function preparePeerPushCredit(
|
|||||||
amountRaw: purseStatus.balance,
|
amountRaw: purseStatus.balance,
|
||||||
contractTerms: dec.contractTerms,
|
contractTerms: dec.contractTerms,
|
||||||
peerPushPaymentIncomingId,
|
peerPushPaymentIncomingId,
|
||||||
|
transactionId: constructTransactionIdentifier({
|
||||||
|
tag: TransactionType.PeerPushCredit,
|
||||||
|
peerPushPaymentIncomingId,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1363,6 +1371,10 @@ export async function preparePeerPullDebit(
|
|||||||
contractTerms: existingPullIncomingRecord.contractTerms,
|
contractTerms: existingPullIncomingRecord.contractTerms,
|
||||||
peerPullPaymentIncomingId:
|
peerPullPaymentIncomingId:
|
||||||
existingPullIncomingRecord.peerPullPaymentIncomingId,
|
existingPullIncomingRecord.peerPullPaymentIncomingId,
|
||||||
|
transactionId: constructTransactionIdentifier({
|
||||||
|
tag: TransactionType.PeerPullDebit,
|
||||||
|
peerPullPaymentIncomingId: existingPullIncomingRecord.peerPullPaymentIncomingId,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1451,6 +1463,10 @@ export async function preparePeerPullDebit(
|
|||||||
amountRaw: contractTerms.amount,
|
amountRaw: contractTerms.amount,
|
||||||
contractTerms: contractTerms,
|
contractTerms: contractTerms,
|
||||||
peerPullPaymentIncomingId,
|
peerPullPaymentIncomingId,
|
||||||
|
transactionId: constructTransactionIdentifier({
|
||||||
|
tag: TransactionType.PeerPullDebit,
|
||||||
|
peerPullPaymentIncomingId: peerPullPaymentIncomingId,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,6 +176,11 @@ export async function prepareTip(
|
|||||||
tipRecord = newTipRecord;
|
tipRecord = newTipRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const transactionId = constructTransactionIdentifier({
|
||||||
|
tag: TransactionType.Tip,
|
||||||
|
walletTipId: tipRecord.walletTipId,
|
||||||
|
})
|
||||||
|
|
||||||
const tipStatus: PrepareTipResult = {
|
const tipStatus: PrepareTipResult = {
|
||||||
accepted: !!tipRecord && !!tipRecord.acceptedTimestamp,
|
accepted: !!tipRecord && !!tipRecord.acceptedTimestamp,
|
||||||
tipAmountRaw: Amounts.stringify(tipRecord.tipAmountRaw),
|
tipAmountRaw: Amounts.stringify(tipRecord.tipAmountRaw),
|
||||||
@ -184,6 +189,7 @@ export async function prepareTip(
|
|||||||
expirationTimestamp: tipRecord.tipExpiration,
|
expirationTimestamp: tipRecord.tipExpiration,
|
||||||
tipAmountEffective: Amounts.stringify(tipRecord.tipAmountEffective),
|
tipAmountEffective: Amounts.stringify(tipRecord.tipAmountEffective),
|
||||||
walletTipId: tipRecord.walletTipId,
|
walletTipId: tipRecord.walletTipId,
|
||||||
|
transactionId,
|
||||||
};
|
};
|
||||||
|
|
||||||
return tipStatus;
|
return tipStatus;
|
||||||
|
Loading…
Reference in New Issue
Block a user