'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="17"/>
<activity android:name="com.paypal.android.MEP.PayPalActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="keyboardHidden|orientation"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
The event that is not successful is PayPal_Ready (Success As Boolean), always in 10.1'' tablets is not successful, but if I use a 7'' tablets or a smaller device, event is successful, Some idea about why happens this problem?I have an error when I want to use my app in a 10.1'' Tablet (Always the result is fail), but when I use the same app in the same network in a smartphone the result is succesful, What happen there?
Thanks Erel, I solved my problem when I searched what happened in the follow link: http://www.b4x.com/android/forum/threads/application-restarts-when-icon-clicked.37507/#post-223336No. However the current code should work as long as the process is not killed. Can you describe what exactly happens?
This library is a wrapper for PayPal MPL SDK. Note that currently PayPal is migrating to a new SDK named Mobile SDK. The Mobile SDK is a different SDK and is only supported in the US.
PayPal MPL is considered part of PayPal Classic API and is based on the Adaptive API.
Currently only "Basic Payments" are supported.
Relevant links:
- PayPal MPL SDK: https://github.com/paypal/sdk-packa...al_MPL_1.5.5.45_Android-Developer-Package.zip (click on the Raw button).
You should download this zip file and copy PayPal_MPL.Jar from the MPL Library folder to Basic4android libraries folder.
- PayPal Java guide: https://developer.paypal.com/webapps/developer/docs/classic/mobile/ht_mpl-itemPayment-Android/
- Sandbox accounts: https://developer.paypal.com/webapps/developer/applications/accounts
It is quite simple to accept payments with PayPal library.
For example:
The first step is to initialize the PayPal object.B4X:Sub Globals Dim pp As PayPal End Sub Sub Activity_Create(FirstTime As Boolean) pp.Initialize("APP-80W284485P519543T", True, "paypal") End Sub Sub PayPal_Ready (Success As Boolean) Log("Ready: " & Success) If Success Then Activity.AddView(pp.GetPayPalButton(True), 0, 0, 200dip, 100dip) End If End Sub Sub PayPal_Click pp.RequestPayment("USD", 100, "example-facilitator@domain.com", "My Company", _ pp.PAYMENT_TYPE_SERVICE) End Sub Sub PayPal_Result (Success As Boolean, Extra As String) Log("Success: " & Success & ", Extra: " & Extra) End Sub
The Ready event is raised when the service is ready. You should then add the PayPal button.
When the user clicks on this button we make a payment request. The user will be asked for his account details:
The Result event is raised when the payment is processed (or canceled).
Extra parameter will hold the transaction key or the error message (or "canceled" for canceled transactions).
The following code should be added to the manifest editor:
B4X:AddApplicationText( <activity android:name="com.paypal.android.MEP.PayPalActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboardHidden|orientation"/>)
V1.00 - Fixes an issue with a missing permission.
pp.Initialize("APP-80W284485P519543T", True, "paypal")
Yes, the first parameter is the AppId you get from PayPal.
Hoi, if your are still in TEST-Mode(=Sandbox) then YES
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?