Android Question DineroMail

pesquera

Active Member
Licensed User
Longtime User
Hi all,

This is a solution for integrating my app with this payment method (its for some countries of latin america)

There is a jar file library but have no idea how can I integrate it into my App (or how to make a b4a library)

Also, before to start with this solution, I want to ask to you if you see this example as posible to do with b4a

I'm not an advanced java developer yet, but I have some knowledge of b4a

Would appreciate any info

Thanks

Here is the sample of this solution from the documentation:

B4X:
DineroMailAr dineroMailArgentina = new DineroMailAr();
dineroMailArgentina.setTool(Tool.BUTTON);
dineroMailArgentina.setMerchant("[email protected]");
dineroMailArgentina.setSellerName("Dinero Mail Integration");
ArrayList<Product> products = new ArrayList<Product>();
Product p = new Product();
p.setName("Camera Panasonic Lumix Fz35 12.1Mp");
p.setQuantity(1);
p.setAmount(10000);
p.setCurrency(Currency.ARS);
p.setShippingType(ShippingType.NOT_AVAILABLE);
p.setShippingCurrency(Currency.ARS);
products.add(p);
dineroMailArgentina.setProducts(products);
dineroMailArgentina.addPaymentMethod(PaymentMethodAr.ALL);
dineroMailArgentina.setLanguage(Language.EN);
dineroMailArgentina.setChangeQuantity(
ChangeQuantity.NO_MODIFICATION_ALLOWED);
Intent dineroMailIntent = dineroMailArgentina.checkout(this);
dineroMailIntent.putExtra(DineroMail.BUTTON_BACK_PARAM, "Go back to my app");
startActivityForResult(dineroMailIntent, 0);
Capture the callback with onActivityResult:
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (resultCode) {
case DineroMailActivity.RESULT_CANCEL:
Toast.makeText(this, "Action cancel...", Toast.LENGTH_LONG).show();
break;
case DineroMailActivity.RESULT_BACK:
Toast.makeText(this, "Action back...", Toast.LENGTH_LONG).show();
break;
case DineroMailActivity.RESULT_SUCCESS:
Toast.makeText(this, "Action success...", Toast.LENGTH_LONG).show();
break;
case DineroMailActivity.RESULT_ERROR:
Toast.makeText(this, "Action error...", Toast.LENGTH_LONG).show();
break;
}
}
 

pesquera

Active Member
Licensed User
Longtime User
Hi, SLC and the Flurry example has been so useful to me..
now I'm trying to wrap the jar library, but I have an error that don't have idea why

the java code is this:
B4X:
package com.dineromailwrapper;

import com.dineromail.android.model.DineroMail;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.Permissions;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;

@Version(1.0f)
@Permissions(values={"android.permission.INTERNET"})
@ShortName("DineroMail")
@DependsOn(values={"DineroMail"})
@ActivityObject

public class DineroMailWrapper {
    public void setMerchant(String merchant) {
        DineroMail.setMerchant(merchant);
    }
}

the error is this:
B4X:
Starting step: Compiling Java code.
javac 1.7.0_03
C:\Sistemas\Basic4Android\SimpleLibraryCompiler\DineroMail\src\com\DineroMailWrapper\DineroMailWrapper.java:22: error: non-static method setMerchant(String) cannot be referenced from a static context
        DineroMail.setMerchant(merchant);
                  ^
1 error


Error.



 
Upvote 0
Top