Hallo everybody,
i want to search for some people who wants to help to develop a new library for B4A which should wrap the Android SDK from Paypal.
Actually i just build the library with some hardcoded info to imitate the "Make your first call" tutorial from Paypal
See the result-video running this B4A-Code
i want to search for some people who wants to help to develop a new library for B4A which should wrap the Android SDK from Paypal.
Actually i just build the library with some hardcoded info to imitate the "Make your first call" tutorial from Paypal
See the result-video running this B4A-Code
B4X:
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 = "xxxxx_CFEUvb_xGkJziy-UzOW9VJ2f1gbjC111gnyNhHq"
Dim ppSecret As String = "xxxxx_Nc5sqPjn2pcBUaD5awwioTSGZAkpTCLpmSE5qkTCvLfMB"
Dim ppMerchant As String = "DonManfred"
Dim ppPrivaryURL As String = "http://paypal.basic4android.de/"
Dim ppAgreementURL As String = "http://paypal.basic4android.de/"
Private pplogo As ImageView
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")
pp.Initialize("Paypal",ppClientID,ppSecret,ppMerchant,ppPrivaryURL,ppAgreementURL)
End Sub
Sub Activity_Resume
pp.StartSvc
End Sub
Sub Activity_Pause (UserClosed As Boolean)
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
Sub pplogo_Click
pp.NewPayment("0.10","EUR","Brand new jeans","12345",True)
End Sub
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
Activity.RESULT_OK =-1
Paypal_PaymentResult (-1, {
"client": {
"environment": "mock",
"paypal_sdk_version": "2.8.2",
"platform": "Android",
"product_name": "PayPal-Android-SDK"
},
"response": {
"create_time": "2014-07-18T18:46:55Z",
"id": "PAY-6PU626847B294842SKPEWXHY",
"intent": "sale",
"state": "approved"
},
"response_type": "payment"
},{
"amount": "0.10",
"currency_code": "EUR",
"short_description": "Brand new jeans",
"intent": "sale"
})
** Activity (main) Resume **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
Activity.RESULT_OK =-1
Paypal_PaymentResult (-1, {
"client": {
"environment": "mock",
"paypal_sdk_version": "2.8.2",
"platform": "Android",
"product_name": "PayPal-Android-SDK"
},
"response": {
"create_time": "2014-07-18T18:46:55Z",
"id": "PAY-6PU626847B294842SKPEWXHY",
"intent": "sale",
"state": "approved"
},
"response_type": "payment"
},{
"amount": "0.10",
"currency_code": "EUR",
"short_description": "Brand new jeans",
"intent": "sale"
})
** Activity (main) Resume **