Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in

Le Forum de la communauté n’est pas disponible pour les nouveaux messages ou les réponses; les articles précédents restent disponibles pour vérification. Afin de connaître les options d’assistance complètes, rendez-vous sur PayPal.com/HelpCenter

Si vous souhaitez signaler du contenu illégal et contraire au Règlement sur les services numériques de l’Union Européenne (DSA), veuillez cliquer ici.

since ‎Mar-23-2019
Country: United States
Type: Personal
JohnnyBurbank
JohnnyBurbank Contributor
Contributor
7
Posts
1
Kudos
0
Solutions
Your PayPal Anniversary
Organized
Liked
Giving
Ice Breaker
Active
The Return
View all
Latest Contributions by JohnnyBurbank
  • Topics JohnnyBurbank has Participated In
  • Latest Contributions by JohnnyBurbank

Re: Setting Headers in js client

by JohnnyBurbank Contributor in SDKs
‎Jan-02-2020 08:07 PM
‎Jan-02-2020 08:07 PM
Did you ever get an answer for this?  I'm looking for this same information also. ... View more

How do I get the paypal_fee from the transaction?

by JohnnyBurbank Contributor in SDKs
‎Jan-02-2020 04:15 AM
‎Jan-02-2020 04:15 AM
I'll start by admitting I'm no coding wizard at this stuff, but I'm using the Javascript SDK with Smart Buttons.  In theory should be easy.  After weeks of messing with values I eventually got everything to work exactly as I wanted and have had multiple successful sales go through my Paypal setup.    But NOW I find out that I was calculating the Paypal fees on my side because I read somewhere that said that Paypal fees are an easy calculation and don't change.  This understanding was false, particularly for International sales.  So I think "Ok, I'll just have Paypal return the actual Paypal fee value to me" so I can record it and use it in our calculations for payouts rather than manually calculating them.  Ok, in the documentation I see an object called "seller_receivable_breakdown" that within it has a "paypal_fee" object.  I run through a sale on my site and look at the objects, "payments" great!  "captures" great!  Array 0 entry great! Where's "seller_receivable_breakdown"?  Nowhere to be found...brilliant!   Digging a little deeper I see a thing that says some data won't show unless you change the header "Prefer" from the default of "return=minimal" to "return=representation".  Not even sure if this will actually help, but I haven't the first clue where this thing goes.  I've googled for hours and can't find anything remotely close to using this variable with the Javascript Smart Button setup.    There's a reference near the top of my code where I src the javascript code like "https://www.paypal.com/sdk/js".  Is that where I do this?   Later, I'm using  paypal.Buttons({ style: {  Does it go somewhere around here?   Does it go near the  onClick: function(data, actions) { Near the createOrder area? createOrder: function(data, actions) { console.log( "create order" ); return actions.order.create({   Near the order.capture? onApprove: function(data, actions) { // Capture the funds from the transaction return actions.order.capture().then(function(details) {   Any helpful ideas would be greatly appreciated.  Thanks!   ... View more

Re: 400 Error just loading the JS SDK in standard ...

by JohnnyBurbank Contributor in SDKs
‎Jun-29-2019 09:28 AM
1 Kudo
‎Jun-29-2019 09:28 AM
1 Kudo
That's it!  It's still working this morning.  I've got a ticket open about this with Paypal tech people so I'll add this info to it.  Also, the nice thing about this is if, in the small chance that a customer gets this error, I can pop up a message that tells them to clear their paypal.com cookies (assuming they know how to do it).  Hopefully the Paypal techs will make it so that won't be necessary in either case.  Thanks guys! ... View more

Re: 400 Error just loading the JS SDK in standard ...

by JohnnyBurbank Contributor in SDKs
‎Jun-28-2019 08:43 PM
‎Jun-28-2019 08:43 PM
Interesting.  I'm not sure if it had anything to do with switching between sandbox and live, but I now realize that when I originally cleared all cookies, i cleared them for my site's domain, NOT paypal's domain.  Clearing paypal's domain seems to have fixed it for now.  So now I just need to check and see if it's still working in 6 hours (the time I determined that it takes for the site to break once it's working again). So now I wonder if just logging into multiple paypal accounts has got the site confused about who I am and somehow jacks up the results.  And if that's actually the case, then I imagine I can be less concerned about a customer running into the same issue.  If it's good again when I check in the morning, I'll mark this solved!  Thanks shawnz! ... View more

Re: Need help with PayPal Javascript SDK Integrati...

