Skip to content
Open
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
13 changes: 5 additions & 8 deletions Adyen/services/checkout/donations_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@
"""
Get a list of donation campaigns.
"""
endpoint = self.baseUrl + "/donationCampaigns"
endpoint = self.baseUrl + f"/donationCampaigns"

Check warning on line 20 in Adyen/services/checkout/donations_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00AE63pryTICbPv7&open=AZ0K00AE63pryTICbPv7&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def donations(self, request, idempotency_key=None, **kwargs):
"""
Make a donation
"""
endpoint = self.baseUrl + "/donations"
endpoint = self.baseUrl + f"/donations"

Check warning on line 28 in Adyen/services/checkout/donations_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00AE63pryTICbPv8&open=AZ0K00AE63pryTICbPv8&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

43 changes: 12 additions & 31 deletions Adyen/services/checkout/modifications_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,66 +17,47 @@
"""
Cancel an authorised payment
"""
endpoint = self.baseUrl + "/cancels"
endpoint = self.baseUrl + f"/cancels"

Check warning on line 20 in Adyen/services/checkout/modifications_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00A_63pryTICbPv-&open=AZ0K00A_63pryTICbPv-&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def cancel_authorised_payment_by_psp_reference(
self, request, paymentPspReference, idempotency_key=None, **kwargs
):
def cancel_authorised_payment_by_psp_reference(self, request, paymentPspReference, idempotency_key=None, **kwargs):

Check warning on line 24 in Adyen/services/checkout/modifications_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "paymentPspReference" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00A_63pryTICbPv_&open=AZ0K00A_63pryTICbPv_&pullRequest=460
"""
Cancel an authorised payment
"""
endpoint = self.baseUrl + f"/payments/{paymentPspReference}/cancels"
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def capture_authorised_payment(
self, request, paymentPspReference, idempotency_key=None, **kwargs
):
def capture_authorised_payment(self, request, paymentPspReference, idempotency_key=None, **kwargs):

Check warning on line 32 in Adyen/services/checkout/modifications_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "paymentPspReference" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00A_63pryTICbPwA&open=AZ0K00A_63pryTICbPwA&pullRequest=460
"""
Capture an authorised payment
"""
endpoint = self.baseUrl + f"/payments/{paymentPspReference}/captures"
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def refund_captured_payment(self, request, paymentPspReference, idempotency_key=None, **kwargs):
"""
Refund a captured payment
"""
endpoint = self.baseUrl + f"/payments/{paymentPspReference}/refunds"
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def refund_or_cancel_payment(
self, request, paymentPspReference, idempotency_key=None, **kwargs
):
def refund_or_cancel_payment(self, request, paymentPspReference, idempotency_key=None, **kwargs):

Check warning on line 48 in Adyen/services/checkout/modifications_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "paymentPspReference" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00A_63pryTICbPwB&open=AZ0K00A_63pryTICbPwB&pullRequest=460
"""
Refund or cancel a payment
"""
endpoint = self.baseUrl + f"/payments/{paymentPspReference}/reversals"
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def update_authorised_amount(
self, request, paymentPspReference, idempotency_key=None, **kwargs
):
def update_authorised_amount(self, request, paymentPspReference, idempotency_key=None, **kwargs):

Check warning on line 56 in Adyen/services/checkout/modifications_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "paymentPspReference" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00A_63pryTICbPwC&open=AZ0K00A_63pryTICbPwC&pullRequest=460
"""
Update an authorised amount
"""
endpoint = self.baseUrl + f"/payments/{paymentPspReference}/amountUpdates"
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

19 changes: 7 additions & 12 deletions Adyen/services/checkout/orders_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,23 @@
"""
Cancel an order
"""
endpoint = self.baseUrl + "/orders/cancel"
endpoint = self.baseUrl + f"/orders/cancel"

Check warning on line 20 in Adyen/services/checkout/orders_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00Be63pryTICbPwD&open=AZ0K00Be63pryTICbPwD&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def get_balance_of_gift_card(self, request, idempotency_key=None, **kwargs):
"""
Get the balance of a gift card
"""
endpoint = self.baseUrl + "/paymentMethods/balance"
endpoint = self.baseUrl + f"/paymentMethods/balance"

Check warning on line 28 in Adyen/services/checkout/orders_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00Be63pryTICbPwE&open=AZ0K00Be63pryTICbPwE&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def orders(self, request, idempotency_key=None, **kwargs):
"""
Create an order
"""
endpoint = self.baseUrl + "/orders"
endpoint = self.baseUrl + f"/orders"

Check warning on line 36 in Adyen/services/checkout/orders_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00Be63pryTICbPwF&open=AZ0K00Be63pryTICbPwF&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

