Пример #1
0
 internal MPesaTransactionResponse(MPesaAccount usedAccount, Exception ex)
 {
     UsedAccount     = usedAccount;
     RawResponse     = ex.Message;
     Note            = ex.Message;
     ReferenceNumber = ex.Message;
     IsSuccess       = false;
 }
Пример #2
0
        internal MPesaTransactionResponse(MPesaAccount usedAccount, dynamic response)
        {
            try
            {
                UsedAccount = usedAccount;
                IsSuccess   = response.entries[0].status == "Queued";

                if (IsSuccess)
                {
                    ReferenceNumber = response.entries[0].transactionId;
                }
                else
                {
                    Note = response.entries[0].errorMessage;
                }
            }
            catch (Exception ex)
            {
                IsSuccess = true;
            }
        }