Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 17 additions & 26 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,10 @@
]
}
},
"/v0.1/checkouts/{id}": {
"/v0.1/checkouts/{checkout_id}": {
"parameters": [
{
"name": "id",
"name": "checkout_id",
"in": "path",
"description": "Unique ID of the checkout resource.",
"required": true,
Expand Down Expand Up @@ -1150,14 +1150,14 @@
]
}
},
"/v0.2/checkouts/{id}/apple-pay-session": {
"/v0.2/checkouts/{checkout_id}/apple-pay-session": {
"put": {
"operationId": "CreateApplePaySession",
"summary": "Create an Apple Pay session",
"description": "Creates an Apple Pay merchant session for the specified checkout.\n\nUse this endpoint after the customer selects Apple Pay and before calling\n`ApplePaySession.completeMerchantValidation(...)` in the browser.\nSumUp validates the merchant session request and returns the Apple Pay\nsession object that your frontend should pass to Apple's JavaScript API.\n",
"parameters": [
{
"name": "id",
"name": "checkout_id",
"in": "path",
"description": "Unique ID of the checkout resource.",
"required": true,
Expand Down Expand Up @@ -1900,7 +1900,7 @@
]
}
},
"/v1.0/merchants/{merchant_code}/payments/{id}/refunds": {
"/v1.0/merchants/{merchant_code}/payments/{transaction_id}/refunds": {
"parameters": [
{
"name": "merchant_code",
Expand All @@ -1913,7 +1913,7 @@
}
},
{
"name": "id",
"name": "transaction_id",
"in": "path",
"description": "Unique ID of the transaction.",
"required": true,
Expand Down Expand Up @@ -2658,14 +2658,14 @@
]
}
},
"/v1.1/receipts/{id}": {
"/v1.1/receipts/{transaction_id}": {
"get": {
"operationId": "GetReceipt",
"summary": "Retrieve receipt details",
"description": "Retrieves receipt specific data for a transaction.",
"parameters": [
{
"name": "id",
"name": "transaction_id",
"in": "path",
"description": "SumUp unique transaction ID or transaction code, e.g. TS7HDYLSKD.",
"required": true,
Expand Down Expand Up @@ -4549,14 +4549,14 @@
"UpdateReaderByID": {
"operationId": "UpdateReader",
"parameters": {
"id": "$response.body#/id"
"reader_id": "$response.body#/id"
},
"description": "Update the reader object. This can be used to set a name after using this endpoint to verify the pairing code."
},
"DeleteReaderByID": {
"operationId": "DeleteReader",
"parameters": {
"id": "$response.body#/id"
"reader_id": "$response.body#/id"
},
"description": "Delete the reader."
}
Expand Down Expand Up @@ -4639,7 +4639,7 @@
]
}
},
"/v0.1/merchants/{merchant_code}/readers/{id}": {
"/v0.1/merchants/{merchant_code}/readers/{reader_id}": {
"get": {
"operationId": "GetReader",
"summary": "Retrieve a Reader",
Expand Down Expand Up @@ -4677,7 +4677,7 @@
}
},
{
"name": "id",
"name": "reader_id",
"in": "path",
"description": "The unique identifier of the reader.",
"required": true,
Expand Down Expand Up @@ -4757,7 +4757,7 @@
}
},
{
"name": "id",
"name": "reader_id",
"in": "path",
"description": "The unique identifier of the reader.",
"required": true,
Expand Down Expand Up @@ -4830,7 +4830,7 @@
}
},
{
"name": "id",
"name": "reader_id",
"in": "path",
"description": "The unique identifier of the reader.",
"required": true,
Expand Down Expand Up @@ -5403,7 +5403,7 @@
}
},
"CheckoutID": {
"name": "id",
"name": "checkout_id",
"in": "path",
"required": true,
"description": "Unique ID of the checkout resource.",
Expand Down Expand Up @@ -5539,15 +5539,6 @@
"type": "string"
}
},
"TxnID": {
"in": "path",
"name": "txn_id",
"required": true,
"description": "Unique ID of the transaction.",
"schema": {
"type": "string"
}
},
"TypesFilter": {
"name": "types",
"in": "query",
Expand Down Expand Up @@ -9595,14 +9586,14 @@
"UpdateReaderByID": {
"operationId": "UpdateReader",
"parameters": {
"id": "$response.body#/id"
"reader_id": "$response.body#/id"
},
"description": "Update the reader object. This can be used to set a name after using this endpoint to verify the pairing code."
},
"DeleteReaderByID": {
"operationId": "DeleteReader",
"parameters": {
"id": "$response.body#/id"
"reader_id": "$response.body#/id"
},
"description": "Delete the reader."
}
Expand Down
50 changes: 34 additions & 16 deletions sumup/checkouts/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,9 @@ def list(
else:
raise APIError(f"Unexpected response", status=resp.status_code, body=resp.text)

def get(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> CheckoutSuccess:
def get(
self, checkout_id: str, headers: typing.Optional[HeaderTypes] = None
) -> CheckoutSuccess:
"""
Retrieve a checkout

Expand All @@ -490,7 +492,7 @@ def get(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> Checkout
Unexpected response statuses also raise this exception.
"""
resp = self._client.get(
f"/v0.1/checkouts/{id}",
f"/v0.1/checkouts/{checkout_id}",
headers=headers,
)
if resp.status_code == 200:
Expand All @@ -508,7 +510,7 @@ def get(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> Checkout

def process(
self,
id: str,
checkout_id: str,
*,
payment_type: ProcessCheckoutBodyPaymentTypeInput,
installments: typing.Union[int, None, NotGivenType] = NOT_GIVEN,
Expand Down Expand Up @@ -557,7 +559,7 @@ def process(
body_data["personal_details"] = personal_details

resp = self._client.put(
f"/v0.1/checkouts/{id}",
f"/v0.1/checkouts/{checkout_id}",
json=serialize_request_data(body_data),
headers=headers,
)
Expand Down Expand Up @@ -588,7 +590,9 @@ def process(
else:
raise APIError(f"Unexpected response", status=resp.status_code, body=resp.text)

def deactivate(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> Checkout:
def deactivate(
self, checkout_id: str, headers: typing.Optional[HeaderTypes] = None
) -> Checkout:
"""
Deactivate a checkout

Expand All @@ -603,7 +607,7 @@ def deactivate(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> C
Unexpected response statuses also raise this exception.
"""
resp = self._client.delete(
f"/v0.1/checkouts/{id}",
f"/v0.1/checkouts/{checkout_id}",
headers=headers,
)
if resp.status_code == 200:
Expand All @@ -626,7 +630,12 @@ def deactivate(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> C
raise APIError(f"Unexpected response", status=resp.status_code, body=resp.text)

def create_apple_pay_session(
self, id: str, *, context: str, target: str, headers: typing.Optional[HeaderTypes] = None
self,
checkout_id: str,
*,
context: str,
target: str,
headers: typing.Optional[HeaderTypes] = None,
) -> CreateApplePaySession200Response:
"""
Create an Apple Pay session
Expand All @@ -651,7 +660,7 @@ def create_apple_pay_session(
body_data["target"] = target

resp = self._client.put(
f"/v0.2/checkouts/{id}/apple-pay-session",
f"/v0.2/checkouts/{checkout_id}/apple-pay-session",
json=serialize_request_data(body_data),
headers=headers,
)
Expand Down Expand Up @@ -834,7 +843,9 @@ async def list(
else:
raise APIError(f"Unexpected response", status=resp.status_code, body=resp.text)

async def get(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> CheckoutSuccess:
async def get(
self, checkout_id: str, headers: typing.Optional[HeaderTypes] = None
) -> CheckoutSuccess:
"""
Retrieve a checkout

Expand All @@ -848,7 +859,7 @@ async def get(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> Ch
Unexpected response statuses also raise this exception.
"""
resp = await self._client.get(
f"/v0.1/checkouts/{id}",
f"/v0.1/checkouts/{checkout_id}",
headers=headers,
)
if resp.status_code == 200:
Expand All @@ -866,7 +877,7 @@ async def get(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> Ch

async def process(
self,
id: str,
checkout_id: str,
*,
payment_type: ProcessCheckoutBodyPaymentTypeInput,
installments: typing.Union[int, None, NotGivenType] = NOT_GIVEN,
Expand Down Expand Up @@ -915,7 +926,7 @@ async def process(
body_data["personal_details"] = personal_details

resp = await self._client.put(
f"/v0.1/checkouts/{id}",
f"/v0.1/checkouts/{checkout_id}",
json=serialize_request_data(body_data),
headers=headers,
)
Expand Down Expand Up @@ -946,7 +957,9 @@ async def process(
else:
raise APIError(f"Unexpected response", status=resp.status_code, body=resp.text)

async def deactivate(self, id: str, headers: typing.Optional[HeaderTypes] = None) -> Checkout:
async def deactivate(
self, checkout_id: str, headers: typing.Optional[HeaderTypes] = None
) -> Checkout:
"""
Deactivate a checkout

Expand All @@ -961,7 +974,7 @@ async def deactivate(self, id: str, headers: typing.Optional[HeaderTypes] = None
Unexpected response statuses also raise this exception.
"""
resp = await self._client.delete(
f"/v0.1/checkouts/{id}",
f"/v0.1/checkouts/{checkout_id}",
headers=headers,
)
if resp.status_code == 200:
Expand All @@ -984,7 +997,12 @@ async def deactivate(self, id: str, headers: typing.Optional[HeaderTypes] = None
raise APIError(f"Unexpected response", status=resp.status_code, body=resp.text)

async def create_apple_pay_session(
self, id: str, *, context: str, target: str, headers: typing.Optional[HeaderTypes] = None
self,
checkout_id: str,
*,
context: str,
target: str,
headers: typing.Optional[HeaderTypes] = None,
) -> CreateApplePaySession200Response:
"""
Create an Apple Pay session
Expand All @@ -1009,7 +1027,7 @@ async def create_apple_pay_session(
body_data["target"] = target

resp = await self._client.put(
f"/v0.2/checkouts/{id}/apple-pay-session",
f"/v0.2/checkouts/{checkout_id}/apple-pay-session",
json=serialize_request_data(body_data),
headers=headers,
)
Expand Down
Loading
Loading