Hello,
After an exhaustive search, I've determined that there are no VB/C# code samples available for the Buttom Manager API. So, I've been 'guessing' my way around this part of the SDK and am now tired, frustrated, and at the end of my rope. Your help could actually save my sanity.
I'm attempting to use SOAP protocol in the .NET environment to do an update on Price, but with no success. The code segment below is giving me the following error in the IDE:
Value of type 'com.paypal.soap.api.OptionSelectionDetailsType' cannot be converted to '1-dimensional array of com.paypal.soap.api.OptionSelectionDetailsType'. The class members seem to support the assignment of Price but the OptionSelectionDetails and OptionDetails types are not cooperating with me.
If anyone else has figured this out, I would be ultra appreciative of a code correction (because I really don't have a Kingdom).
Sincerely,
Scott
Code:
Private Sub PayPal_UpdateButton(ByVal ButtonId As String)
Dim caller As New CallerServices
Dim profile As IAPIProfile = ProfileFactory.createSignatureAPIProfile()
profile.APIUsername = gvEbayUserName
profile.APIPassword = gvEbayPassword
profile.APISignature = gvEbaySignature
profile.Environment = "live"
caller.APIProfile = profile
' Create the request object.
Dim concreteRequest As New BMUpdateButtonRequestType()
' Add request-specific fields.
concreteRequest.HostedButtonID = ButtonId
concreteRequest.ButtonType = "BUYNOW"
Dim tODetails As New com.paypal.soap.api.OptionDetailsType
Dim tOSDetails As New com.paypal.soap.api.OptionSelectionDetailsType
tOSDetails.Price = "3.27"
tOSDetails.OptionSelection = "0"
tODetails.OptionSelectionDetails = tOSDetails 'Problem is here....
concreteRequest.OptionDetails = tODetails 'and problem is here.
' Execute the API operation and obtain the response.
Dim pp_response As New BMUpdateButtonResponseType
pp_response = DirectCast(caller.[Call]("BMUpdateButton", concreteRequest), BMUpdateButtonResponseType)
Dim SerializedContent As New StringWriter
Try
Dim x As New System.Xml.Serialization.XmlSerializer(pp_response.[GetType]())
x.Serialize(SerializedContent, pp_response)
Console.WriteLine(SerializedContent.ToString)
Catch ex As Exception
End Try
End Sub