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 ‎May-19-2020
Country: Switzerland
Type: Business
alexci
alexci
New Community Member
1
Post
0
Kudos
0
Solutions
Active
View all
Topics alexci has Participated In
  • Topics alexci has Participated In
  • Latest Contributions by alexci

PayPal Smart button: display credit card fields

by alexci in SDKs
‎May-19-2020 01:27 AM
‎May-19-2020 01:27 AM
Dear all,   I am trying to display pre-filled credit card fields, however, then I define the payer's information in the script, the fields don't get displayed. Please let me know if you know how to fix this.   Thanks!   Aleksandar     Here is the code I am using:   <script> paypal.Buttons({ commit: false, createOrder: function(data, actions) { // This function sets up the details of the transaction, including the amount and line item details return actions.order.create({ payer: { name: { given_name: "PayPal", surname: "Customer" }, address: { address_line_1: '123 ABC Street', address_line_2: 'Apt 2', admin_area_2: 'San Jose', admin_area_1: 'CA', postal_code: '95121', country_code: 'US' }, email_address: "emailatdomain.com", phone: { phone_type: "MOBILE", phone_number: { national_number: "14082508100" } } }, purchase_units: [{ amount: { value: '20' } }], application_context : { shipping_preference: "NO_SHIPPING" }, }); }, onCancel: function (data) { // Show a cancel page, or return to cart }, onApprove: function(data, actions) { // This function captures the funds from the transaction return actions.order.capture().then(function(details) { // This function shows a transaction success message to your buyer alert('Thanks for your purchase!'); }); }, style: { layout: 'vertical', color: 'black', shape: 'rect' } }).render('#paypal-button-container');   </script> ... 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