15 changes: 5 additions & 10 deletions Adyen/services/checkout/payment_links_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,21 @@
"""
endpoint = self.baseUrl + f"/paymentLinks/{linkId}"
method = "GET"
return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def payment_links(self, request, idempotency_key=None, **kwargs):
"""
Create a payment link
"""
endpoint = self.baseUrl + "/paymentLinks"
endpoint = self.baseUrl + f"/paymentLinks"

Check warning on line 28 in Adyen/services/checkout/payment_links_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K00Ai63pryTICbPv9&open=AZ0K00Ai63pryTICbPv9&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def update_payment_link(self, request, linkId, idempotency_key=None, **kwargs):
"""
Update the status of a payment link
"""
endpoint = self.baseUrl + f"/paymentLinks/{linkId}"
method = "PATCH"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

35 changes: 12 additions & 23 deletions Adyen/services/checkout/payments_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,58 +17,47 @@
"""
Get the brands and other details of a card
"""
endpoint = self.baseUrl + "/cardDetails"
endpoint = self.baseUrl + f"/cardDetails"

Check warning on line 20 in Adyen/services/checkout/payments_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z-W63pryTICbPvu&open=AZ0K0z-W63pryTICbPvu&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def get_result_of_payment_session(self, sessionId, idempotency_key=None, **kwargs):
"""
Get the result of a payment session
"""
endpoint = self.baseUrl + f"/sessions/{sessionId}"
method = "GET"
return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def payment_methods(self, request, idempotency_key=None, **kwargs):
"""
Get a list of available payment methods
"""
endpoint = self.baseUrl + "/paymentMethods"
endpoint = self.baseUrl + f"/paymentMethods"

Check warning on line 36 in Adyen/services/checkout/payments_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z-W63pryTICbPvv&open=AZ0K0z-W63pryTICbPvv&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def payments(self, request, idempotency_key=None, **kwargs):
"""
Start a transaction
"""
endpoint = self.baseUrl + "/payments"
endpoint = self.baseUrl + f"/payments"

Check warning on line 44 in Adyen/services/checkout/payments_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z-W63pryTICbPvw&open=AZ0K0z-W63pryTICbPvw&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def payments_details(self, request, idempotency_key=None, **kwargs):
"""
Submit details for a payment
"""
endpoint = self.baseUrl + "/payments/details"
endpoint = self.baseUrl + f"/payments/details"

Check warning on line 52 in Adyen/services/checkout/payments_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z-W63pryTICbPvx&open=AZ0K0z-W63pryTICbPvx&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def sessions(self, request, idempotency_key=None, **kwargs):
"""
Create a payment session
"""
endpoint = self.baseUrl + "/sessions"
endpoint = self.baseUrl + f"/sessions"

Check warning on line 60 in Adyen/services/checkout/payments_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z-W63pryTICbPvy&open=AZ0K0z-W63pryTICbPvy&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

27 changes: 9 additions & 18 deletions Adyen/services/checkout/recurring_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,35 @@
self.service = "checkout"
self.baseUrl = "https://checkout-test.adyen.com/v71"

def delete_token_for_stored_payment_details(
self, storedPaymentMethodId, idempotency_key=None, **kwargs
):
def delete_token_for_stored_payment_details(self, storedPaymentMethodId, idempotency_key=None, **kwargs):

Check warning on line 16 in Adyen/services/checkout/recurring_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "storedPaymentMethodId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z_L63pryTICbPvz&open=AZ0K0z_L63pryTICbPvz&pullRequest=460
"""
Delete a token for stored payment details
"""
endpoint = self.baseUrl + f"/storedPaymentMethods/{storedPaymentMethodId}"
method = "DELETE"
return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def forward(self, request, idempotency_key=None, **kwargs):
"""
Forward stored payment details
"""
endpoint = self.baseUrl + "/forward"
endpoint = self.baseUrl + f"/forward"

Check warning on line 28 in Adyen/services/checkout/recurring_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z_L63pryTICbPv0&open=AZ0K0z_L63pryTICbPv0&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def get_tokens_for_stored_payment_details(self, idempotency_key=None, **kwargs):
"""
Get tokens for stored payment details
"""
endpoint = self.baseUrl + "/storedPaymentMethods"
endpoint = self.baseUrl + f"/storedPaymentMethods"

Check warning on line 36 in Adyen/services/checkout/recurring_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z_L63pryTICbPv1&open=AZ0K0z_L63pryTICbPv1&pullRequest=460
method = "GET"
return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def stored_payment_methods(self, request, idempotency_key=None, **kwargs):
"""
Create a token to store payment details
"""
endpoint = self.baseUrl + "/storedPaymentMethods"
endpoint = self.baseUrl + f"/storedPaymentMethods"

Check warning on line 44 in Adyen/services/checkout/recurring_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z_L63pryTICbPv2&open=AZ0K0z_L63pryTICbPv2&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

25 changes: 9 additions & 16 deletions Adyen/services/checkout/utility_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,33 @@
"""
Get an Apple Pay session
"""
endpoint = self.baseUrl + "/applePay/sessions"
endpoint = self.baseUrl + f"/applePay/sessions"

Check warning on line 20 in Adyen/services/checkout/utility_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z_r63pryTICbPv3&open=AZ0K0z_r63pryTICbPv3&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def origin_keys(self, request, idempotency_key=None, **kwargs):
"""
Create originKey values for domains

Deprecated since Adyen Checkout API v67
"""
endpoint = self.baseUrl + "/originKeys"
endpoint = self.baseUrl + f"/originKeys"

Check warning on line 30 in Adyen/services/checkout/utility_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z_r63pryTICbPv4&open=AZ0K0z_r63pryTICbPv4&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def updates_order_for_paypal_express_checkout(self, request, idempotency_key=None, **kwargs):
"""
Updates the order for PayPal Express Checkout
"""
endpoint = self.baseUrl + "/paypal/updateOrder"
endpoint = self.baseUrl + f"/paypal/updateOrder"

Check warning on line 38 in Adyen/services/checkout/utility_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z_r63pryTICbPv5&open=AZ0K0z_r63pryTICbPv5&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def validate_shopper_id(self, request, idempotency_key=None, **kwargs):
"""
Validates shopper Id
"""
endpoint = self.baseUrl + "/validateShopperId"
endpoint = self.baseUrl + f"/validateShopperId"

Check warning on line 46 in Adyen/services/checkout/utility_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0z_r63pryTICbPv6&open=AZ0K0z_r63pryTICbPv6&pullRequest=460
method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Loading