Android Question B4A application integration with 3rd party apps

teddybear

Well-Known Member
Licensed User
Anything is possible, it is too diffcult to achieve this goal with a pure b4a coding. but it is easy to compile the sdk to aar using AS.
The aar is attached.
It should work, this is the screenshot of the sample app
Screenshot_20250510-235350.png
 

Attachments

  • till-sdk-0.9.23.zip
    61 KB · Views: 84
Upvote 0

Pantelis Loizou

Member
Licensed User
Longtime User
hi again. is it possible to send me a sample how to use .aar file and how to call authorized transaction. i didn't managed to do it. i will appreciated any help. thanks in advance
 
Upvote 0

teddybear

Well-Known Member
Licensed User
hi again. is it possible to send me a sample how to use .aar file and how to call authorized transaction. i didn't managed to do it. i will appreciated any help. thanks in advance
The sample is from https://github.com/wallee-payment/android-till-sample-app, it was built with the aar on the AS.
How to use aar? as aeric said at post#2, you can refer to the https://www.b4x.com/android/forum/t...onaljar-and-javaobject-picasso.40904/#content.
Java:
   protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.authorize_transaction_activity);

        final EditText amountField = findViewById(R.id.editTextAmount);
        final EditText currencyField = findViewById(R.id.editTextCurrency);
        final CheckBox shouldReserve = findViewById(R.id.shouldReserve);

        findViewById(R.id.authorizeButton).setOnClickListener(view -> {
            String amountString = amountField.getText().toString();
            String currencyString = currencyField.getText().toString();

            List<LineItem> lineItems = new LineItem.ListBuilder("foo", new BigDecimal(amountString))
                    .getCurrent()
                    .setName("bar")
                    .getListBuilder()
                    .build();

            Transaction transaction = new Transaction.Builder(lineItems)
                    .setCurrency(Currency.getInstance(currencyString))
                    .setInvoiceReference("1")
                    .setMerchantReference("MREF-123")
                    .setTransactionProcessingBehavior(
                            shouldReserve.isChecked() ? TransactionProcessingBehavior.RESERVE : TransactionProcessingBehavior.COMPLETE_IMMEDIATELY
                    )
                    .build();

            try {
                client.authorizeTransaction(transaction);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });

        findViewById(R.id.returnButton).setOnClickListener(view -> finish());

        client = new ApiClient(new MockResponseHandler(this));
        client.bind(this);
    }
The code is simple, you just need to translate it into javaobject of the b4a.
The key job is you need to understand how wallee payment works
 
Upvote 0
Top