Skip to content

Commit

Permalink
[Auto Generated] 1.4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
jigardafda committed Sep 20, 2024
1 parent f4e7a34 commit 3debf03
Show file tree
Hide file tree
Showing 14 changed files with 2,736 additions and 686 deletions.
2,715 changes: 2,715 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Get started with the python Development SDK for Fynd Platform
### Usage

```bash
pip install "git+https://github.com/gofynd/[email protected].11#egg=fdk_client"
pip install "git+https://github.com/gofynd/[email protected].12#egg=fdk_client"
```

Using this method, you can `import` fdk-client-python like so:
Expand Down
2 changes: 1 addition & 1 deletion fdk_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.11"
__version__ = "1.4.12"
54 changes: 1 addition & 53 deletions fdk_client/application/cart/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def __init__(self, config: ApplicationConfig):
"selectPaymentMode": "/service/application/cart/v1.0/payment",
"validateCouponForPayment": "/service/application/cart/v1.0/payment/validate/",
"getShipments": "/service/application/cart/v1.0/shipment",
"checkoutCart": "/service/application/cart/v1.0/checkout",
"updateCartMeta": "/service/application/cart/v1.0/meta",
"getCartShareLink": "/service/application/cart/v1.0/share-cart",
"getCartSharedItems": "/service/application/cart/v1.0/share-cart/{token}",
Expand Down Expand Up @@ -1148,57 +1147,6 @@ async def getShipments(self, p=None, id=None, buy_now=None, address_id=None, are

return response

async def checkoutCart(self, buy_now=None, cart_type=None, body="", request_headers:Dict={}):
"""The checkout cart initiates the order creation process based on the selected address and payment method. It revalidates the cart details to ensure safe and seamless order placement.
:param buy_now : This indicates the type of cart to checkout. : type boolean
:param cart_type : The type of cart. : type string
"""
payload = {}

if buy_now is not None:
payload["buy_now"] = buy_now
if cart_type is not None:
payload["cart_type"] = cart_type

# Parameter validation
schema = CartValidator.checkoutCart()
schema.dump(schema.load(payload))

# Body validation
from .models import CartCheckoutDetailRequest
schema = CartCheckoutDetailRequest()
schema.dump(schema.load(body))

url_with_params = await create_url_with_params(api_url=self._urls["checkoutCart"], proccessed_params="""{"required":[],"optional":[{"in":"query","name":"buy_now","description":"This indicates the type of cart to checkout.","schema":{"type":"boolean"}},{"name":"cart_type","in":"query","schema":{"type":"string"},"description":"The type of cart."}],"query":[{"in":"query","name":"buy_now","description":"This indicates the type of cart to checkout.","schema":{"type":"boolean"}},{"name":"cart_type","in":"query","schema":{"type":"string"},"description":"The type of cart."}],"headers":[],"path":[]}""", serverType="application", buy_now=buy_now, cart_type=cart_type)
query_string = await create_query_string(buy_now=buy_now, cart_type=cart_type)

headers={}
headers["Authorization"] = f'Bearer {base64.b64encode(f"{self._conf.applicationID}:{self._conf.applicationToken}".encode()).decode()}'
if self._conf.locationDetails:
headers["x-location-detail"] = ujson.dumps(self._conf.locationDetails)
for h in self._conf.extraHeaders:
headers.update(h)
if request_headers != {}:
headers.update(request_headers)

exclude_headers = []
for key, val in headers.items():
if not key.startswith("x-fp-"):
exclude_headers.append(key)

response = await AiohttpHelper().aiohttp_request("POST", url_with_params, headers=get_headers_with_signature(urlparse(self._urls["checkoutCart"]).netloc, "post", await create_url_without_domain("/service/application/cart/v1.0/checkout", buy_now=buy_now, cart_type=cart_type), query_string, headers, body, exclude_headers=exclude_headers), data=body, cookies=self._conf.cookies, debug=(self._conf.logLevel=="DEBUG"))

if 200 <= int(response['status_code']) < 300:
from .models import CartCheckoutResponse
schema = CartCheckoutResponse()
try:
schema.load(response["json"])
except Exception as e:
print("Response Validation failed for checkoutCart")
print(e)

return response

async def updateCartMeta(self, id=None, buy_now=None, body="", request_headers:Dict={}):
"""Update metadata associated with a cart, which includes customer preferences, delivery instructions, or any special requirements related to the cart items.
:param id : The unique identifier of the cart. : type string
Expand Down Expand Up @@ -1543,7 +1491,7 @@ async def getPromotionPaymentOffers(self, id=None, uid=None, body="", request_he
return response

async def checkoutCartV2(self, buy_now=None, cart_type=None, body="", request_headers:Dict={}):
"""Enhanced version of checkout process that supports multiple mode of payment(MOP).
"""The checkout cart initiates the order creation process based on the items in the user’s cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement.
:param buy_now : This indicates the type of cart to checkout. : type boolean
:param cart_type : The type of cart. : type string
"""
Expand Down
72 changes: 0 additions & 72 deletions fdk_client/application/cart/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,6 @@ class CartShipmentsResponse(BaseSchema):
pass


class CartCheckoutCustomMeta(BaseSchema):
pass


class CustomerDetails(BaseSchema):
pass

Expand All @@ -316,10 +312,6 @@ class StaffCheckout(BaseSchema):
pass


class CartCheckoutDetailRequest(BaseSchema):
pass


class CheckCart(BaseSchema):
pass

Expand Down Expand Up @@ -1711,16 +1703,6 @@ class CartShipmentsResponse(BaseSchema):



class CartCheckoutCustomMeta(BaseSchema):
# Cart swagger.json


key = fields.Str(required=False)

value = fields.Str(required=False)



class CustomerDetails(BaseSchema):
# Cart swagger.json

Expand Down Expand Up @@ -1749,60 +1731,6 @@ class StaffCheckout(BaseSchema):



class CartCheckoutDetailRequest(BaseSchema):
# Cart swagger.json


custom_meta = fields.List(fields.Nested(CartCheckoutCustomMeta, required=False), required=False)

customer_details = fields.Dict(required=False)

merchant_code = fields.Str(required=False)

id = fields.Str(required=False)

payment_auto_confirm = fields.Boolean(required=False)

payment_mode = fields.Str(required=False)

aggregator = fields.Str(required=False)

address_id = fields.Str(required=False)

callback_url = fields.Str(required=False)

delivery_address = fields.Dict(required=False)

staff = fields.Nested(StaffCheckout, required=False)

order_type = fields.Str(required=False)

ordering_store = fields.Int(required=False)

extra_meta = fields.Dict(required=False)

payment_identifier = fields.Str(required=False)

billing_address = fields.Dict(required=False)

payment_params = fields.Dict(required=False)

billing_address_id = fields.Str(required=False)

meta = fields.Dict(required=False)

payment_extra_identifiers = fields.Dict(required=False)

iin = fields.Str(required=False)

network = fields.Str(required=False)

type = fields.Str(required=False)

card_id = fields.Str(required=False)



class CheckCart(BaseSchema):
# Cart swagger.json

Expand Down
13 changes: 0 additions & 13 deletions fdk_client/application/cart/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@










Expand Down Expand Up @@ -441,15 +437,6 @@ class getShipments(BaseSchema):



class checkoutCart(BaseSchema):


buy_now = fields.Boolean(required=False)

cart_type = fields.Str(required=False)



class updateCartMeta(BaseSchema):


Expand Down
48 changes: 1 addition & 47 deletions fdk_client/platform/cart/applicationClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -2549,52 +2549,6 @@ async def updateCartMeta(self, id=None, buy_now=None, body="", request_headers:D

return response

async def platformCheckoutCart(self, id=None, body="", request_headers:Dict={}):
"""The checkout cart initiates the order creation process based on the selected address and payment method. It revalidates the cart details to ensure safe and seamless order placement.
:param id : The unique identifier of the cart : type string
"""
payload = {}

if id is not None:
payload["id"] = id

# Parameter validation
schema = CartValidator.platformCheckoutCart()
schema.dump(schema.load(payload))

# Body validation
from .models import PlatformCartCheckoutDetailRequest
schema = PlatformCartCheckoutDetailRequest()
schema.dump(schema.load(body))

url_with_params = await create_url_with_params(self._conf.domain, f"/service/platform/cart/v1.0/company/{self._conf.companyId}/application/{self.applicationId}/checkout", """{"required":[{"schema":{"type":"string"},"description":"Current company id","in":"path","required":true,"name":"company_id"},{"schema":{"type":"string"},"description":"Current Application _id","in":"path","required":true,"name":"application_id"}],"optional":[{"in":"query","name":"id","required":false,"schema":{"type":"string"},"description":"The unique identifier of the cart"}],"query":[{"in":"query","name":"id","required":false,"schema":{"type":"string"},"description":"The unique identifier of the cart"}],"headers":[],"path":[{"schema":{"type":"string"},"description":"Current company id","in":"path","required":true,"name":"company_id"},{"schema":{"type":"string"},"description":"Current Application _id","in":"path","required":true,"name":"application_id"}]}""", serverType="platform", id=id)
query_string = await create_query_string(id=id)

headers = {}
headers["Authorization"] = f"Bearer {await self._conf.getAccessToken()}"
for h in self._conf.extraHeaders:
headers.update(h)
if request_headers != {}:
headers.update(request_headers)

exclude_headers = []
for key, val in headers.items():
if not key.startswith("x-fp-"):
exclude_headers.append(key)

response = await AiohttpHelper().aiohttp_request("POST", url_with_params, headers=get_headers_with_signature(self._conf.domain, "post", await create_url_without_domain(f"/service/platform/cart/v1.0/company/{self._conf.companyId}/application/{self.applicationId}/checkout", id=id), query_string, headers, body, exclude_headers=exclude_headers), data=body, debug=(self._conf.logLevel=="DEBUG"))

if 200 <= int(response['status_code']) < 300:
from .models import CartCheckoutResponse
schema = CartCheckoutResponse()
try:
schema.load(response["json"])
except Exception as e:
print("Response Validation failed for platformCheckoutCart")
print(e)

return response

async def getAvailableDeliveryModes(self, area_code=None, id=None, request_headers:Dict={}):
"""Retrieve a list of delivery modes (home delivery/store pickup) along with a list of available pickup stores for a given cart at a specified PIN Code.
:param area_code : : type string
Expand Down Expand Up @@ -2795,7 +2749,7 @@ async def validateCouponForPayment(self, id=None, buy_now=None, address_id=None,
return response

async def platformCheckoutCartV2(self, id=None, body="", request_headers:Dict={}):
"""Checkout process that supports multiple MOP(mode of payment).
"""The checkout cart initiates the order creation process based on the items in the user’s cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement.
:param id : The unique identifier of the cart : type string
"""
payload = {}
Expand Down
16 changes: 0 additions & 16 deletions fdk_client/platform/cart/applicationValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,6 @@











Expand Down Expand Up @@ -1135,17 +1130,6 @@ class updateCartMeta(BaseSchema):



class platformCheckoutCart(BaseSchema):


company_id = fields.Str(required=False)

application_id = fields.Str(required=False)

id = fields.Str(required=False)



class getAvailableDeliveryModes(BaseSchema):


Expand Down
Loading

0 comments on commit 3debf03

Please sign in to comment.