diff --git a/src/FuturePayService.ts b/src/FuturePayService.ts index 99df67d..1e2a999 100644 --- a/src/FuturePayService.ts +++ b/src/FuturePayService.ts @@ -7,7 +7,7 @@ export class FuturePayService { this.url = isTestEnvironment ? "https://secure-test.worldpay.com/wcc/purchase" : "https://secure.worldpay.com/wcc/purchase"; } - initiateAgreement(agreement: Agreement): Promise { + initiateAgreement(agreement: Agreement, callbackUrl: string | null = null): Promise { var formInputsHtml = ""; for (var key in agreement) { @@ -16,6 +16,10 @@ export class FuturePayService { } } + if (callbackUrl) { + formInputsHtml += ``; + } + if (document) { var form = document.createElement("form"); form.setAttribute("method", "post");