# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

from datetime import datetime
import oci

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
osp_gateway_client = oci.osp_gateway.SubscriptionServiceClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
authorize_subscription_payment_response = osp_gateway_client.authorize_subscription_payment(
    osp_home_region="EXAMPLE-ospHomeRegion-Value",
    subscription_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value",
    compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
    authorize_subscription_payment_details=oci.osp_gateway.models.AuthorizeSubscriptionPaymentDetails(
        subscription=oci.osp_gateway.models.Subscription(
            subscription_plan_number="EXAMPLE-subscriptionPlanNumber-Value",
            id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
            plan_type="FREE_TIER",
            time_start=datetime.strptime(
                "2015-12-10T05:04:58.159Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            ship_to_cust_acct_site_id="ocid1.test.oc1..<unique_ID>EXAMPLE-shipToCustAcctSiteId-Value",
            ship_to_cust_acct_role_id="ocid1.test.oc1..<unique_ID>EXAMPLE-shipToCustAcctRoleId-Value",
            bill_to_cust_account_id="ocid1.test.oc1..<unique_ID>EXAMPLE-billToCustAccountId-Value",
            is_intent_to_pay=True,
            currency_code="EXAMPLE-currencyCode-Value",
            gsi_org_code="EXAMPLE-gsiOrgCode-Value",
            language_code="EXAMPLE-languageCode-Value",
            organization_id="ocid1.test.oc1..<unique_ID>EXAMPLE-organizationId-Value",
            upgrade_state="UPGRADED",
            upgrade_state_details="TAX_ERROR",
            account_type="PERSONAL",
            tax_info=oci.osp_gateway.models.TaxInfo(
                tax_payer_id="ocid1.test.oc1..<unique_ID>EXAMPLE-taxPayerId-Value",
                tax_reg_number="EXAMPLE-taxRegNumber-Value",
                no_tax_reason_code="EXAMPLE-noTaxReasonCode-Value",
                no_tax_reason_code_details="EXAMPLE-noTaxReasonCodeDetails-Value",
                tax_cnpj="EXAMPLE-taxCnpj-Value",
                giro="EXAMPLE-giro-Value"),
            payment_options=[
                oci.osp_gateway.models.CreditCardPaymentOption(
                    payment_method="CREDIT_CARD",
                    wallet_instrument_id="ocid1.test.oc1..<unique_ID>EXAMPLE-walletInstrumentId-Value",
                    wallet_transaction_id="ocid1.test.oc1..<unique_ID>EXAMPLE-walletTransactionId-Value",
                    credit_card_type="AMEX",
                    last_digits="EXAMPLE-lastDigits-Value",
                    name_on_card="EXAMPLE-nameOnCard-Value",
                    time_expiration=datetime.strptime(
                                "2049-06-11T19:31:34.041Z",
                                "%Y-%m-%dT%H:%M:%S.%fZ"))],
            payment_gateway=oci.osp_gateway.models.PaymentGateway(
                merchant_defined_data=oci.osp_gateway.models.MerchantDefinedData(
                    promo_type="EXAMPLE-promoType-Value",
                    cloud_account_name="EXAMPLE-cloudAccountName-Value")),
            billing_address=oci.osp_gateway.models.Address(
                address_key="EXAMPLE-addressKey-Value",
                line1="EXAMPLE-line1-Value",
                line2="EXAMPLE-line2-Value",
                line3="EXAMPLE-line3-Value",
                line4="EXAMPLE-line4-Value",
                street_name="EXAMPLE-streetName-Value",
                street_number="EXAMPLE-streetNumber-Value",
                city="EXAMPLE-city-Value",
                county="EXAMPLE-county-Value",
                country="EXAMPLE-country-Value",
                province="EXAMPLE-province-Value",
                postal_code="EXAMPLE-postalCode-Value",
                state="EXAMPLE-state-Value",
                email_address="EXAMPLE-emailAddress-Value",
                company_name="EXAMPLE-companyName-Value",
                first_name="EXAMPLE-firstName-Value",
                middle_name="EXAMPLE-middleName-Value",
                last_name="EXAMPLE-lastName-Value",
                phone_country_code="EXAMPLE-phoneCountryCode-Value",
                phone_number="EXAMPLE-phoneNumber-Value",
                job_title="EXAMPLE-jobTitle-Value",
                department_name="EXAMPLE-departmentName-Value",
                internal_number="EXAMPLE-internalNumber-Value",
                contributor_class="EXAMPLE-contributorClass-Value",
                state_inscription="EXAMPLE-stateInscription-Value",
                municipal_inscription="EXAMPLE-municipalInscription-Value"),
            time_plan_upgrade=datetime.strptime(
                "2025-10-23T06:14:41.416Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            time_personal_to_corporate_conv=datetime.strptime(
                "2001-02-23T07:52:50.111Z",
                "%Y-%m-%dT%H:%M:%S.%fZ")),
        language_code="EXAMPLE-languageCode-Value",
        email="EXAMPLE-email-Value"),
    if_match="EXAMPLE-ifMatch-Value",
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="PQEG67TCNILZO7UHUU9D<unique_ID>")

# Get the data from response
print(authorize_subscription_payment_response.data)