requestPayment method
void
requestPayment({
- Payload? payload,
- BootpayDefaultCallback? onError,
- BootpayDefaultCallback? onCancel,
- BootpayCloseCallback? onClose,
- BootpayDefaultCallback? onIssued,
- BootpayConfirmCallback? onConfirm,
- BootpayAsyncConfirmCallback? onConfirmAsync,
- BootpayDefaultCallback? onDone,
Implementation
void requestPayment({
Payload? payload,
BootpayDefaultCallback? onError,
BootpayDefaultCallback? onCancel,
BootpayCloseCallback? onClose,
BootpayDefaultCallback? onIssued,
BootpayConfirmCallback? onConfirm,
BootpayAsyncConfirmCallback? onConfirmAsync,
BootpayDefaultCallback? onDone,
}) {
if(onError != null) this.onError = onError;
if(onCancel != null) this.onCancel = onCancel;
if(onClose != null) this.onClose = onClose;
if(onIssued != null) this.onIssued = onIssued;
if(onConfirm != null) this.onConfirm = onConfirm;
if(onConfirmAsync != null) this.onConfirmAsync = onConfirmAsync;
if(onDone != null) this.onDone = onDone;
if(payload != null) this.payload = payload;
String script = "BootpayWidget.requestPayment(" +
"${this.payload?.toString()}" +
")" +
".then( function (res) {" +
confirm +
issued +
done +
"}, function (res) {" +
error +
cancel +
"})";
print(script);
_controller.runJavaScript(
script
);
}