def _get_test_client(): # type: () -> blockchyp.Client config = _get_test_config() client = blockchyp.Client( api_key=config["apiKey"], bearer_token=config["bearerToken"], signing_key=config["signingKey"], ) client.gateway_url = config.get("gatewayHost") client.gateway_test_url = config.get("testGatewayHost") return client
import os import blockchyp # initialize a client. client = blockchyp.Client( api_key=os.environ["BC_API_KEY"], bearer_token=os.environ["BC_BEARER_TOKEN"], signing_key=os.environ["BC_SIGNING_KEY"], ) # populate request parameters. request = { "linkCode": "Payment link code to cancel", } # run the transaction. response = client.cancel_payment_link(request) print("Response: %r" % response)