B4J Question [ABMaterial] Paypal

alwaysbusy

Expert
Licensed User
Longtime User
Not yet. Maybe one day we have an ABMPayPal object. I have done something with PayPal (my donation button in the demo app), so this may give you a clue on how to implement it yourself.

B4X:
'Class module

Sub Class_Globals
   Dim ABMComp As ABMCustomComponent
End Sub

'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(InternalPage As ABMPage, ID As String)
   ABMComp.Initialize("ABMComp", Me, InternalPage, ID)   
End Sub

Sub ABMComp_Build(internalID As String) As String
   Return $"<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=WZA72W4ZM9TDC" target="_blank">Click here to <img src="https://www.paypalobjects.com/en_US/BE/i/btn/btn_donateCC_LG.gif" alt="Donation" /> support ABMaterial</a>"$   
End Sub

' Is useful to run some initalisation script.
Sub ABMComp_FirstRun(InternalPage As ABMPage, internalID As String)
   
   ' flush not needed, it's done in the refresh method in the lib
End Sub

' runs when a refresh is called
Sub ABMComp_Refresh(InternalPage As ABMPage, internalID As String)  

End Sub

' do the stuff needed when the object is removed
Sub ABMComp_CleanUp(InternalPage As ABMPage, internalID As String)
   
End Sub

Usage:

B4X:
Dim donButton As DonateButton
donButton.Initialize(page, "donButton")
page.Cell(6,1).AddComponent(donButton.ABMComp)
 
Upvote 0
Top