-
Notifications
You must be signed in to change notification settings - Fork 431
Description
Original issue 1152 created by codenameone on 2014-07-08T16:02:44.000Z:
What steps will reproduce the problem?
calling the method
private void purchaseZooz(){
final Purchase p = Purchase.getInAppPurchase();
if (p != null) {
if (p.isManualPaymentSupported()) {
String token=p.pay(Double.parseDouble(creditOrder.getTotal()),creditOrder.getCurrency(),creditOrder.getId());
Log.p("INVOICE ID PASSED TO ZOOZ: "+creditOrder.getId());
PurchaseListener purchaseListener=new PurchaseListener(creditOrder,token,callback);
context.getApp().addPurchaseListener(purchaseListener);
} else {
Log.p("Zooz not supported");
}
} else {
Log.p("Purchase is null");
}
}
What is the expected output? What do you see instead?
I expected to receive the invoiceNumber from Zooz Server call back: this is the response I get from zooz from the server is attached.
from ZoozPurchase android port there is no where the invoice is mentioned:
// ZOOZMARKER_START
@OverRide
public String pay(double amount, String currency) {
Intent intent = new Intent(activity, CheckoutActivity.class);
String zoozAppKey = Display.getInstance().getProperty("ZoozAppKey", "");
boolean isSandBox = Display.getInstance().getProperty("ZoozSandBox", "true").equals("true");
// send merchant credential, app_key as given in the registration
intent.putExtra(CheckoutActivity.ZOOZ_APP_KEY, zoozAppKey);
intent.putExtra(CheckoutActivity.ZOOZ_AMOUNT, amount);
intent.putExtra(CheckoutActivity.ZOOZ_CURRENCY_CODE, currency);
intent.putExtra(CheckoutActivity.ZOOZ_IS_SANDBOX, isSandBox);
// start ZooZCheckoutActivity and wait to the activity result.
activity.startActivityForResult(intent, ZOOZ_PAYMENT);
Display.getInstance().invokeAndBlock(this);
// use call serially so the purchase callback happens on the
// next EDT loop AFTER the value was returned
Display.getInstance().callSerially(new Runnable() {
@Override
public void run() {
CodenameOneActivity cn = (CodenameOneActivity)activity;
PurchaseCallback pc = cn.getPurchaseCallback();
if(pc != null) {
if(failMessage != null) {
pc.paymentFailed(purchaseId, failMessage);
} else {
pc.paymentSucceeded(purchaseId, ZoozPurchase.this.amount, ZoozPurchase.this.currency);
}
}
}
});
return purchaseId;
}
In fact from the codenamone purchase class this is ignored:
public String pay(double amount, String currency, String invoiceNumber) {
return pay(amount, currency);
}
there needs to be a way to pass the invoiceNumber, very Important!! and additional invoice items for this class to be very useful for ecommerce applications, otherwise its just as useful for donations.
Please fix!
What version of the product are you using? On what operating system?
OSX
Please provide any additional information below.
Tested on ANDROID 4.3 GALAXY S3 I9300