inttegro.resources.spec

Generated public typing surface. Do not edit by hand.

 1"""Spec resource for retrieving API specifications and supported values."""
 2
 3from __future__ import annotations
 4
 5from ..http_client import HttpClient
 6
 7
 8class Spec:
 9    """
10    Spec resource for retrieving supported countries, currencies, and API specifications.
11
12    The Spec resource provides reference data about what Inttegro supports including
13    available countries, currencies, payment methods per country, and mobile money
14    issuers. Use this to build dynamic forms, validate user input, or display
15    available options.
16
17    See https://studio.inttegro.com/api/spec for detailed documentation.
18    """
19
20    def __init__(self, http: HttpClient):
21        """Initialize Spec resource with HTTP client."""
22        self.http = http
23
24    def countries(self):
25        """
26        Retrieve the list of supported countries and their specifications.
27
28        Returns detailed information about each country Inttegro supports including
29        available currencies, payment methods, mobile money issuers, and other
30        country-specific configuration.
31
32        Returns:
33            domain object containing:
34                - countries: List of country objects with:
35                    - code: ISO 3166-1 alpha-2 country code (e.g., "GH")
36                    - name: Country name
37                    - currencies: Supported currency codes
38                    - payment_methods: Available payment types
39                    - mobile_money: Mobile money issuer details (if available)
40                    - banks: Bank information (if available)
41
42        Example:
43            ```python
44            # Get all supported countries
45            result = client.spec.countries()
46            countries = result
47
48            for country in countries:
49                print(f"{country['name']} ({country['code']})")
50                print(f"  Currencies: {', '.join(country['currencies'])}")
51                print(f"  Payment methods: {', '.join(country['payment_methods'])}")
52
53            # Build country selector
54            def get_country_options():
55                result = client.spec.countries()
56                return [
57                    {"code": c["code"], "name": c["name"]}
58                    for c in result
59                ]
60
61            # Get mobile money issuers for Ghana
62            result = client.spec.countries()
63            ghana = next(c for c in result if c["code"] == "GH")
64            issuers = ghana.get("mobile_money", {}).get("issuers", [])
65            print(f"Ghana mobile money: {issuers}")
66            ```
67
68        Use Cases:
69            - Building country/currency selectors in forms
70            - Validating user-selected payment methods
71            - Displaying available options based on customer location
72            - Dynamic form generation
73
74        See Also:
75            - https://studio.inttegro.com/api/spec/countries
76        """
77        return self.http.post("/spec/countries", {})
class Spec:
 9class Spec:
10    """
11    Spec resource for retrieving supported countries, currencies, and API specifications.
12
13    The Spec resource provides reference data about what Inttegro supports including
14    available countries, currencies, payment methods per country, and mobile money
15    issuers. Use this to build dynamic forms, validate user input, or display
16    available options.
17
18    See https://studio.inttegro.com/api/spec for detailed documentation.
19    """
20
21    def __init__(self, http: HttpClient):
22        """Initialize Spec resource with HTTP client."""
23        self.http = http
24
25    def countries(self):
26        """
27        Retrieve the list of supported countries and their specifications.
28
29        Returns detailed information about each country Inttegro supports including
30        available currencies, payment methods, mobile money issuers, and other
31        country-specific configuration.
32
33        Returns:
34            domain object containing:
35                - countries: List of country objects with:
36                    - code: ISO 3166-1 alpha-2 country code (e.g., "GH")
37                    - name: Country name
38                    - currencies: Supported currency codes
39                    - payment_methods: Available payment types
40                    - mobile_money: Mobile money issuer details (if available)
41                    - banks: Bank information (if available)
42
43        Example:
44            ```python
45            # Get all supported countries
46            result = client.spec.countries()
47            countries = result
48
49            for country in countries:
50                print(f"{country['name']} ({country['code']})")
51                print(f"  Currencies: {', '.join(country['currencies'])}")
52                print(f"  Payment methods: {', '.join(country['payment_methods'])}")
53
54            # Build country selector
55            def get_country_options():
56                result = client.spec.countries()
57                return [
58                    {"code": c["code"], "name": c["name"]}
59                    for c in result
60                ]
61
62            # Get mobile money issuers for Ghana
63            result = client.spec.countries()
64            ghana = next(c for c in result if c["code"] == "GH")
65            issuers = ghana.get("mobile_money", {}).get("issuers", [])
66            print(f"Ghana mobile money: {issuers}")
67            ```
68
69        Use Cases:
70            - Building country/currency selectors in forms
71            - Validating user-selected payment methods
72            - Displaying available options based on customer location
73            - Dynamic form generation
74
75        See Also:
76            - https://studio.inttegro.com/api/spec/countries
77        """
78        return self.http.post("/spec/countries", {})

