Exemplo n.º 1
0
 def testgetsubscription(self):
     
     getSubscription = apicontractsv1.ARBGetSubscriptionRequest()
     getSubscription.merchantAuthentication = self.merchantAuthentication
     getSubscription.subscriptionId = self.__class__.createdSubscriptionId #update valid subscription id 
     getSubscriptionController = ARBGetSubscriptionController(getSubscription)
     getSubscriptionController.execute()
     response = getSubscriptionController.getresponse()
     self.assertIsNotNone(response.subscription.name)
     self.assertEquals('Ok', response.messages.resultCode) 
Exemplo n.º 2
0
 def testGetSubscription(self):
     getSubscription = apicontractsv1.ARBGetSubscriptionRequest()
     getSubscription.merchantAuthentication = self.merchantAuthentication
     subscriptionID = self.testCreateSubscription()
     getSubscription.subscriptionId = subscriptionID #update valid subscription id 
     getSubscriptionController = ARBGetSubscriptionController(getSubscription)
     getSubscriptionController.execute()
     response = getSubscriptionController.getresponse()
     if hasattr(response, 'messages') == True:
         if hasattr(response.messages, 'resultCode') == True:
             self.assertEquals('Ok', response.messages.resultCode)
Exemplo n.º 3
0
    def subscription_info(self, subscription_id):
        self.transaction = apicontractsv1.ARBGetSubscriptionRequest()
        self.transaction.merchantAuthentication = self.merchant_auth
        self.transaction.subscriptionId = str(subscription_id)
        self.transaction.includeTransactions = False

        self.controller = ARBGetSubscriptionController(self.transaction)
        self.controller.execute()

        response = self.controller.getresponse()

        return response
def get_subscription(subscriptionId):
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = constants.apiLoginId
    merchantAuth.transactionKey = constants.transactionKey

    getSubscription = apicontractsv1.ARBGetSubscriptionRequest()
    getSubscription.merchantAuthentication = merchantAuth
    getSubscription.subscriptionId = subscriptionId

    getSubscriptionController = ARBGetSubscriptionController(getSubscription)
    getSubscriptionController.execute()

    response = getSubscriptionController.getresponse()

    if (response.messages.resultCode == "Ok"):
        print("Subscription Name : %s" % response.subscription.name)
    else:
        print("response code: %s" % response.messages.resultCode)

    return response
def get_subscription(subscriptionId):
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = constants.apiLoginId
    merchantAuth.transactionKey = constants.transactionKey

    getSubscription = apicontractsv1.ARBGetSubscriptionRequest()
    getSubscription.merchantAuthentication = merchantAuth
    getSubscription.subscriptionId = subscriptionId
    getSubscription.includeTransactions = True

    getSubscriptionController = ARBGetSubscriptionController(getSubscription)
    getSubscriptionController.execute()

    response = getSubscriptionController.getresponse()

    if (response.messages.resultCode == "Ok"):
        print("Subscription Name : %s" % response.subscription.name)
        print("Subscription Amount: %s" % response.subscription.amount)
        for transaction in response.subscription.arbTransactions.arbTransaction:
            print "Transaction id: %d" % transaction.transId
    else:
        print("response code: %s" % response.messages.resultCode)

    return response
from authorizenet import apicontractsv1
from authorizenet.apicontrollers import *
from decimal import *

merchantAuth = apicontractsv1.merchantAuthenticationType()
merchantAuth.name = '5KP3u95bQpv'
merchantAuth.transactionKey = '4Ktq966gC55GAX7S'

getSubscription = apicontractsv1.ARBGetSubscriptionRequest()
getSubscription.merchantAuthentication = merchantAuth
getSubscription.subscriptionId = "2260421"

getSubscriptionController = ARBGetSubscriptionController(getSubscription)
getSubscriptionController.execute()

response = getSubscriptionController.getresponse()

if (response.messages.resultCode == "Ok"):
    print "Subscription Name : %s" % response.subscription.name
else:
    print "response code: %s" % response.messages.resultCode