<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Subscription Issues | Python SDK in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Subscription-Issues-Python-SDK/m-p/87751#M55264</link>
    <description>&lt;P&gt;&lt;SPAN&gt;The specific issues I am facing in creating subscriptions using&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/AuthorizeNet/sdk-python" target="_blank" rel="noopener"&gt;Python SDK&lt;/A&gt;&lt;SPAN&gt;.&lt;BR /&gt;The error I am getting is&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;TypeError: function takes 3 arguments plus optional tzinfo (8 given).&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;My Python version is 3.11&lt;BR /&gt;&lt;BR /&gt;The code is same as the docs:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;import os, sys&lt;BR /&gt;import imp&lt;/P&gt;&lt;P&gt;from authorizenet import apicontractsv1&lt;BR /&gt;from authorizenet.apicontrollers import *&lt;BR /&gt;constants = imp.load_source('modulename', 'constants.py')&lt;BR /&gt;from decimal import *&lt;BR /&gt;from datetime import *&lt;/P&gt;&lt;P&gt;def create_subscription(amount, days):&lt;/P&gt;&lt;P&gt;# Setting the merchant details&lt;BR /&gt;merchantAuth = apicontractsv1.merchantAuthenticationType()&lt;BR /&gt;merchantAuth.name = constants.apiLoginId&lt;BR /&gt;merchantAuth.transactionKey = constants.transactionKey&lt;BR /&gt;# Setting payment schedule&lt;BR /&gt;paymentschedule = apicontractsv1.paymentScheduleType()&lt;BR /&gt;paymentschedule.interval = apicontractsv1.paymentScheduleTypeInterval() #apicontractsv1.CTD_ANON() #modified by krgupta&lt;BR /&gt;paymentschedule.interval.length = days&lt;BR /&gt;paymentschedule.interval.unit = apicontractsv1.ARBSubscriptionUnitEnum.days&lt;BR /&gt;paymentschedule.startDate = datetime(2021, 12, 30)&lt;BR /&gt;paymentschedule.totalOccurrences = 12&lt;BR /&gt;paymentschedule.trialOccurrences = 1&lt;BR /&gt;# Giving the credit card info&lt;BR /&gt;creditcard = apicontractsv1.creditCardType()&lt;BR /&gt;creditcard.cardNumber = "4111111111111111"&lt;BR /&gt;creditcard.expirationDate = "2035-12"&lt;BR /&gt;payment = apicontractsv1.paymentType()&lt;BR /&gt;payment.creditCard = creditcard&lt;BR /&gt;# Setting billing information&lt;BR /&gt;billto = apicontractsv1.nameAndAddressType()&lt;BR /&gt;billto.firstName = "John"&lt;BR /&gt;billto.lastName = "Smith"&lt;BR /&gt;# Setting subscription details&lt;BR /&gt;subscription = apicontractsv1.ARBSubscriptionType()&lt;BR /&gt;subscription.name = "Sample Subscription"&lt;BR /&gt;subscription.paymentSchedule = paymentschedule&lt;BR /&gt;subscription.amount = amount&lt;BR /&gt;subscription.trialAmount = Decimal('0.00')&lt;BR /&gt;subscription.billTo = billto&lt;BR /&gt;subscription.payment = payment&lt;BR /&gt;# Creating the request&lt;BR /&gt;request = apicontractsv1.ARBCreateSubscriptionRequest()&lt;BR /&gt;request.merchantAuthentication = merchantAuth&lt;BR /&gt;request.subscription = subscription&lt;BR /&gt;# Creating and executing the controller&lt;BR /&gt;controller = ARBCreateSubscriptionController(request)&lt;BR /&gt;controller.execute()&lt;BR /&gt;# Getting the response&lt;BR /&gt;response = controller.getresponse()&lt;/P&gt;&lt;P&gt;if (response.messages.resultCode=="Ok"):&lt;BR /&gt;print ("SUCCESS:")&lt;BR /&gt;print ("Message Code : %s" % response.messages.message[0]['code'].text)&lt;BR /&gt;print ("Message text : %s" % str(response.messages.message[0]['text'].text))&lt;BR /&gt;print ("Subscription ID : %s" % response.subscriptionId)&lt;BR /&gt;else:&lt;BR /&gt;print ("ERROR:")&lt;BR /&gt;print ("Message Code : %s" % response.messages.message[0]['code'].text)&lt;BR /&gt;print ("Message text : %s" % response.messages.message[0]['text'].text)&lt;/P&gt;&lt;P&gt;return response&lt;/P&gt;&lt;P&gt;if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):&lt;BR /&gt;create_subscription(constants.amount, constants.days)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have set my&amp;nbsp;&lt;STRONG&gt;apiLoginId &lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;transactionKey.&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2023 06:18:07 GMT</pubDate>
    <dc:creator>anmolmonga2023</dc:creator>
    <dc:date>2023-10-09T06:18:07Z</dc:date>
    <item>
      <title>Subscription Issues | Python SDK</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Subscription-Issues-Python-SDK/m-p/87751#M55264</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The specific issues I am facing in creating subscriptions using&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/AuthorizeNet/sdk-python" target="_blank" rel="noopener"&gt;Python SDK&lt;/A&gt;&lt;SPAN&gt;.&lt;BR /&gt;The error I am getting is&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;TypeError: function takes 3 arguments plus optional tzinfo (8 given).&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;My Python version is 3.11&lt;BR /&gt;&lt;BR /&gt;The code is same as the docs:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;import os, sys&lt;BR /&gt;import imp&lt;/P&gt;&lt;P&gt;from authorizenet import apicontractsv1&lt;BR /&gt;from authorizenet.apicontrollers import *&lt;BR /&gt;constants = imp.load_source('modulename', 'constants.py')&lt;BR /&gt;from decimal import *&lt;BR /&gt;from datetime import *&lt;/P&gt;&lt;P&gt;def create_subscription(amount, days):&lt;/P&gt;&lt;P&gt;# Setting the merchant details&lt;BR /&gt;merchantAuth = apicontractsv1.merchantAuthenticationType()&lt;BR /&gt;merchantAuth.name = constants.apiLoginId&lt;BR /&gt;merchantAuth.transactionKey = constants.transactionKey&lt;BR /&gt;# Setting payment schedule&lt;BR /&gt;paymentschedule = apicontractsv1.paymentScheduleType()&lt;BR /&gt;paymentschedule.interval = apicontractsv1.paymentScheduleTypeInterval() #apicontractsv1.CTD_ANON() #modified by krgupta&lt;BR /&gt;paymentschedule.interval.length = days&lt;BR /&gt;paymentschedule.interval.unit = apicontractsv1.ARBSubscriptionUnitEnum.days&lt;BR /&gt;paymentschedule.startDate = datetime(2021, 12, 30)&lt;BR /&gt;paymentschedule.totalOccurrences = 12&lt;BR /&gt;paymentschedule.trialOccurrences = 1&lt;BR /&gt;# Giving the credit card info&lt;BR /&gt;creditcard = apicontractsv1.creditCardType()&lt;BR /&gt;creditcard.cardNumber = "4111111111111111"&lt;BR /&gt;creditcard.expirationDate = "2035-12"&lt;BR /&gt;payment = apicontractsv1.paymentType()&lt;BR /&gt;payment.creditCard = creditcard&lt;BR /&gt;# Setting billing information&lt;BR /&gt;billto = apicontractsv1.nameAndAddressType()&lt;BR /&gt;billto.firstName = "John"&lt;BR /&gt;billto.lastName = "Smith"&lt;BR /&gt;# Setting subscription details&lt;BR /&gt;subscription = apicontractsv1.ARBSubscriptionType()&lt;BR /&gt;subscription.name = "Sample Subscription"&lt;BR /&gt;subscription.paymentSchedule = paymentschedule&lt;BR /&gt;subscription.amount = amount&lt;BR /&gt;subscription.trialAmount = Decimal('0.00')&lt;BR /&gt;subscription.billTo = billto&lt;BR /&gt;subscription.payment = payment&lt;BR /&gt;# Creating the request&lt;BR /&gt;request = apicontractsv1.ARBCreateSubscriptionRequest()&lt;BR /&gt;request.merchantAuthentication = merchantAuth&lt;BR /&gt;request.subscription = subscription&lt;BR /&gt;# Creating and executing the controller&lt;BR /&gt;controller = ARBCreateSubscriptionController(request)&lt;BR /&gt;controller.execute()&lt;BR /&gt;# Getting the response&lt;BR /&gt;response = controller.getresponse()&lt;/P&gt;&lt;P&gt;if (response.messages.resultCode=="Ok"):&lt;BR /&gt;print ("SUCCESS:")&lt;BR /&gt;print ("Message Code : %s" % response.messages.message[0]['code'].text)&lt;BR /&gt;print ("Message text : %s" % str(response.messages.message[0]['text'].text))&lt;BR /&gt;print ("Subscription ID : %s" % response.subscriptionId)&lt;BR /&gt;else:&lt;BR /&gt;print ("ERROR:")&lt;BR /&gt;print ("Message Code : %s" % response.messages.message[0]['code'].text)&lt;BR /&gt;print ("Message text : %s" % response.messages.message[0]['text'].text)&lt;/P&gt;&lt;P&gt;return response&lt;/P&gt;&lt;P&gt;if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):&lt;BR /&gt;create_subscription(constants.amount, constants.days)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have set my&amp;nbsp;&lt;STRONG&gt;apiLoginId &lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;transactionKey.&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 06:18:07 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Subscription-Issues-Python-SDK/m-p/87751#M55264</guid>
      <dc:creator>anmolmonga2023</dc:creator>
      <dc:date>2023-10-09T06:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Subscription Issues | Python SDK</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Subscription-Issues-Python-SDK/m-p/87768#M55279</link>
      <description>&lt;P&gt;The specific issue I'm encountering when attempting to create subscriptions using the Python SDK is a TypeError with the following message: "TypeError: function takes 3 arguments plus optional tzinfo (8 given)." It's important to note that this error is occurring with Python version 3.11.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 06:31:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Subscription-Issues-Python-SDK/m-p/87768#M55279</guid>
      <dc:creator>pronasit</dc:creator>
      <dc:date>2023-10-11T06:31:42Z</dc:date>
    </item>
  </channel>
</rss>