Spec resource for retrieving supported countries, currencies, and API specifications.

The Spec resource provides reference data about what Inttegro supports including available countries, currencies, payment methods per country, and mobile money issuers. Use this to build dynamic forms, validate user input, or display available options.

See https://studio.inttegro.com/api/spec for detailed documentation.

Spec(http: inttegro.http_client.HttpClient)
21    def __init__(self, http: HttpClient):
22        """Initialize Spec resource with HTTP client."""
23        self.http = http

Initialize Spec resource with HTTP client.

http
def countries( self) -> dict[str, inttegro.shared.CountrySpecification]:
25    def countries(self):
26        """
27        Retrieve the list of supported countries and their specifications.
28
29        Returns detailed information about each country Inttegro supports including
30        available currencies, payment methods, mobile money issuers, and other
31        country-specific configuration.
32
33        Returns:
34            domain object containing:
35                - countries: List of country objects with:
36                    - code: ISO 3166-1 alpha-2 country code (e.g., "GH")
37                    - name: Country name
38                    - currencies: Supported currency codes
39                    - payment_methods: Available payment types
40                    - mobile_money: Mobile money issuer details (if available)
41                    - banks: Bank information (if available)
42
43        Example:
44            ```python
45            # Get all supported countries
46            result = client.spec.countries()
47            countries = result
48
49            for country in countries:
50                print(f"{country['name']} ({country['code']})")
51                print(f"  Currencies: {', '.join(country['currencies'])}")
52                print(f"  Payment methods: {', '.join(country['payment_methods'])}")
53
54            # Build country selector
55            def get_country_options():
56                result = client.spec.countries()
57                return [
58                    {"code": c["code"], "name": c["name"]}
59                    for c in result
60                ]
61
62            # Get mobile money issuers for Ghana
63            result = client.spec.countries()
64            ghana = next(c for c in result if c["code"] == "GH")
65            issuers = ghana.get("mobile_money", {}).get("issuers", [])
66            print(f"Ghana mobile money: {issuers}")
67            ```
68
69        Use Cases:
70            - Building country/currency selectors in forms
71            - Validating user-selected payment methods
72            - Displaying available options based on customer location
73            - Dynamic form generation
74
75        See Also:
76            - https://studio.inttegro.com/api/spec/countries
77        """
78        return self.http.post("/spec/countries", {})

Retrieve the list of supported countries and their specifications.

Returns detailed information about each country Inttegro supports including available currencies, payment methods, mobile money issuers, and other country-specific configuration.

Returns:

domain object containing: - countries: List of country objects with: - code: ISO 3166-1 alpha-2 country code (e.g., "GH") - name: Country name - currencies: Supported currency codes - payment_methods: Available payment types - mobile_money: Mobile money issuer details (if available) - banks: Bank information (if available)

Example:
# Get all supported countries
result = client.spec.countries()
countries = result

for country in countries:
    print(f"{country['name']} ({country['code']})")
    print(f"  Currencies: {', '.join(country['currencies'])}")
    print(f"  Payment methods: {', '.join(country['payment_methods'])}")

# Build country selector
def get_country_options():
    result = client.spec.countries()
    return [
        {"code": c["code"], "name": c["name"]}
        for c in result
    ]

# Get mobile money issuers for Ghana
result = client.spec.countries()
ghana = next(c for c in result if c["code"] == "GH")
issuers = ghana.get("mobile_money", {}).get("issuers", [])
print(f"Ghana mobile money: {issuers}")
Use Cases:
  • Building country/currency selectors in forms
  • Validating user-selected payment methods
  • Displaying available options based on customer location
  • Dynamic form generation
See Also: