-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registrar: Credit/debit card payment solution #419
Comments
For the initial intermediary we have chosen EveryPay. |
Access to test account created to Maciej |
I spent some time investigating how EveryPay works and there are few questions that we should answer before moving forward, mostly related to compatibility with banklink and the ability to use different intermediaries in the future (i.e Stripe), especially since it's an open source project. Given that we have refactoring for banklink planned in issue #646, I think we should plan for the following URL schema and controller inheritance to follow the 7-action Rails convention:
In case of EveryPay, we would use:
Similarly, Swedbank, would use:
I haven't yet figured out how to separate them properly, but I'm thinking we might put all payment gateways that we use here into it's own separate mountable engine with its own git repo. It will be EIS specific, other people can write their own that covers stripe/paypal/etc. We however need to create a clear interface on handling the payments, which we currently do in a method on BankLink::Request. We also need to decide if and how we want to store info about payments. Most payment providers require some kind of unique identifier to be set on the merchant side to isolate each transaction. It cannot be the invoice reference number, as there might be two payments attached to the same invoice, with one being failed or not completed. We can:
|
Proposal sounds and looks good. Lets proceed with the trackable solution with extra table. |
Sounds good to me. Few other things to consider:
So it should be possible to create new payment in UI, not btw,
|
Partial payments introduce complexity we probably don't want. I'd avoid them at all cost, otherwise we need to figure out what to do with invoices that are partially paid, which is pretty big deal accounting-wise. Plus, as a customer you are not allowed to change the amount in the credit card payment. If you do that with Javascript, HMAC will be broken and will not be authorized in EveryPay. I am against |
I don't think there is some accounting software that wouldn't support partial payments or an accountant who would ignore them, but that's up to @vohmar. "confirm" was just an example. It's up to you how exactly it should be called. |
we do not support partial payments in the registry software at the moment nor do I see any reason to implement it. We have and will continue to handle these rare cases manually usually by paying back the partial payment and asking registrar by making new payment for the correct sum. |
Perhaps other registries may benefit from this feature? |
I agree, but at this moment it seems to introduce too many complexities. Also as registrars are in control of the billing - creating, paying and canceling the invoices as necessary it is hard to see what is the added value here. |
web UI's do not work after cofiguring the EveryPay - passenger will not start error message:
|
Please add the following to
It's in the branch's example file as well, I assumed that those are added automatically: |
|
I don't think "payment" is a good naming here.
Wouldn't it be better to call it "Payment gateway" instead? If I understand correctly, the entity in question is a payment facility, not amount of money paid, so |
@artur-beljajev Indeed, I think
This is essentially what we do here, we ask the customer to authorize a payment order to pay a specific invoice and then given the state of that payment order, make changes in our system. Plus, it's quite natural for an invoice to have multiple payment orders, differentiated by channels/banks. |
Payment order ("maksekorraldus" in Estonian) is internal to a bank, so we cannot and should not create it in terms of design. Bank may or may not use it, it's not our business. To my understanding, what we do here, is that we allow a customer to pay through some facility and how that payment is done should be hidden behind some abstraction, and "Payment gateway" seemed like a good name for that abstraction. https://github.com/search?l=Ruby&q=payment_gateway&type=Code P.S. Looking at examples of those orders, I also don't see them connected to our case:
Other info:
Not sure what we deal with a payment processor here as well. |
That's not true, please read BankLink documentation. Usage of service 1011 is exactly that: creating a payment order that customer cannot change, and sending it over the wire to the bank. They need to be understood by the bank, but that doesn't mean that they are internal. https://www.seb.ee/sites/default/files/web/files/pangalingi_tehniline_specENG.pdf The same goes for EveryPay, the customer can only authorize or cancel the pre-filled payment order. |
I'll change it Imagine that you have a company that sells physical goods and needs to ship them to customers using different transport companies (Postal, DHL, UPS, etc.). You have an A typical interface for that would look close to the following: order = Order.find_by(params)
shipping_carrier = ShippingCarriers::UPS.new(order)
shipping_carrier.prepare_shipping_manifest
shipping_carrier.deliver_package
shipping_carrier.complete_delivery
shipping_carrier.cancel_delivery Looks good, but if we were to model real world, it should be replaced with a singleton since there's only one UPS and one Omniva, not many. Now we have a bunch of non-OO procedures: order = Order.find_by(params)
ShippingCarriers::UPS.prepare_shipping_manifest(order)
ShippingCarriers::UPS.deliver_package(order)
ShippingCarriers::UPS.complete_delivery(order)
ShippingCarriers::UPS.cancel_delivery(order) IMHO a better choice is to have an object called order = Order.find_by(params)
# A carrier can also be an injectable object, depending on how complicated the logic is.
shipment = Shipment.new(order, :omniva)
shipment.prepare_manifest
shipment.deliver
shipment.mark_as_delivered
shipment.cancel |
Hey @vohmar,
I'm pretty certain that's how Estonian ID should work (smart/mobile/ID card), otherwise it would be unsafe. When you exit the page to go to pay, you end the session. You need to authenticate again to resume. You can check it at your internet bank: login, close the page, try to reopen the page. You'll see a cache missing message and be redirected back to the login screen. |
I cannot name any services using bank link or credit card payments that require user to login again after the payment is processed. So purely from user experience point of view we should try to retain the session during the credit card and bank link payments. That said the last update that keeps the action in one tab still arrives to the same result of ending the session and requiring to log in again. Tested with both mobile-id and id-card logins. |
users logged in using pki auth are logged out as well on back to merchant action - same as with mobile-id and id-card users |
It's worth trying to set |
As @artur-beljajev suggested, we need to change staging values as they currently don't allow for post requests to retain session in non-GET requests. They need to be update to the same values as in production, where it works properly. |
The values in staging are now updated, after you clear out your session, it can be re-tested. |
in production |
Foreign registrars have only bank transaction option and TransferWise if they know and use it for payments to their credit accounts in .ee registry. To make this process simpler and more flexible.
The text was updated successfully, but these errors were encountered: