When sender issues a Transfer action, runtime subtracts a deposit, issues receipt and node routes it to another shard.
What happens if recipient account doesn't exist? Will tokens be refunded back to the sender?
Yes. Runtime generates a refund receipt from a sender system with a single action Transfer for the total amount of deposit.
Related
We are implementing an SMS tracking feature for our app using Twilio where we will send an SMS to our customer and once they reply with Yes/No
we will take action accordingly. For normal case, where each customer has one single phone number we can easily track the replies and
take action. But if the customer use the same phone number for multiple accounts and we send multiple SMS to the same customer
(eventually in a same phone number) we are not able to track which specific SMS they have replied for.
Lets take an example,
User Tom has three accounts with us. Each of the three accounts uses the same phone number P.
Twilio SMS are tracked by a combination of From/To pair.
Assuming, we are using one Twilio proxy number as sending number which is S.
Case 1: Tom has one booking canceled for a short notice period. An SMS has been sent from S->P. When a reply is received, we can easily track the reply and take the action.
Case 2: Tom has two or more bookings canceled due to a short notice period.
For each canceled booking, an SMS has been sent from S->P. When the user replies, we are unable to detect which booking to mark the reply for.
It is not possible to know which message a person has responded to in SMS. The only way to efficiently handle this is to send messages from different numbers. So, if a user signs up with the same phone number as another user then you need to assign a new Twilio number to them. Then you can tell which user you are contacting or receiving messages from by the number.
If you send out messages about bookings on the same account at the same time, then you need to be even more granular with the number access. Each notification should assign a number to use and then when a reply comes to that number it was about that notification. Then if you need to send a second message simultaneously, you attach a different Twilio number to it. And so on for more messages.
Consider the following example transaction 24AVRBgWnEWQK1yPnfgfzkSugsWbLNxhnHeDQr9tG7Mf.
Receipt Ef93JLMy6aeAKDQA4p74dLxEQEPPJpLjfwPz6bJE3tBy burned 21027712500000000000 tokens as a fee. As one could see, this receipt is a sub-receipt of GrvohsC2eHLCZDKB7r2yZmSaxqqzqh97keCEFt3QeyQP which is a sub-receipt of another one. There are different senders and receivers in this receipt-chain.
There are a few things I don't understand here:
Did the sender of the transaction (rgv250cc.near in this case) covered all the fees for executing all receipts?
In receipt Ef93JLMy6aeAKDQA4p74dLxEQEPPJpLjfwPz6bJE3tBy both predecessor and receiver are aurora.pool.near. Does this mean, that in this case, the aurora.pool.near covered the fee for this receipt, which was earlier passed to aurora from the transaction sender, which is indicated by the amount of gas ("gas": 250000000000000,) attached to the function call from the transaction?
What does the value of tokens_burnt in receipt
6okihcHrqjr4KWY6CeRzynvC5GxA6wrNyZNMYyKphqJP represent? Is it the
fee of executing this receipt only, or maybe cumulated value of executing
all receipts in this receipt-chain?
EDIT:
AD 3. After summarizing all tokens_burnt value matched with the explorer, so each receipt shows only tokens burned for executing itself.
Did the sender of the transaction (rgv250cc.near in this case) covered all the fees for executing all receipts?
Correct.
In receipt Ef93JLMy6aeAKDQA4p74dLxEQEPPJpLjfwPz6bJE3tBy both predecessor and receiver are aurora.pool.near. Does this mean, that in this case, the aurora.pool.near covered the fee for this receipt, which was earlier passed to aurora from the transaction sender, which is indicated by the amount of gas ("gas": 250000000000000,) attached to the function call from the transaction?
rgv250cc.near covers all the fees even for the cross-contract calls.
What does the value of tokens_burnt in receipt 6okihcHrqjr4KWY6CeRzynvC5GxA6wrNyZNMYyKphqJP represent? Is it the fee of executing this receipt only, or maybe cumulated value of executing all receipts in this receipt-chain?
That only covers the tokens that were burnt during this particular receipt. You need to sum up all the tokens burnt values to get the total.
I believe you might benefit from reading this article about the balance changes.
I'm working on architecting a micro-service solution where most code will be C# and most likely Angular for any front end. My question is about message chaining. I am still figuring out what message broker to use; Azure Service Bus , RabbitMQ, etc.. There is a concept which I haven't found much about.
How do I handle cases when I want to fire a message when a specific set of messages have fired. An example but not part of my actual solution: I want to say Notify someone when pays a bill. We send a message "PAIDBILL"
which will fire off microservices which will be processed independently:
FinanceService to Debit the ledger and fire "PaymentPosted"
EmailService: email Customer Saying thank you for paying the bill
"CustomerPaymentEmailSent"
DiscountService: Check if they get a discount for paying on time then send
"CustomerCanGetPaymentDiscount"
If all three messages have fired for the Same PAIDBILL: Message "PaymentPosted", "CustomerPaymentEmailSent", "CustomerCanGetPaymentDiscount"
then I want to email the customer that they will get a discount on their next bill. It Must be done AFTER all three have tiggered and the order doesn't matter. How do I Schedule a new message to be sent "EmailNextTimeDiscount" message, without having to poll for what messages have fired every minute, hour, day?
All I can think of is to have a SQL table which marks that each one is complete (by locking the table) and when the last one is filled then send off the message. Would this be a good solution? I find it an anti-pattern for the micro-service & message queue design.
If you're using messages (e.g. Service Bus / RabbitMQ), then I think the solution you have described is the best one. This type of design - where services have knowledge about the other domains in the system - is typically known as choreography.
You'll want to pick a service which will be responsible for this business logic. That service will need to receive all the preceding types of messages so that it can determine when (if) all have been met, which it probably wants to do by recording which of the gates have already passed in a database.
One alternative you could consider is chaining the business processes instead of doing them in parallel. So...
PAYBILL causes FinanceService to Debit the ledger and fire "PaymentPosted"
"PayentPosted" causes EmailService to email Customer Saying thank you for paying the bill and broadcasts "CustomerPaymentEmailSent"
"CustomerPaymentEmailSent" causes DicsountService to check if they get a discount for paying on Time then sends "CustomerCanGetPaymentDiscount"
The email you want to send is just triggered by "CustomerCanGetPaymentDiscount".
If I'm honest, I would switch around the dependency model you're using at this last stage. So, instead of some component listening for "CustomerCanGetPaymentDiscount" events from DiscountService and sending an email, I think I would instead have the DiscountService tell some other component to send an email. It seems natural to me for something that calculates discounts to know that an email should be sent. It seems less natural for something that sends emails to know about discounts (and everything else that needs emails sent). This is why I don't like architectures where the assumption is that every message should be an event and every action should be triggered by an event: it removes a lot of decisions about where domain logic can live, because the message receiver always has to know about the domain of the message sender, never vice versa.
I'm trying to implement SMS transmission between two GSM devices. I've searched and read standards and articles a lot but couldn't find the answer to the following question. Does anyone know how does SMSC get aware of the sender's number and insert it in the TP-OA field of the SMS-Deliver packet stack?
Actually I'm not sure that either this is what you need or this would help you but anyways..
In GSM network there are a lot of nodes and each does certain things for which it is responsible. They communicate to each other with messages, that contain certain information needed for processing of required operation: establishing a call, sending SMS, doing Update Location etc.
So the information about sender's number comes to SMSC from another node called VLR/MSC together with a message saying to it "Yo, one guy wants to send SMS to another guy. So here is this message and information about these guys. Please, forward it".
Here is scenario of user A sending SMS to user B:
User A sends SMS to VLR/MSC together with information about its destination
VLR/MSC then invokes MAP message ForwardSM (Forward Short Message) to send received data further through the network to a node called SMS IMSC
SMS IMSC is a node that plays a role of interface between network and SMSC
SMS IMSC on receipt of ForwardSM message sends TPDU (Transfer Protocol Data Unit) message towards SMSC with the text of sent SMS and routing information
After this SMSC sends reply to user A with a result of receiving the SMS. If it's successful then SMSC starts routing this SMS through the network towards user B
So the message you are looking for is TPDU message from Point 3. Type of this message is SMS-SUBMIT according to TPDU types.
Edit:
Authentication is separate operation that takes place when subscriber starts his activity (eg turns on his phone) or roams to another area that is being served by another VLR/MSC. Anyway, VLR/MSC treats this user as new to this area. Skip this part if you know what is VLR/MSC:
HLR is a node that stores all the information about every subscriber in operator's network. So basically it's a database that has all the info about every single subscriber in the entire operator's network.
And network covers huge geographical area so it's divided is smaller areas called cells. VLR/MSC is a node similar to HLR (it also stores subscribers' data). But it is responsible for one certain cell, so it stores data of subscribers who currently operate in this certain cell. So when new subscriber comes to its area VLR/MSC downloads his data from HLR. And when subscriber leaves this area VLR/MSC removes his data.
And if some node would need to get subscriber's data, it won't "ask" HLR for it, but instead it will "ask" VLR/MSC in whose area the subscriber is currently active.
So when VLR/MSC sees a new subscriber coming to its area, before downloading his data from HLR it triggers authentication process to check if this user is valid and that someone else doesn't pretend to be this user:
VLR/MSC sends Send Authentication Info MAP message together with IMSI (mobile subscriber number which is uniquely identified by his SIM card) to HLR
HLR checks the given IMSI and validates subscriber. If subscriber exists and there is no troubles with him then HLR sends IMSI to AUC (Authentication Center)
On IMSI reception AUC generates a triplet (some encryption keys needed for subscriber identification) that contains SRES, RAND and Kc values and sends this data back to HLR
HLR forwards this data back to VLR/MSC which triggered authentication process
VLR/MSC after reception of SRES, RAND and Kc sends received RAND to mobile subscriber
After mobile subscriber receives the RAND he calculates SRES using given RAND and Ki (some value that is written in user's SIM card) and sends calculated SRES back to VLR/MSC
On the final step VLR/MSC compares SRES generated by AUC with SRES generated by user. And if they match then user is identified successfully, VLR/MSC fetches subscriber's data from HLR and authentication process is completed.
After VLR/MSC downloaded data from HLR every other node that would need data of this subscriber would fetch it from VLR/MSC not HLR. And after that authentication process won't start every time subscriber wants to do something (make a call, send SMS and so on).
So when user A sends SMS to user B the data about user A (his number for example) is stored in VLR/MSC already and it arrives to SMSC from VLR/MSC together with the SMS user A sent.
I can see that the capture has been processed successfully:
But then on the "transactions" screen, "Is Closed" column is saying "no" next to capture. I think I just don't understand the role of this column. Can someone help explain it to me?
A little background on the credit card payment transaction process flow helps make sense of this. These are the basic flow actions of the transaction lifecycle:
Authorization
Capture
Settlement
These flow actions are broken down into more specific operations that can be called against the payment gateway. Here are some basic ones that are relevant:
Authorize (AUTH_ONLY):
Run the card for a given amount and obtain a unique authorization code. The amount will be put on hold and you are guaranteed these funds as long as you use the authorization code in a Capture transaction within 30 days. (How long before an authorization code expires varies by company. Check with your payment gateway)
Customers don't see the authorization as a charge on their statement, but they will see their available funds decrease by the amount you ran the authorization for.
If you don't use the authorization code in a follow-up Capture transaction, the authorization is "dropped", funds returned to the customer's balance and you can no longer use it.
Capture (PRIOR_AUTH_CAPTURE):
Use a previously obtained authorization code to complete the transaction.
The amount captured can be lower than the originally obtained authorization amount (this is useful in cases like our example where you don't know the total order amount ahead of time).
Source: http://www.softwareprojects.com/resources/conversion-traffic-to-cash/t-processing-payments-authorize-vs-capture-vs-settle-2030.html
Settlement: This is the process merchants must complete ... to be paid for their transactions.
The product or service must be delivered or performed before settlement can take place. In the case of mail order/telephone order, this specifically means the goods must be shipped before the settlement process is performed.
Source: http://www.shift4.com/insight/glossary/
In Magento, the is_closed flag signifies that a transaction is settled and no other operations may be performed against it. The reason a transaction would be left open until settlement is so that you can do partial shipments of goods (multiple captures), as well as void or refund the transaction.
To use Magento’s Mage_Authorizenet_Model_Directpost as an example, the capture() operation leaves the current transaction open, while void() and _refund() operations close it.