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
Thanks
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!
PayPal updated the API recently and I still could not check how different is the new integration code!
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.
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 -->Hope this helps
<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¤cy=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]
Best regards Dieter
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)?
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)?
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
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.