-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
AdaptersEasySwitch Adapter for a mobile money provider supportEasySwitch Adapter for a mobile money provider supportHactoberfestenhancementNew feature or requestNew feature or request
Description
Tasks / Implementation Steps
Create Adapter Class
- File: easyswitch/integrators/klarna.py
- Class: KlarnaAdapter(BaseAdapter)
- Register with AdaptersRegistry.
Core Functionalities
- validate_credentials() → Validate Klarna API credentials (username, password, or API key).
- _get_access_token() → Implement authentication using Klarna’s OAuth or Basic Auth API.
- send_payment() → Initiate payment via Klarna’s /payments/v1/authorizations or similar endpoint.
- check_status() → Query payment status using Klarna’s /payments/v1/orders/{order_id} endpoint.
- refund() → Handle full/partial refunds using Klarna’s /payments/v1/orders/{order_id}/captures/{capture_id}/refunds.
- validate_webhook() and parse_webhook() → Validate and parse Klarna webhook events (signature validation and event parsing).
Transaction Normalization
- Map Klarna’s payment states (AUTHORIZED, CAPTURED, CANCELLED, REFUNDED, etc.) to EasySwitch’s TransactionStatus enum.
- Ensure consistent PaymentResponse, TransactionDetail, and TransactionStatusResponse structures.
- Currency & Region Support
- Add supported currencies such as EUR, USD, GBP, SEK, NOK, DKK.
- Define minimum and maximum transaction limits per currency.
Expected Outcome
- KlarnaAdapter integrates seamlessly with the EasySwitch SDK.
- Supports payment, status check, and refund workflows.
- Fully validated and documented according to the EasySwitch adapter pattern.
Can you please assign this task under Hacktoberfest?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
AdaptersEasySwitch Adapter for a mobile money provider supportEasySwitch Adapter for a mobile money provider supportHactoberfestenhancementNew feature or requestNew feature or request