Zollartikel, EZA Import, Tariff
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports Newtonsoft.Json
|
||||
Imports System.Net.Http
|
||||
Imports System.Net.Http.Headers
|
||||
|
||||
Public Class cWiseBankApi
|
||||
' {
|
||||
@@ -91,12 +93,17 @@ Public Class cWiseBankApi
|
||||
|
||||
|
||||
|
||||
Private ReadOnly apiToken As String '245a89e8-b8e3-4ceb-8326-ad7cd4d19eda
|
||||
Private Shared BASE_URL As String = "https://api.wise.com"
|
||||
|
||||
Private Shared API_TOKEN As String = "245a89e8-b8e3-4ceb-8326-ad7cd4d19eda"
|
||||
Private ReadOnly profileId As String '
|
||||
Private ReadOnly balanceId As String
|
||||
'AVISO
|
||||
Sub New()
|
||||
|
||||
End Sub
|
||||
Public Sub New(token As String, profile As String, balance As String)
|
||||
apiToken = token
|
||||
API_TOKEN = token
|
||||
profileId = profile
|
||||
balanceId = balance
|
||||
End Sub
|
||||
@@ -124,7 +131,7 @@ Public Class cWiseBankApi
|
||||
|
||||
Dim request As HttpWebRequest = CType(WebRequest.Create(url), HttpWebRequest)
|
||||
request.Method = "GET"
|
||||
request.Headers.Add("Authorization", "Bearer " & apiToken)
|
||||
request.Headers.Add("Authorization", "Bearer " & API_TOKEN)
|
||||
|
||||
Try
|
||||
Using response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
|
||||
@@ -140,4 +147,46 @@ Public Class cWiseBankApi
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
'
|
||||
'Public Shared Async Function CreatePaymentLinkAsync(
|
||||
' profileId As Long,
|
||||
' amount As Decimal,
|
||||
' currency As String,
|
||||
' description As String,
|
||||
' reference As String,
|
||||
' redirectUrl As String
|
||||
') As Task(Of String)
|
||||
|
||||
' Using client As New HttpClient()
|
||||
' client.BaseAddress = New Uri(BASE_URL)
|
||||
' client.DefaultRequestHeaders.Authorization =
|
||||
' New AuthenticationHeaderValue("Bearer", API_TOKEN)
|
||||
|
||||
' Dim body = New With {
|
||||
' .profileId = profileId,
|
||||
' .amount = New With {
|
||||
' .value = amount,
|
||||
' .currency = currency
|
||||
' },
|
||||
' .description = description,
|
||||
' .reference = reference,
|
||||
' .redirectUrl = redirectUrl
|
||||
' }
|
||||
|
||||
' Dim json = JsonConvert.SerializeObject(body)
|
||||
' Dim content = New StringContent(json, Encoding.UTF8, "application/json")
|
||||
|
||||
' Dim response = Await client.PostAsync("/v1/payment-requests", content)
|
||||
' Dim responseContent = Await response.Content.ReadAsStringAsync()
|
||||
|
||||
' If Not response.IsSuccessStatusCode Then
|
||||
' Throw New Exception("Wise API Error: " & responseContent)
|
||||
' End If
|
||||
|
||||
' Return responseContent
|
||||
' End Using
|
||||
|
||||
'End Function '
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user