Sub Globals
Private url_success As String
Private url_canceled As String
Private PayPalResult As Int = 0
End Sub
Sub Activity_Create(FirstTime As Boolean)
url_canceled = $"https://xxxxxxxxxx.de/PayPal_Result/PayPal_Cancel.html"$
url_success = $"https://xxxxxxxxxx.de/PayPal_Result/PayPal_Success.html"$
ProgressDialogShow2(Starter.language.Value("strWaitConnectPayPal"), False)
parametri_pagamento("youremail@paypalaccount", Starter.descrizione_acquisto ,"1", Starter.prezzo_acquisto, "EUR", "First Name User","Last Name User","Address User", "Zip User", "City User", "email user","phone user ", "city/region/State user")
End Sub
Sub parametri_pagamento (emailpaypal As String, ProductName_and_Info As String, Quantity As Int, Price As Double, currency As String, nome As String, cognome As String, indirizzo As String , cap As String, citta As String, emailcliente As String, telefonocliente As String, provincia As String )
'Sostituisco al numero la virgola o il punto con %2e
Dim modify_amount As String
modify_amount = Price
modify_amount = modify_amount.Replace(".","%2e")
modify_amount = modify_amount.Replace(",","%2e")
' Log(modify_amount)
WebView1.LoadUrl($"https://www.paypal.com/cgi-bin/webscr?cmd=_xclick
&business=${emailpaypal}
&item_name=${ProductName_and_Info}
&item_number=${Quantity}
&amount=${modify_amount}
¤cy_code=${currency}
&Ic=DE
&first_name=${nome}
&last_name=${cognome}
&address1=${indirizzo}
&city=${citta}
&zip=${cap}
&email=${emailcliente}
&state=${provincia}
&night_phone_b=${telefonocliente}
&cancel_return=${url_canceled}
&return=${url_success}"$)
End Sub
'The transaction was successful or not
'Result
'2 = Bezahlung erfolgreich
'1 = Bezahlung nicht erfolgreich
'0 = Bezahlung abgebrochen
Private Sub WebView1_PageFinished (Url As String)
ProgressDialogHide
'Log(Url)
If Url.Contains(url_success) Then
PayPalResult = 2
Activity.Finish
else if Url = url_canceled Then
PayPalResult = 1
Activity.Finish
End If
End Sub