button code

quickone1
Contributor
Contributor

Hi .... I may be over complicating things here ... if i follow supposedly the simple process of creating a buy now button ... what tells me the payment will go to my merchant account... see code generated here   (thank you in advance):

 


<div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=sb&currency=USD" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'buynow',

},
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '67.00'
}
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
}
}).render('#paypal-button-container');
</script>

Login to Me Too
3 REPLIES 3

spidre409
Contributor
Contributor

If you output the details to the console, you can see the result of the transaction in your javascript console.

in the area where you have the alert, add the console.log(details) line after it.

alert('Transaction completed by ' + details.payer.name.given_name + '!');

console.log(details);

 

you can also display it on the page using  

JSON.stringify(details, undefined, 4));

Login to Me Too

SCAMXC
Contributor
Contributor

Please put this solution into english.  

 

I am a dinosaur.  The last PayPal button I created was over 10 years ago.  It still works but has a validation code that is well over a thousand characters long.  I'd just procure that much smaller, more efficient button, but it charges customers sales tax on a non taxable item.

 

So I generated a new button from PayPal.  Its actually a pretty ugly, three button set up.  I don't want to give credit on a small purchase.  Its all generic code, nothing to validate my account.  And it doesn't work.  It doesn't do anything.

 

I was able to generate two API codes, one of them is "secret.  I have no idea which code to use and most importantly:  Where do I insert my validation code?  

 

I don't even know what the correct term is to ask the question.  Every option I click on takes me into branded more complex options that require sign up, have my technical team contact their instructions, well I have no idea what they are talking about.

 

All I want is a simple button on my html web page so people can pay me if they want to use my service.

Login to Me Too

quickone1
Contributor
Contributor

Apologies... i just don't understand it

Login to Me Too

Haven't Found your Answer?

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