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 ‎Oct-13-2017
chinjh
chinjh Contributor
Contributor
1
Post
8
Kudos
0
Solutions
Your 5th PayPal Anniversary
Your 3rd PayPal Anniversary
Your PayPal Anniversary
Esteemed
The Return
Liked
Ice Breaker
View all
Topics chinjh has Participated In
  • Topics chinjh has Participated In
  • Latest Contributions by chinjh

Re: PayPal Express Checkout: remove shipping optio...

by JackieDaytona Contributor in REST APIs
‎Jun-09-2020 03:31 PM
1 Kudo
‎Jun-09-2020 03:31 PM
1 Kudo
Since Shopify is in Ruby...JavaScript should be OK.  There are good articles on Rails and JQuery integragtion, like JQuery Rails over on Github.. so here is my code for an express checkout   paypal.Buttons({ style: { layout: 'horizontal', color: 'gold', shape: 'pill', label: 'checkout', size: 'responsive', tagline: 'true', }, // Set up the transaction createOrder: function(data, actions) { $('#paypalmsg').hide(); $('#transmsg').show(); $('#transmsg').html('<b>'+'WAITING ON AUTHORIZATION...'+'</b>'); $('#chkoutmsg').hide() return actions.order.create({ purchase_units: [{ description: 'GnG Order', amount: { value: cartTotal } }], application_context: { shipping_preference: 'NO_SHIPPING' } }); }, /* onClick: function() { */ /* },*/ // Finalize the transaction onApprove: function(data, actions) { return actions.order.get().then(function(orderDetails) { // Show a success message to the buyer $('#transmsg').html('<b>' + 'AUTHORIZED...' + '</b>'); $('#transmsg').append('<br>'+'Transaction completed by: ' + orderDetails.payer.name.given_name +' '+ orderDetails.payer.name.surname + '<br>' + "Order Id: " + orderDetails.id + '<br>' + 'Status: ' + orderDetails.status+'!' + '<br>'+ 'Thank You For Your Order'+ '<br>'); if (orderDetails.status === "APPROVED") { window.setTimeout(function() {}, 500) $('#transmsg').append('<b>' + 'Sending Order...Please Wait' + '</b>'+'<br>'); var getId = '#'+ $('span:contains("Market")').attr('id'); var getmrktDiv = '#'+ $(getId).offsetParent().attr('id'); var mrktchkId = '#'+ $(getmrktDiv).closest(getmrktDiv).find(".chkbox").attr('id'); var mrktpriceId = '#'+ $(getmrktDiv).closest(getmrktDiv).find(".price").attr('id'); var chkboxId = "#chk6"; var hidpriceId = "#pricef"; var marketLocation = $(mrktchkId); if (marketLocation.length > 0 ) { var checked = $(mrktchkId).prop('checked'); if (!checked) { var storedVal = $(mrktpriceId).val(); if ($(mrktpriceId+':not([data-val])')) { $(mrktpriceId).attr("data-val", storedVal); } $(mrktpriceId).val(""); } } $('#transid').val(orderDetails.id); $('#orderstat').val(orderDetails.status); $('#orderform').submit(); } }); if (details.error === 'INSTRUMENT_DECLINED') { $('#transmsg').html('<b>' + 'TRANSACTION WAS DECLINED'+'</b>'); $('#transmsg').fadeIn('slow').delay(3000).fadeOut('slow', function() { $('#paypalmsg').show(); $('#chkoutmsg').show(); $('#transmsg').empty(); }); return actions.restart(); }; }, onCancel: function(data) { $('#transmsg').html('<b>' + 'YOUR TRANSACTION WAS CANCELLED' + '</b>'); $('#transmsg').fadeIn('slow').delay(3000).fadeOut('slow', function() { $('#paypalmsg').show(); $('#chkoutmsg').show(); $('#transmsg').empty(); }); } }).render('#paypal-button-container');     Hope this helps ya   D       ... 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