Passing on a case number in the JavaScript code

BenoitGauthier
Contributor
Contributor

Based on what I found online, I wrote the following JavaScript code to pop up a Paypal window requesting a specific amount. I also want to pass along the case number in my database so that I can later connect the payment with the case. Is this the right way to do it? Thanks in advance.

 

<script src="https://www.paypal.com/sdk/js?client-id=XXXXXXXXXXX"></script>
<div id="PaypalButtons"></div>
<script>
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
custom: "MY_DATABASE_CASE_NUMBER",
amount: {
value: "TOTALBILL"
}
}]
});
}
}).render('#PaypalButtons');
</script>

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.