# 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).
require 'oci'
require 'date'
# 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::ConfigFileLoader.load_config
# Initialize service client with default config file
osp_gateway_client =
OCI::OspGateway::SubscriptionServiceClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
pay_subscription_response =
osp_gateway_client.pay_subscription(
'EXAMPLE-ospHomeRegion-Value',
'ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value',
'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
OCI::OspGateway::Models::PaySubscriptionDetails.new(
subscription:
OCI::OspGateway::Models::Subscription.new(
subscription_plan_number: 'EXAMPLE-subscriptionPlanNumber-Value',
id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value',
plan_type: 'FREE_TIER',
time_start: DateTime.parse('2029-02-20T06:30:19.723Z'),
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: 'SUBMITTED',
upgrade_state_details: 'UPGRADE_ERROR',
account_type: 'PERSONAL',
tax_info:
OCI::OspGateway::Models::TaxInfo.new(
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::OspGateway::Models::CreditCardPaymentOption.new(
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: 'JCB',
last_digits: 'EXAMPLE-lastDigits-Value',
name_on_card: 'EXAMPLE-nameOnCard-Value',
time_expiration: DateTime.parse('2041-10-10T05:50:58.252Z')
)
],
payment_gateway:
OCI::OspGateway::Models::PaymentGateway.new(
merchant_defined_data:
OCI::OspGateway::Models::MerchantDefinedData.new(
promo_type: 'EXAMPLE-promoType-Value',
cloud_account_name: 'EXAMPLE-cloudAccountName-Value'
)
),
billing_address:
OCI::OspGateway::Models::Address.new(
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.parse('2019-12-28T09:48:13.058Z'),
time_personal_to_corporate_conv:
DateTime.parse('2049-12-05T14:16:19.853Z')
),
language_code: 'EXAMPLE-languageCode-Value',
email: 'EXAMPLE-email-Value'
)
)
# Get the data from response
puts "#{pay_subscription_response.data}"