Write data to a Mysql database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
I have a problem.
I followed the instructions to insert a button on my site written in php.
During the verification of the transaction I would like to write the data on my mysql. How can I do ?
I did the tests with the script:
<script>
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '0.01'
}
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name);
// Call your server to save the transaction
return fetch('/paypal-transaction-complete', {
method: 'post',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
orderID: data.orderID
})
});
});
}
}).render('#paypal-button-container');
</script>
But I don't understand how to write to my database.
You can help me.
Thank you.
Nicolò

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- What solution I need to use? in Braintree Server-side Integration (PHP, Java, .NET, Ruby, Python, NodeJS SDKs)
- Pay Pal integration with existing site code and databases required in Sandbox Environment
- Once a user uses PayPal subscription button, how do I lock/unlock content? in SDKs
- What are basic create-paypal-order and capture-paypal-order files? in REST APIs
- Using the smart button code in PayPal Payments Standard