Hi Friends
Am facing a little trouble with ARB. I was able tocreate ARB subscription code in ASP.NET (VB) using ARB SOAP webserivice. Am getting ARBCreateSubscriptionResponseType as OK. That means it successfully created the subscription I believe. But when I get into my test account control pannel (Sandbox), there is not subscription is showing. But if the above create suscription code is OK, something should be display there.. isnt it? But 0 subscription there...
I used my testaccount API ID and Transaction key. So kindly help me to find whats wrong with my code?
Thanks in advance..
Sandeep Thomas
Solved! Go to Solution.
01-29-2013 06:47 AM
you didn't assign the result
Dim sub_resp_type As New ARBCreateSubscriptionResponseType arbService.ARBCreateSubscription(m_authentication, sub_type)
01-30-2013 04:26 AM
Did it return a subscriptionID?
01-29-2013 07:04 AM
Am getting OK status. But the subscription ID I received is 0
01-29-2013 07:57 AM
Should be something there if you didn't get an error. Are you sure it call the ARBCreateSubscription method?
OK and a subscriptionID of 0 is the default values for ARBCreateSubscriptionResponseType
01-29-2013 08:09 AM - edited 01-29-2013 08:11 AM
Yes.. I am using ARBCreatSubscription with MerichantAuthenticate and SubscriptionType as parameters. Does that return OK if there is any error in the CreateSubscription request? Sorry... am only a beginner with Authorize.
01-29-2013 08:42 AM
No. it won't return ok if there is an error. Can you post your code?
01-29-2013 08:58 AM
Sure.. Here is my code...
THis is the Webservice I invoked...
https://apitest.authorize.net/soap/v1/Service.asmx
Protected Sub createSubscription()
Try
Dim arbService As New ARB.Service
Dim m_authentication As New ARB.MerchantAuthenticationType
m_authentication.name = "myAPI"
m_authentication.transactionKey = "myTkey"
arbService.AuthenticateTest(m_authentication)
Dim m_response As New ANetApiResponseType
If m_response.resultCode = 0 Then
Dim sub_type As New ARBSubscriptionType
Dim ps_type As New PaymentScheduleType
Dim ps_type_interval As New PaymentScheduleTypeInterval
Dim cr_type As New CreditCardType
Dim order_type As New OrderType
Dim cus_type As New CustomerType
Dim nameaddress_type As New NameAndAddressType
Dim pt As New PaymentType
Dim refno As String = DateTime.Now.ToString("yyyyMMddHHmmss").ToString
Dim sub_name As String = If(rb_basic.Checked, "LB", "LP") + "_" + dd_billingcycle.SelectedValue.ToString + "_" + CInt((DateTime.UtcNow - New DateTime(1970, 1, 1)).TotalSeconds).ToString
Dim timeStamp = CInt((DateTime.UtcNow - New DateTime(1970, 1, 1)).TotalSeconds)
order_type.invoiceNumber = refno
order_type.description = dd_billingcycle.SelectedValue.ToString + " Month recurring billing " + If(rb_basic.Checked, " subscription for Limitless Basic ", "Subscription for Limitless Premium ")
nameaddress_type.firstName = txt_name.Text
nameaddress_type.lastName = ""
nameaddress_type.address = txt_address.Text
nameaddress_type.company = txt_company.Text
nameaddress_type.zip = txt_zipcode.Text
ps_type_interval.unit = ARBSubscriptionUnitEnum.months
ps_type_interval.length = dd_billingcycle.SelectedValue
ps_type.interval = ps_type_interval
ps_type.startDate = DateAdd(DateInterval.Hour, 1, Now.Date)
ps_type.startDateSpecified = True
ps_type.totalOccurrences = 9999
ps_type.totalOccurrencesSpecified = True
'-----------
cr_type.cardCode = txt_cvvnumber.Text
cr_type.cardNumber = txt_cardnumber.Text.Replace(" ", "").Replace("-", "")
cr_type.expirationDate = dd_year.ToString + "-" + dd_month.ToString
'-----------
pt.Item = cr_type
'-----------
cus_type.email = txt_email.Text
cus_type.id = txt_userid.Text
'-----------
sub_type.name = sub_name
sub_type.amount = findAmount()
sub_type.amountSpecified = True
sub_type.billTo = nameaddress_type
sub_type.paymentSchedule = ps_type
sub_type.payment = pt
sub_type.order = order_type
sub_type.customer = cus_type
'--------
Dim sub_resp_type As New ARBCreateSubscriptionResponseType
arbService.ARBCreateSubscription(m_authentication, sub_type)
If sub_resp_type.resultCode = MessageTypeEnum.Ok Then
ShowInformation(sub_resp_type.subscriptionId.ToString)
Else
ShowInformation("Failure")
End If
End If
Catch ex As Exception
End Try
End Sub
01-29-2013 07:20 PM
you didn't assign the result
Dim sub_resp_type As New ARBCreateSubscriptionResponseType arbService.ARBCreateSubscription(m_authentication, sub_type)
01-30-2013 04:26 AM
Thank you very much boss.. You saved my head.. But now my code returning a failure message. So I'm trying to figure out that.. Thanks a lot again.. Expecting support later.. :)
01-31-2013 01:05 AM