ONDC-Official / ONDC-Protocol-Specs

Open Network for Digital Commerce (ONDC) Open API Specifications. ONDC is an ambitious initiative to democratize digital commerce by creating a decentralized network of buyer apps and seller apps through an interoperable protocol specification.
Other
138 stars 59 forks source link

Select and Init handling - What's the right way? #96

Open mahoriR opened 1 year ago

mahoriR commented 1 year ago

As BPP, we create a cart object on select. When init call comes, we use transaction_id to fetch associated cart and use it. Assumption here is that BAP will send the same items as those sent in on_select.

But in the daily syncup call today, it was said that we need to reverify the items in the init call as they may be different from what was sent in on_select. _Details for above - this happened in the case where paytm is sending items that were sent in on_select with 0 quantity again in oninit. Now we are expected to again verify the items in init and send necessary error message.

If we anyways have to do this reverification of items in init call then what's the point of select call?

Then it is as simple as - init : on_init = Create Cart and get necessary payment details. confirm : on_confirm = Create order.

Whats the point of select in that case?

@BLR-0118 @VidyaGF

VidyaGF commented 1 year ago

@BLR-0118 - Ideally ,we see the following behavior in ecommerce app :

  1. if /on_select has thrown OOS error , then the user has to fix /on_select ( by removing OOS items) before being able to checkout ( ie, /init call is only available post successful /on_select) < - else as mentioned by @mahoriR , there is no point of /select.

  2. However, verification in /init may be still be required, as the /init may be called after a certain period of time where the status of stock items has changed.

So in my opinion, allowing items with OOS to be shown in /init as per the mentioned usecase doesnt seem to be valid. A cart with error , cannot be checked out in any ecommerce app. The error has to be fixed prior.

BLR-0118 commented 1 year ago

I understand your point. There are 2 ways of handling this:

  1. Buyer app shows the buyer that item is OOS in /on_select and asks buyer to remove item from cart before proceeding;
  2. Buyer app shows the buyer that item is OOS in /on_select but asks buyer to remove item from cart in /on_init; Since there could be a lag between /on_select & /on_init, both options are feasible. How do we handle this? @mahoriR @VidyaGF
VidyaGF commented 1 year ago

@BLR-0118 @mahoriR - As far as I am aware, the case mentioned in (2) is not allowed in ecommerce app. You need to fix your cart errors(Ex: if we know the item is already OOS) , before moving to billing.

However, I have seen that in billing we may still end up in error as the status of the item may change and go back and update the cart again .

So , I think that scenario 1 + verification before /on_init will be required.