How do I know if a cash loading / cash replenishment operation is done - xfs

I am trying to develop a cash level monitoring application for ATMs.
I monitor the cash counters of ATM using CEN-XFS APIs.
The WFS_INF_CDM_CASH_UNIT_INFO command provides me the current cash level, but how do I know if counters are cleared and replenishment or a cash add is done ?
There is no specific event defined to indicate the same? Should I look for zero value in the counter to interpret the same as "clear counters"?

Related

Scheduling Price Changes in Shopify Plus where my ERP can't

I have a retail website built in Shopify Plus that is fed by an ERP. A couple times a month at least, I have sale events where some (not all) items get varying levels of discounts (I'll call this my store-wide sale), but my ERP doesn't have the ability to schedule temporary price changes.
I also have unrelated discounts that happen at the item level outside the store-wide sale cycle, so the solution needs to be able these to the store-wide sale price for that item and choose the lower of the two.
I can manually change all my prices with immediate effect in the ERP to start the sale and then manually do it again to put them back to the way it was, but that's time consuming, and normally needs to happen outside business hours. If I change the price in Shopify, the ERP just over-writes them.
Is this possible? Is there a solution short of implementing a PIM that will allow me to schedule my price changes in this way?
I was thinking of potentially keeping my store-wide discounts in a metafield and/or a tag on each item and using a script to do the math, pick the best price, and change the price at the line level in cart and maybe Javascript to over-write price displayed on the PDP and PLP to show that same price.
I realised a lot of merchants needed this, so I built an app for this. I'm sure it will do exactly as you need.
https://apps.shopify.com/simple-simons-price-scheduler
If you need additional features, just submit a request via the contact form. I'm pretty quick to implement features if I feel they're beneficial.

Binance API transaction history

I am trying to display a users transaction history in binance, including fund deposits and withdrawals as well as buying and selling of different crypto's. Does anyone know which binance API endpoints I would use to do this? It seems quite complicated in comparison to other trading platforms.
Thanks
This is the link to the docs: https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
I can see the Wallet endpoints "Withdraw" and "Deposit", but this won't cover crypto trading will it?, The account trade list call would be ideal, but it requires a symbol input which I'm not sure how I would obtain dynamically.
I would also like this endpoint to provide me with the data so I can get the avg buy price for a crypto
Currently this is not supported. See: https://dev.binance.vision/t/fetch-all-account-orders/279/3
This is the route you're looking for to get the user trade history. The big downside is that you have to specify the exchange symbol, you cannot get the history of the account with just one request:
https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
Get your account information first. You can then extract non-zero balances from here to get symbols for transactions. You can then loop through each currency pair and get its transaction history. This seems to be the most optimistic way we can get right now
You can also try to use caching. For example, you can remember balance for a particular coin, and if it has not changed by the next launch, then it is likely (but not 100%) that no transactions were made with it
You can also connect to WebSocket, but this is still a terrible crutch and requires a DOS attack to get the necessary data
Please note that here the balances for Savings wallet have LD prefix added to their ticker. For example, BTC in the Savings wallet is labeled as LDBTC

Why do bitcoin uses UTXO model? What are the advantages UTXO mechanism provides out of the box?

I am just curious to know why Bitcoin developers choose a complicated approach like UTXO, rather than using the transaction models used by Ethereum Blockchain.
Basically, Bitcoin nodes maintain a set of all active UTXOs which have not been spent yet and any transaction that comes in is validated using this set. The nodes also update the UTXO set after every transaction.
This model is very analogous to how you'd implement a "wallet" which held currency notes and coins albeit with perfect traceability of each note in your wallet as to where you received it from! It is not complicated once you understand this basic analogy.
Consider the case where you have only a 20$ bill in your wallet. Let's say you buy a product worth 6$ with this 20$ bill. In this case, you will get BACK 14 $ in "change" and these notes are akin to the "unspent transaction outputs". These notes (UTXOs) can then be spent in any later transaction.
The advantage that UTXOs have is that each UTXO can be traced back right upto the point where the actual bitcoin was created (miner reward for example) and even upto the genesis block potentially.
This is akin to your being able to trace back the 20$ bill from where/whom you received it, and in succession being able to trace back how that person received this 20$ bill and so on and so forth until you traced it back to the Federal Reserve Bank mint where it was printed!
You can imagine how this would dramatically increase the security and trust in the system because you could validate each and every facet of a transaction.
However, this model was considered as not efficient enough for the Ethereum protocol which also has smart contract transactions which might execute frequently. Due to this, Ethereum went for a "Account state" based model which makes it far more efficient to calculate balances before and after transactions.
Here are some helpful links that might answer your question:
Considered as skewed towards a pro-ethereum viewpoint - https://ethereum.stackexchange.com/questions/326/what-are-the-pros-and-cons-of-ethereum-balances-vs-utxos
Also a Medium article which goes into more detailed comparison on the UTXO and Ethereum Account State model https://medium.com/#sunflora98/utxo-vs-account-balance-model-5e6470f4e0cf

Validating Bitcoin Payments Programmatically

Is it possible to anonymously programmatically verify that a transaction has reached n number of validations without running a full node? If so, what is the best means to do this?
Basically I want it to build a payment system where after the transfer is initially detected, the customer sees a message thanking them and telling them that their purchase will be processed within 24 hrs and that they'll receive an email once confirmation is complete. Then throughout the day maybe run a cron job that checks that each transaction reaches the desired number of validations and if so divide the money between two wallets and mark the product to be sent. I also don't want it to be with a service like Coinbase or Bitpay where they have control of your coins.
So far I've been experimenting with Blocktrail and mycelium gear. Both have some elements I like but still not everything that I need. With mycelium you can set the number of verifications but for instance if I want to set it for 6 verifications the customer would have to sit there possibly an hour before they see the next screen. Blocktrail allows me to query that a transaction is validated but it only has the ability to check that 1 validation was completed as far as I can tell. Can anyone suggest an API or widget that can accomplish these things? Preferably PHP or if not JQuery.
Blockchain.info has a simple Query API for querying how much bitcoin an address has received. You can add a confirmations=n parameter that will only include bitcoin that has been confirmed 'n' times. It returns a simple value in satoshis.
For example to check how much bitcoin was received with at least 2 confirmations at a specific address you could have your code query the API like this:
https://blockchain.info/q/getreceivedbyaddress/1PFtyX9nQvjP8U2N3iUk2oNorzPfpjX9sK?confirmations=2

Pay Pal Buy Now Button with automated amount change over time?

I want to create a pay pal buy now button that changes the price of my product over time in a preset amount daily. Right now I would have to manual change the price of saved buttons in Paypal.
In the call me crazy department I also would like to be able to link a price (in my case original artwork) of my product to a function that calculates the price of a product (in this case DJIA divided by X times per square foot total size of the painting... but that's just for fun as the fine art market can be very arbitrary in pricing work.
You won't be able to do that with a hosted button unless you're using the Button Manager API. If you're going to use API's, though, I'd recommend going with Express Checkout. You could hook this up to a database or just have your script calculate whatever it needs to dynamically populate the request data including the amount or anything else necessary.