private async Task CallTransactByQRCodeWebService(string fromAccountNumber, string toAccountNumber, long?amount, string trackingId) { Device.BeginInvokeOnMainThread(() => { gridProgress.IsVisible = true; }); try { Proxies.DCEMVDemoServerClient client = SessionSingleton.GenDCEMVServerApiClient(); using (SessionSingleton.HttpClient) { QRCodeTransferTransaction tx = new QRCodeTransferTransaction() { Amount = amount.Value, AccountFrom = fromAccountNumber, AccountTo = toAccountNumber, TrackingId = trackingId, }; await client.TransactionQrcodetransferPostAsync(tx.ToJsonString()); } } catch (Exception ex) { throw ex; } finally { Device.BeginInvokeOnMainThread(() => { gridProgress.IsVisible = false; }); } }
public void QRCodeTransfer(string json) { QRCodeTransferTransaction tx = QRCodeTransferTransaction.FromJsonString(json); if (tx.Amount == 0) { throw new ValidationException("Invalid Amount"); } if (!Validate.GuidValidation(tx.AccountFrom)) { throw new ValidationException("Invalid AccountNumberFrom"); } if (!Validate.GuidValidation(tx.AccountTo)) { throw new ValidationException("Invalid AccountNumberTo"); } if (!Validate.GuidValidation(tx.TrackingId)) { throw new ValidationException("Invalid TrackingId"); } TransactionPM tpm = new TransactionPM() { Amount = tx.Amount, TransactionType = TransactionType.SendMoneyFromAppToCard, AccountNumberIdFromRef = tx.AccountFrom, AccountNumberIdToRef = tx.AccountTo, TrackingId = tx.TrackingId, }; _transactionRepository.AddQRCodeBasedTransaction(tpm, GetCurrentUserId()); }
public void AddQRCodeBasedPOSTransaction(string jsonTx, string jsonPosTx) { QRCodeTransferTransaction transaction = QRCodeTransferTransaction.FromJsonString(jsonTx); POSTransaction posDetail = POSTransaction.FromJsonString(jsonPosTx); if (transaction.Amount == 0) { throw new ValidationException("Invalid Amount"); } }