Hyperledger Online payment use case: front end GO implementation - bitcoin

I am new to hyperledger and online payment.
One scenario I have in mind is: if A is an online shop, B is a consumer. B orders an item from A's shop and pays with Bitcoin/hyperledger. A ships the item to B once the payment is received.
With hyperledger, the process goes:
B sends A the payment via blockchain;
A is able to query how much money A owns;
But the question is:
How does A know if the transaction was from B?
How does A know how much money was sent by B?
How does A know if the transaction from B is for the specific ordered item?
Thanks,

What you'd usually do in Bitcoin is to create a new payment address that is bound to the specific order. The invoice would include that address with instructions to send the specified amount to that address and the recipient could simply wait for an incoming transaction with an output destined for that address.
At this point you'd know which customer has paid for which order, to check the amount just check the output value field in the transaction and compare it to the invoice.

Related

Need help on implementing this Use-Case Scenario in NetSuite Oracle

I am very new to E-Commerce World.
I have a use case scenario that I want to Implement in Oracle NetSuite.
But I am not sure how to move forward with it.
Use-Case Scenario:
A Sales Order has a few Line Items & Among them, a few are out of stock.
The 3PL currently I am dealing with accepts only one Unique Sales Order ID as an Identifier.
I want to fulfill the items that are currently in stock and Later on, when the Inventory gets updated I want to fulfill the remaining Items back-ordered in the Sales Order.
But the fulfillment should happen only after the customer has paid for the Items.
Can anyone let me know? How can I achieve this?
Thank you.
You will probably need some customisation to achieve this. I don't know the full set of processes you're working with, but as a general approach, I would suggest the following:
Set up a payment term that says the customer must prepay.
Set up a script to run on your fulfilments, handle "prepay" customers.
You'll also want to check your settings in Setup > Accounting > Accounting Preferences > Order Management. Look for the option on sales orders and fulfilment. You'll probably want to default your fulfilment to available quantity only. You may want to prevent overage on your fulfilments.
When the script executes on your fulfilment, it should execute "before load". The script will need to check the sales order it's fulfilling. If the term is "prepay", the script should then check if a payment has been made against the sales order. You'll potentially need to consider deposits and paid invoices. If the script finds no payments, then it should block the fulfilment.
I'm working on the assumption that you will create a fulfilment with a "Picked" status to send to your warehouse. When they confirm the "goods-out", you will want some sort of feedback loop from your 3PL to set the fulfilment to "Shipped" and update your tracking numbers.
I hope this helps.
Mark

Update draft invoice from API, Unbalanced exception

Our customers have a subscription on our services.
The subscription generates an draft invoice and one of the product on the draft I want to change the quantity off. This product quantity is different every month and our external software know this number.
What I’ve do through the API/XMLRPC.
We find the draft in the 'account.move' model then search the 'account.move.line' for our product. Then here we change the amount and we write the 'account.move.line' back.
Here we get an exception 'Cannot create unbalanced journal entry. <...>.'.
I can’t believe we have the recalculate all the financial values. Isn’t this something the API should do?

How do I access all the information for a Square transaction?

I am a student (so I am pretty new to all of this stuff) trying to create a database for a coffee shop that uses Square for their register and website. I want the database to update with all the information from a transaction every time one is completed.
I have a webhook that gets me the IDs every time a transaction completes, I can send the transaction ID to the Square API with an http request and get back information about the payment, but I still cannot figure out how to get the rest of the transaction information. We want to query the database about what kinds of items are being sold when and with what modifiers, but so far the only way I can get that is through downloading a csv file with the item line information from the Square Dashboard.
If there is a way to get the line item information in some kind of way that can be automatically added to the database, I would really appreciate the help. I have been looking for a solution and cannot find it on my own.
For in-person payments the only way to see itemizations is to use V1 ListPayments (or RetrievePayment).
In order to see itemizations for online payments, you must utilize Square's Orders API. The workflow would be:
Create an order (CreateOrder) with line_items (can be ad-hoc, or use Catalog ids). Save the order_id for the next step.
When calling Charge, pass in the order_id from the previous step.
Once you are successfully attaching the order_id's, when you retrieve a transaction you will be able to call the BatchRetrieveOrders endpoint with the order_id to see the itemizations.
References:
V1 Payments
Orders Overview
Orders Reference

mantle.account.invoice.Invoice - How to correctly handle credit invoicing?

Let us assume there is a situation when I have an invoice from a supplier to my company (e.g. 1000 EUR). My company returns all the goods because of a problem. The supplier shall issue a credit invoice in amount of 1000 EUR, which I register in my system. As a result I will have (on behalf of the supplier) an account payable of 1000 EUR and an account receivable in the same amount. What is the preferred way of handling this situation, because there will be no money transferred, either way.
Should I generate a paymentApplication to both invoices? I want to see them as +1000 -1000 = 0 EUR.
The current data model and services do not support applying an invoice to an invoice, i.e. canceling part or all of one invoice with another. That is something I have considered but IMO is messy... even if it is a common practice in certain parts of the world (from my limited knowledge of it an archaic practice that isn't so commonly used any more). That could be supported though, I have certainly considered it (adding an entity or perhaps modifying PaymentApplication to support it, adding a service to do it and a corresponding GL posting service to balance AP/AR accounts).
Right now the best thing to do a cancel the original invoice, which does the proper reverse GL postings if the invoice has already been posted.
If you want both invoices in the system and canceling entries somewhere the currently supported approach is to use a FinancialAccount, basically use FinancialAccount payments to pay both invoices and then the balance of the FinancialAccount represents the amount due or owed to the external party. There is full support for these sorts of FinancialAccount transactions, doing payments both ways (withdrawals and deposits), representing the liability for positive balances in the GL, etc.

ebay getOrders API

I am building a .net service to getOrders from ebay. my service runs fine, however I dont know how should I handle data.
For example I am using CreateTimeTo and CreateTimeFrom Filter to return orders from past 24 hours. I save them into my database, now some orders return no Address info.
My question is, Whats the best way to hadnle/update already imported orders into my database. Say for example order imported into my system wa without shiping info, and customer completed shipping info after a week, how would I update that order in my system?
Thanks
I would definitely use modtimefrom modtimeto filter. Ih this way you can get all order that have been modiefied in last "x interval". This way you will get either new orders and modified (checkout complete - paid - shipped) and so on. My favourite filter anyway is NumberOfDays. This one acts as ModTimeFrom/ModTimeTo but is way more simple and you don't have to deal with dates.
An order without address means buyer has not completed checkout (no payment selected so no shipping address as well yet).
Once buyer completes checkout or order is mark as paid the entire address will be avaible.
You can get buyer default address shipping by using call GetSellerTransaction
I hope i understood your question and to be helpful.