by JohnnyBurbank Contributor in SDKs
‎Jun-20-2019 10:23 PM
‎Jun-20-2019 10:23 PM
Barely floundering in the Paypal JS SDK myself, but I believe you can specify the currency_code inside the purchase_units JSON object you pass to the createOrder function for the Smart Buttons.  "purchase_units" is an array, and inside one purchase_unit object is an "amount" object, where you can specify the "value"(price) and the "currency_code" for that specific sale.  I'm assuming if you go that route, you don't need to pass the currency code in the place you are now.  Don't know much outside of that, so hopefully that helps in some way. ... View more

400 Error just loading the JS SDK in standard Chro...

by JohnnyBurbank Contributor in SDKs
‎Jun-20-2019 10:01 PM
‎Jun-20-2019 10:01 PM
I'm currently using the JS SDK via this line as described on the Smart Buttons site on Paypal, which is using my sandbox id.   <script src='https://www.paypal.com/sdk/js?client-id=AYwrV-MD9W7255v6j5g4Sp4RBtaTJGNrsQ_246qJObnT4eKa96FptSM0AVQXbWltw_mxhm4_SRQ6JP6U&disable-funding=credit'></script>    If enough time has passed and I come back to visit the page where this is called, the Paypal Smart Buttons don't appear and there's a 400 error in the Chrome console.  There are several additional unusual behaviors here.  1) If I just put the address (https://www.paypal.com/sdk/js?client-id=AYwrV-MD9W7255v6j5g4Sp4RBtaTJGNrsQ_246qJObnT4eKa96FptSM0AVQXbWltw_mxhm4_SRQ6JP6U&disable-funding=credit) into Chrome's address bar, I get a "This page isn't working. HTTP Error 400."  How can it be an error 400 when the only thing I'm passing is my client-id?!? 2) If I remove the "&disable-funding=credit", same problem. 3) I've tried unloading all my Chrome plug-ins, same problem. 4) If I try my LIVE client-id, same problem. 5) If I clear cache and cookies, same problem. 6) However, if I load the page in Chrome in Incognito Mode it WORKS! (One reason, I thought unloading my plugins above might fix it) 7) If I load the site on my PC in IE(or Edge or whatever its called these days), it WORKS! 😎 If I load it on Chrome or Safari on my iPhone it WORKS! 9) Stranger still, if I get it working on 6,7, or 8 above, the page on my PC in Chrome will suddenly start working.   It's almost as if the address needs a jump start from some device/browser/mode OTHER than standard Chrome on my PC and THEN it starts working on Chrome on my PC (until some amount of time passes and I check it again the next day, for example, and then it'll stop working again).  The problem has persisted every day I come back to check it out with the above scenarios for the last several weeks.  Any ideas? ... View more
Labels:
  • Labels:
  • Mobile SDKs

Trying to implement PHP SDK -Need to check my data...

by JohnnyBurbank Contributor in SDKs
‎May-13-2019 10:41 PM
‎May-13-2019 10:41 PM
I'm not a master of PHP or Paypal by any means, but I've been googling for the past 3 days and can't seem to find the right combination of code to make anything work correctly.  First, I keep seeing talk of Smart Buttons and a bunch of stuff about V1 being deprecated and I need to use V2.  Then I follow a link to an SDK that takes me here: https://github.com/paypal/Checkout-PHP-SDK.  Should I be using this because V1 will be deprecated soon?  Well, this V2 github is not super helpful because I don't have access to composer, and there are no instructions for Direct Download.  Eventually, I dig through "issues" and find some stuff about installing BraintreeHttp and somehow get that working.  But then the other half of all this is getting the Smart Buttons javascript to work properly.  First I see stuff about createOrder looking like this: createOrder: function(data, actions) {   return actions.order.create({   purchase_units: [{ amount: { value: '0.01' } }] }); }, Well this doesn't work for me, because this sends the data directly to Paypal, when I need to call a PHP function to modify my database BEFORE it does that.  So I find some other version of createOrder that looks something like this: createOrder: function() { return fetch('/my-server/create-paypal-transaction', { method: 'post', headers: { 'content-type': 'application/json' } }) .then(function(res) { return res.json(); }) .then(function(data) { return data.orderID; }); } I'm assuming "/my-server/create-paypal-transaction" refers to my PHP create order code page (using the example code from the SDK github but with my proper client id and stuff).  But that doesn't work because the JSON it seems to return looks something like this (ie. not properly formatted json)... BraintreeHttp\HttpResponse Object ( [statusCode] => 201 [result] => stdClass Object...   Can anyone provide the missing link to making this work?  I'm about at my wits end, and have no idea what documentation I've found is from V1 or V2 or some other archive from 10 years ago.  Is V1 really being deprecated soon?  Should I even be using Smart Buttons?  This seems far more complicated than it needs to be.  Any help is greatly appreciated. ... View more
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros