cancel
Showing results for 
Search instead for 
Did you mean: 

asp.vb Setting payer adress giving error

Contributor

asp.vb Setting payer adress giving error

Hi

 

I try to put the buyer's address because the buyer has already completed it in an earlier step.
When I do, I get Object reference not set to an instance of an object.
Is it not possible to do this way?

The last line get the error.

 

        Dim _Item As PayPal.Api.Item
        Dim _Meas As New PayPal.Api.Measurement
        Dim Adr As New PayPal.Api.Address

        Adr.city = "Örsundsbro"
        Adr.postal_code = "74963"
        Adr.phone = "705884513"
        Adr.line1 = "Biskopskulla Ramsta 8"
        Adr.country_code = "SE"
        Adr.line2 = ""
        Adr.state = ""
        Adr.status = ""

        _Meas.unit = "mm"
        _Meas.value = 1
        _Item = New PayPal.Api.Item
        _Item.currency = _V
        _Item.name = "Transactions for SafeSign"
        _Item.price = _A.ToString
        _Item.tax = _Tax.ToString
        _Item.quantity = _T
        _Item.category = ""
        _Item.description = "Trackday"
        _Item.height = _Meas
        _Item.length = _Meas
        _Item.sku = "X"
        _Item.weight = _Meas
        _Item.width = _Meas

        '_Items.items(0).name = "Kalle"
        '_Items.items.Add(_Item)


        Dim transactionList As List(Of Transaction) = New List(Of Transaction)
        Dim tran As Transaction = New Transaction()
        tran.description = "Betalning för Trackday " & _A.ToString
        tran.amount = amnt
        tran.item_list = _Items

        transactionList.Add(tran)

        Dim payr As Payer = New Payer
        payr.payment_method = "paypal"
        payr.payer_info.billing_address = Adr

 

Grateful for help