mirror of
https://github.com/valitydev/checkout.git
synced 2024-11-06 10:35:20 +00:00
added data-attribute for method-type
This commit is contained in:
parent
3d9263d29e
commit
f94f45b2e0
@ -1,7 +1,10 @@
|
||||
export default function (endpointUrl) {
|
||||
if (endpointUrl) {
|
||||
export default function (endpointUrl, method) {
|
||||
if (method !== 'GET') {
|
||||
method = 'POST';
|
||||
}
|
||||
if (endpointUrl) {
|
||||
const callbackForm = document.createElement('form');
|
||||
callbackForm.method = 'POST';
|
||||
callbackForm.method = method;
|
||||
callbackForm.action = endpointUrl;
|
||||
callbackForm.setAttribute('target', '_top');
|
||||
document.body.appendChild(callbackForm);
|
||||
|
@ -21,6 +21,8 @@ export default class InitScript {
|
||||
endpointEvents: dataSet.endpointEvents,
|
||||
endpointFailed: dataSet.endpointFailed,
|
||||
endpointSuccess: dataSet.endpointSuccess,
|
||||
endpointFailedMethod: dataSet.endpointFailedMethod,
|
||||
endpointSuccessMethod: dataSet.endpointSuccessMethod,
|
||||
buttonColor: dataSet.buttonColor,
|
||||
logo: dataSet.logo,
|
||||
name: dataSet.name,
|
||||
|
@ -50,11 +50,11 @@ ready(function () {
|
||||
} else if (message.type === 'done') {
|
||||
StateInspector.resolve(params.invoiceId);
|
||||
close();
|
||||
processingCallback(params.endpointSuccess);
|
||||
processingCallback(params.endpointSuccess, params.endpointSuccessMethod);
|
||||
} else if (message.type === 'error') {
|
||||
StateInspector.resolve(params.invoiceId);
|
||||
close();
|
||||
processingCallback(params.endpointFailed);
|
||||
processingCallback(params.endpointFailed, params.endpointFailedMethod);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user