Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim pp As Paypal
Dim ppClientID As String = "<your apps Client ID>"
Dim ppSecret As String = "<your apps Client Secret>"
Dim ppMerchant As String = "<merchantname>"
Dim ppPrivacyURL As String = "http://domain.tld/pricacypage.html"
Dim ppAgreementURL As String = "http://domain.tld/agreementpage.html"
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
' Initialize the Library in TESTMODE (NO NETWORK)
pp.Initialize("Paypal",ppClientID,ppSecret,ppMerchant,ppPrivaryURL,ppAgreementURL,"MOCK")
'
' OR initialize the Library in SANDBOX
'pp.Initialize("Paypal",ppClientID,ppSecret,ppMerchant,ppPrivaryURL,ppAgreementURL,"SANDBOX")
'
' OR initialize the library in PRODUCTION mode (live)
'pp.Initialize("Paypal",ppClientID,ppSecret,ppMerchant,ppPrivaryURL,ppAgreementURL,"SANDBOX")
End Sub
Sub Activity_Resume
' On resume the Paypal Service must be started
pp.StartSvc
End Sub
Sub Activity_Pause (UserClosed As Boolean)
' On pause the Paypal Service must be stoppted
pp.StopSvc
End Sub
Sub Paypal_PaymentResult (resultCode As Int, result As String, payment As String)
Log("Paypal_PaymentResult ("&resultCode&", "&result&","&payment&")")
Dim parser As JSONParser
parser.Initialize(result)
Dim root As Map = parser.NextObject
Dim response As Map = root.Get("response")
Dim id As String = response.Get("id")
Dim state As String = response.Get("state")
Dim create_time As String = response.Get("create_time")
Dim Intenttype As String = response.Get("intent")
Dim response_type As String = root.Get("response_type")
Dim client As Map = root.Get("client")
Dim platform As String = client.Get("platform")
Dim environment As String = client.Get("environment")
Dim product_name As String = client.Get("product_name")
Dim paypal_sdk_version As String = client.Get("paypal_sdk_version")
End Sub