Forums

PayPal in CF7?

liamhanks 06 Nov, 2020
I've been playing around with the new CF7, and I'm just wondering if there is a PayPal IPN integration in CF7? Do I need to validate to see it?

Thanks
Max_admin 11 Nov, 2020
Not yet, does PayPal work for you on v6 ?

PayPal updated the API recently and I still could not check how different is the new integration code!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
liamhanks 12 Nov, 2020
I wasn't aware that anything had changed. I just did a test, and yes the PayPal payment and IPN actions are still working (at least, for me) on V6. I take "Not yet" to mean that it is an intended addition that just isn't ready for V7 yet? If so, I'll look forward to its release - it's a necessary functionality for me.
iwoxx 10 Mar, 2021
Hi Max,

how is the status of the PayPal integration in CF7?

Dieter
sh-si 18 May, 2021
This is also a GO / NO-GO decision with CF7 for me.
iwoxx 18 May, 2021
1 Likes
Hi, my workaround is to put the following code in a HTML on the form and it works well for me.
Take care of your form fields you want to provide. Here in my form it is the "order_id", "overall_brutto_price".
And it submits the form after successful paying without any submit button. You can leave that out for your workflow.
<!-- Set up a container element for the button -->
<div id="paypal-button-container"></div>

<!-- Setup an external value for invoice to be used as a test for a field -->

<!-- Include the PayPal JavaScript SDK -->
<script src="https://www.paypal.com/sdk/js?client-id=sb&currency=EUR"></script>

<script>
function getOrderID() {
var order_id = document.getElementById('order_id').value;
// alert(order_id);
return order_id;
}
function getAmount() {
var overall_brutto_price = document.getElementById('overall_brutto_price').value;
var new_amount_string = overall_brutto_price.replace(/,/g, ".");
alert(new_amount_string);
return new_amount_string;
}

// Render the PayPal button into #paypal-button-container
paypal.Buttons({

// Configure environment
env: 'sandbox',
client: {
sandbox: 'your sandbox code here',
production: 'demo_production_client_id'
},

// Set up the transaction
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '' + getAmount()
},
description: 'Your order no. ' + getOrderID()
}]
});
},

// Finalize the transaction
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
// Now submit the form as the order is already paid per PayPal
jQuery('.ui.form').form('submit');
// alert('Transaction completed by ' + details.payer.name.given_name + '!');

});
}


}).render('#paypal-button-container');
</script>
[br]
Hope this helps
Best regards Dieter
liamhanks 13 Oct, 2021
Hi Dieter,
this is a really interesting solution, but what prevents the form data from being submitted directly to index.php...&event=submit, thereby bypassing the PayPal payment? Do you have code for the submit action that verifies the status of the transaction (to make sure that the payment was made before allowing the form to be submitted)?
iwoxx 13 Oct, 2021
Hi liamhanks,

the submit button is hidden when selecting Paypal and the payment method "Paypal" or "Payment in advance" is stored in the database when selected.
No payment, no goods/service ;o)! Delivery is a manual followup process step after this in my case/project!

Don't know whether this really answers your question exactly!

BR Dieter
You need to login to be able to post a reply.