我正在使用coinbase api向我的OAuth用户发送付款请求:
var requestTransaction = this.CreateRequestTransaction(paymentTransaction);
var apiAccount = await this.GetApiAccountByCurrency(paymentTransaction.AccountTypeCurrency);
var resp = await this._coinbaseApiClient.Transactions.RequestMoneyAsync(
apiAccount.Id, requestTransaction);
this.SaveTransaction(resp);
向用户提出请求后,我偶尔会查询交易状态以查看交易是否已完成。
var cbTransaction = await this._coinbaseApiClient.Transactions.GetTransactionAsync(
apiAccount.Id, userTransaction.CBIncomingTransactionId);
if (cbTransaction.Data.Status == TransactionStatus.Completed)
{
userTransaction.IsPaid = true;
await this._publicContext.SaveChangesAsync();
return UserTransactionStatus.PAID;
}
当用户尚未付款时,我可以成功提取交易状态。但是,一旦请求由用户支付,交易404就会支付。
如何验证我的交易请求已完成? 注意,我无法使用来自Coinbase的Web挂钩/回调。