/http://www.extrafeatures.ca/wp-content/uploads/powerpress/ExtraFeatureslogo-607.jpg)
Extra Features
Extra Features
Extra Features Interview Brandon Rhiness about his film Gortesque 2
SEP 20, 202631 MIN
/http://www.extrafeatures.ca/wp-content/uploads/powerpress/ExtraFeatureslogo-607.jpg)
Description
.wpedon-container .wpedon-select,
.wpedon-container .wpedon-input {
width: 300px;
min-width: 300px;
max-width: 300px;
}
.wpedon-paypal-button-container > *,
.wpedon-paypal-hosted-fields-container .wpedon-paypal-btn,
.wpedon-form .wpedon-or {
width: 300px;
min-width: 300px;
max-width: 300px;
}
.wpedon-paypal-hosted-fields-container .wpedon-paypal-btn {
height: 40px;
}
const wpedonPaypalFunding = ["paypal"];
const message_e4b690e5f767392536132b5eef83d00a = document.getElementById('wpedon-paypal-message-e4b690e5f767392536132b5eef83d00a');
if ( typeof paypal === 'undefined' ) {
message_e4b690e5f767392536132b5eef83d00a.innerHTML = '' +
'An error occurred while connecting PayPal SDK. Check the plugin settings.' + '';
throw 'An error occurred while connecting PayPal SDK. Check the plugin settings.';
}
paypal.getFundingSources().forEach(function (fundingSource) {
if ( wpedonPaypalFunding.indexOf(fundingSource) > -1 ) {
const style = {
shape: 'rect',
label: 'donate',
height: 40 };
if ( fundingSource !== 'card' ) {
let color = 'gold';
if (fundingSource === 'venmo' && color === 'gold') {
color = 'blue';
} else if (['ideal', 'bancontact', 'giropay', 'eps', 'sofort', 'mybank', 'p24'].indexOf(fundingSource) > -1 && ['gold', 'blue'].indexOf(color) > -1) {
color = 'default';
} else if (fundingSource === 'credit' && ['darkblue', 'black', 'white'].indexOf(color) === -1) {
color = 'darkblue';
}
style.color = color;
}
const button = paypal.Buttons({
fundingSource: fundingSource,
style: style,
createOrder: function() {
message_e4b690e5f767392536132b5eef83d00a.innerHTML = '';
const form = document.getElementById('e4b690e5f767392536132b5eef83d00a');
const formData = new FormData(form);
formData.append('action', 'wpedon-ppcp-order-create');
formData.append('nonce', wpedon.nonce);
return fetch(wpedon.ajaxUrl, {
method: 'post',
body: formData
}).then(function(response) {
return response.json();
}).then(function(data) {
let orderID = false;
if (data.success && data.data.order_id) {
orderID = data.data.order_id;
} else {
throw data.data && data.data.message ? data.data.message : 'An unknown error occurred while creating the order. Please reload the page and try again.';
}
return orderID;
});
},
onApprove: function(data) {
const formData = new FormData();
formData.append('action', 'wpedon-ppcp-order-finalize');
formData.append('nonce', wpedon.nonce);
formData.append('order_id', data.orderID);
return fetch(wpedon.ajaxUrl, {
method: 'post',
body: formData
}).then(function(response) {
return response.json();
}).then(function(data) {
if (data.success) {
var return_url = '';
if (return_url.length) {
window.location.href = return_url;
} else {
message_e4b690e5f767392536132b5eef83d00a.innerHTML = '' +
'The payment was successful' + '';
}
} else {
throw data.data.message;
}
});
},
onCancel: function() {
if (wpedon.cancel.length && fundingSource !== 'card') {
window.location.href = wpedon.cancel;
} else {
message_e4b690e5f767392536132b5eef83d00a.innerHTML = '' +
'The payment was cancelled.' + '';
}
},
onError: function (error) {
message_e4b690e5f767392536132b5eef83d00a.innerHTML = '' + (error ? error : 'Site admin, an error was detected in the plugin settings.Please check the PayPal connection and product settings (price, name, etc.)') + '';
}
});
if (button.isEligible()) {
button.render('#wpedon-paypal-button-container-e4b690e5f767392536132b5eef83d00a');
}
}
});
The post Extra Features Interview Brandon Rhiness about his film Gortesque 2 appeared first on Extra Features.

