Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 663 Bytes

File metadata and controls

26 lines (22 loc) · 663 Bytes

HTTPS Agent Configuration

import ssl

from binance_common.configuration import ConfigurationRestAPI
from binance_sdk_gift_card.gift_card import GiftCard
from binance_sdk_gift_card.rest_api.models import CreateASingleTokenGiftCardResponse

configuration = ConfigurationRestAPI(
    api_key="your-api-key",
    api_secret="your-api-secret",
    https_agent=ssl.create_default_context()
)
client = GiftCard(config_rest_api=configuration)

try:
    response = client.rest_api.(
        token="token_example",
        amount=1.0,
    )
    data: CreateASingleTokenGiftCardResponse = response.data()
    print(data)
except Exception as e:
    print(e)