PayPal MPL library

GMan

Well-Known Member
Licensed User
Longtime User
Hoi Erel,
where i can find "this" key, means: where can i find MY key ?
B4X:
APP-80W284485P519543T
 

GMan

Well-Known Member
Licensed User
Longtime User
Got it...but no PopUp appears for logging in.
I added also the part in the manifest editor:
B4X:
'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.

Nor with the Sandbox neither with the live-id.
The button appears after a second or so, but pressing it gives no result.
 
Last edited:

GMan

Well-Known Member
Licensed User
Longtime User
P.S.: i am using Android 4.2.2
 

GMan

Well-Known Member
Licensed User
Longtime User
Hoi Erel,

here it's in a .ZIPper

As it's in german yet - on the start tap the DB logo, then call the menu and select SPENDE (=Donation)
And after selecting one or more locos you may call the AKTIVLISTENMENU - that should be the list with the active (means) running locos...
 

Attachments

  • BZE.zip
    448.9 KB · Views: 219
Last edited:

GMan

Well-Known Member
Licensed User
Longtime User
What is missing ?
I exported the zip from the IDE 'cause thought that would be OK
The List COULD be the locolist.txt...i saved it manually in a folder on internal SD car named BZW
 

Avansys

Member
Licensed User
Longtime User
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?
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?
 

Avansys

Member
Licensed User
Longtime User
I'm sorry I saw that a new version was realised, but I didn't pay attention for it, yesterday I dowloaded the lastest version and the problem dissapear.
Thanks.
 

Avansys

Member
Licensed User
Longtime User
Can I use an activity as a service?, because when paypal activity is executed, if the current activity is paused, paypal's events aren't executed
 

luke2012

Well-Known Member
Licensed User
Longtime User
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:
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, "[email protected]", "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 first step is to initialize the PayPal object.
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:

SS-2013-06-02_12.57.44.png


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.

B4X:
pp.Initialize("APP-80W284485P519543T", True, "paypal")

The code on the right of the APP- string is the PayPal app id?
I mead we have to create a paypal app ?
 

luke2012

Well-Known Member
Licensed User
Longtime User
Yes, the first parameter is the AppId you get from PayPal.

I created the app and paypal return this informations :

Sandbox ID: APP-80W284485P519543T
Live App ID: ---
Status: Open

Is this correct ? I have to use the Sandbox ID ?
 

GMan

Well-Known Member
Licensed User
Longtime User
Hoi, if your are still in TEST-Mode(=Sandbox) then YES
 
Top