public static AndroidOnPayListener create(AndroidPayApi api, AndroidOrder order, PaySDKHandler handler) { AndroidOnPayListener l = new AndroidOnPayListener(); l.PayOrder = order; l.PayApi = api; l.OnPayListener = handler; return(l); }
public void payWithTicketId(string ticketId, PaySDKChannel channel, PaySDKHandler handler) { AndroidTicketOrder aOrder = new AndroidTicketOrder(); aOrder.setTicketId(ticketId); AndroidPayApi api = createPayApi(channel); AndroidOnPayListener listener = AndroidOnPayListener.create(api, aOrder, handler); api.pay(aOrder, listener); }
private static void payEndFunction(IntPtr jListener, IntPtr jOrder, IntPtr jApi, IntPtr jResult) { object l = GCNativeKeeper.getInstance().unKeep(jListener); AndroidOnPayListener callback = (AndroidOnPayListener)l; AndroidPayResult result = new AndroidPayResult(jResult); AndroidOrder order = callback.PayOrder; AndroidPayApi api = callback.PayApi; PaySDKStatus status = toPayStatus(result.getPayCode()); string ticketId = order.getTicketId(); int channelErrorCode = toInt(result.getPayChannelCode()); string channelErrorDes = result.getPayChannelMessage(); callback.onPayEnd(status, ticketId, channelErrorCode, channelErrorDes); }
public void payWithOrder(PaySDKOrder order, PaySDKChannel channel, PaySDKHandler handler) { AndroidPayOrder aOrder = new AndroidPayOrder(); aOrder.setAmount((int)order.amount); aOrder.setBody(order.body); aOrder.setDescription(order.des); aOrder.setMetadata(order.metadata); aOrder.setOrderNo(order.orderId); aOrder.setSubject(order.subject); AndroidPayApi api = createPayApi(channel); AndroidOnPayListener listener = AndroidOnPayListener.create(api, aOrder, handler); api.pay(aOrder, listener); }