SWIFT message (not Apple Swift): why "Ordering Customer" and "Intermediary" fields in MT910 but not in MT900 - swift-mt

in SWIFT (http://en.wikipedia.org/wiki/SWIFT_message_types), MT910 is "Confirmation of Credit" where MT900 is "Confirmation of Debit".
From what I understand from reading the doc, the only difference is Debit v.s. Credit. However, there are two fields "Ordering Customer" and "Intermediary" in MT910 but not in MT900. Can MT900 not have a Ordering Customer or having an Intermediary?
I tried to find an appropriate forum in stackexchange but stackoverflow seems to be the most appropriate one as this message standard is consumed by computer applications that written by developers.

There's an ordering customer and an intermediary in MT910 because the correspondent banking network means the bank that actually credited your account may not be the same as the customer (bank or corporate) who ordered the credit.
On the MT900 it's you who orders the debit of your own account, so you don't need those fields.

Related

Batch operation over thousands of aggregates in CQRS system, do people do that?

I'm working on an application for managing bank credit cards.
CQRS and Event Sourcing architecture was chosen for the app.
The most important aggregate in the app is CreditCard which controls the credit card lifecycle.
It looks something like:
class CreditCard {
private int status;
public void activate() {...}
public void deactivate () {...}
...
}
Its activate and deactivate methods protects credit card invariants and publish CardActivatedEvent and CardDeactivatedEvent, respectively, if the invocation of the method succeeds.
We store these events in the event store for later aggregate reconstruction on the command side.
We apply these events to various views.
We use these events to notify other third party systems.
All good for now.
Recently, we got a new requirement to charge all active credit cards on monthly basis.
My first instinct was, ok we can add charge method to the same CreditCard aggregate.
This method can check some invariants relevant to charging. Like, is the card in correct status for charging, was it charged already, etc.
On successful invocation, this method can publish CardChargedEvent.
Then we can create some process manager which will once per month query view side for active credit cards to get their IDs.
Having these IDs, the process manager can issue multiple charge commands (one per credit card aggregate) to the command side.
For each charge command received, the command side will reconstruct CreditCard aggregate object and call it's charge method.
The only problem is that this approach looks quite inefficient. Especially regarding database roundtrips on the command side (one read and one write per aggregate instance).
If we take into the equation that we can easily have 100k plus credit cards in our app, this roundtrip overhead starts looking to me as a bit of a problem.
Does anyone have any experience with batch operations on CQRS/ES systems?
Is my concern valid?
What to do in such cases?
How you implement batches in CQRS systems?
One alternative that pops to my mind is that for charging use case I ditch CQRS/ES/DDD principles, and implement the whole thing using stored procedures on one of our view databases. This procedure can search for suitable credit cards in the credit card view table and populate the "to be charged queue" table with records found. Then I can have some external process that reads this second table and do whatever it needs to do.
Recently, we got a new requirement to charge all active credit cards on monthly basis. My first instinct was, ok we can add charge method to the same CreditCard aggregate.
I think this is where the design flaw happens.
Your CreditCard aggregate was designed with a specific use case in mind:
The most important aggregate in the app is CreditCard which controls the credit card lifecycle.
Charging the credit card is not part of the credit card lifecycle. Whether it happens or not depends on the credit card state, but charging (successfully) the credit card will not change the state of your domain object. It should not interact with the CreditCard domain aggregate, as the purpose of your aggregate is to enforce business rules when changing your state. You should ask yourself: what aggregate is changed when charging a credit card ?
The answer to this question depends on the rest of your domain model and business cases, but it has more to do to with stuff like account balance or credit authorization than the card itself. You could implement like this:
A batch process working monthly would query your CreditCard aggregate for active cards, then try to charge all customers for their monthly fees by sending a command to the AccountBalance aggregate ;
The AccountBalance aggregate would raise a BalanceChangedEvent if the customer has enough money, or a CreditAuthorizationRequiredEvent if not, temporarily freezing the account until the credit was authorized or rejected ;
A CreditAuthorization aggregate could either allow or deny the credit, based on credit allowance business rules, raising events accordingly ;
The AccountBalance aggregate would unfreeze the account, changing the balance or not based on the outcome, eventually raising or not the BalanceChangedEvent ;
The CreditCard aggregate would register to the CreditDeniedEvent to deactivate the credit card because the customer was not able to pay the fees ;
... and so on ...

Why is the Delivery Address mandatory in SagePay v3.0?

I've looked at this question, which didn't have a suitable answer (basically recommends tokenisation). I'm intrigued as to why the fields for delivery address are mandatory as I'm assuming this isn't validated against. The billing address makes sense as this will be the address linked to the card and therefore worth validating. However, the delivery address presumably provides very little.
I can see that it's provided in the response from SagePay in relation to PayPal payments, presumably to check whether this has been altered when getting to PayPal, but as PayPal payments are optional, then if this is the only reason surely it too should be optional?
The reason I ask is that when providing a service rather than a tangible physical product, what should go in this? I'm assuming in most cases this would simply be the same as the billing address, but in the scenario that a 3rd party pays for the service, should the delivery address now be the address of the person receiving the service?
Fraud screening. Sage Pay send all of that stuff to a third party, which then provides a fraud score.
Some of the criteria for that fraud score are based around delivery (known dodgy addresses, business rather than residential, delivery address doesn't match billing etc).
You can just submit billing addresses - you may have to tune your approach towards fraud scores accordingly.

What is the risk of displaying specific error messages in credit card payment form?

I want to know whether it's okay to display specific error message something like "invalid cvv, insufficient credit etc.". Why and why not?
My opinion is that you're ok to display messages like that.. But there are caveats.
Some type of messages, such as 'CVC invalid', you can be fairly confident about. But I doubt you could ever confidently say 'insufficient credit', mainly because the card acquirers don't send that level of detail back. The best you'll get is a 'declined', but that could mean insufficient credit, or it could mean card blocked (marked as lost/stolen), or it could mean the bank don't trust the transaction (eg cardholder attempting purchase in another country, and haven't informed their bank they're travelling), or it could mean a dozen other things.
So I'd keep it simple and just repeat back the message that the card acquirer returns. Most often for failed transactions this is just simply DECLINED.

SSIS validate incoming payments

I am working on a package to process incoming payments from external entities and match them against existing "bills".
Each payment has a reference to to bill_id, so matching is easy. Bills are then flagged as paid.
Problems is payment may bounce and the contra-payment will be received in the same or, more likely, in a subsequent file. Logic is that a contra-payment must be reversing an already paid bill, while a regular payment must be for a "non paid" bill. How would you implement and enforce such a validation in SSIS, considering that the contra-payment might be in the same file as the payment it is reversing or in a successive file. How would you structure your data-flow?
Also critical is the need to report on bounced payments, to assess a kind of "default rate".
I'd like to hear the opinion of the experts.
Many thanks

When querying FreeBusy status with GetUserAvailabilityRequest, what should I use for AttendeeType?

I'm writing an application that queries a user's Outlook calendar to see if they are available to be contacted "right now" (i.e., they do not have a current appointment that is marked as Away or Out Of Office).
I'm using the GetUserAvailabilityRequest xml message and it's working well, but I'm a bit confused as to what I should use for the AttendeeType.
AttendeeType is a field that allows me to specify the kind of meeting attendee I'm looking for -- whether it's the meeting organizer, a required attendee, an optional attendee, a room resource, etc.
But for this application I don't care about the attendee type; I only care if the person has a current appointment that marks them as unavailable. If Bob is out of his office attending a meeting, I don't care if he put the meeting together or if he was invited by Carol; I only care that Bob is out of his office.
Is there a value I can use for AttendeeType that will catch all attendee types? Most of the examples I've seen use the value "Required", but they don't explain why.
I've found that both OptionalAttendee and RequiredAttendee are valid, so the choice to use RequiredAttendee is entirely stylistic/arbitrary.
I believe that this is sort of a hypothetical query, like "If this person were to come to an event at this time as an optional attendee (or as a required attendee), would they have conflicts?" So it doesn't matter if they are required or optional.
As an aside, resources are things like projectors and rooms, so I'm not sure what would happen if you tried to check a person as a resource, but I imagine it wouldn't work out.

Resources