Buttons for services, not goods? category option in item

simonpatp
Contributor
Contributor

Is there anyway to specify that an order is purely a services-base purchase? I'm trying to create a button via actions.order.create({...}) for an event that people can sign up for in advance. The order "item.category" supports Digital goods (nope), physical goods (nope), and donation (nope). What is the best way to create an order for services?

Login to Me Too
4 REPLIES 4

sharpiemarker
Esteemed Advisor
Esteemed Advisor

@simonpatp 

 

You’d wanna try the Pay Now experience:

https://developer.paypal.com/docs/checkout/standard/customize/pay-now/


Kudos & Solved are greatly appreciated. 🙂
Login to Me Too

simonpatp
Contributor
Contributor

Hmm, I have read this page, but am unclear on what I need to do? Orders made with a non-sandbox client-id show shipping & goods related stuff.  Current code:

 

 

<script 
    src="https://www.paypal.com/sdk/js?components=buttons&disable-funding=paylater,credit&client-id=AaQ-q0S7Dv1LKUHTTjvlqF8rEZaMpObVI-jzGxsZF9vyQpT7p8lGwWZ5e-AL_ZeQfl-CaP-wW9Cl-xrI">
  </script>
  <div id="paypal-button-container"></div>
  <script>
  	window.addEventListener('load', (event) => {
	  	{
	  		function submit(order, paypalDetails)
	  		{ /*snip */ }
	  		window.details = JSON.parse(document.getElementById("fullorder").value);
	  		document.getElementById("total").textContent = "Total: $" + details.cost;
			  paypal.Buttons({
				createOrder: function(data, actions) {
				  return actions.order.create({
					purchase_units: [{
					  reference_id: "92PMYBWhQP",
					  custom_id: "92PMYBWhQP",
					  soft_descriptor: "Adventure Race",
					  invoice_id: "92PMYBWhQP",
					  amount: {
						value: details.cost + ".00",
						currency_code: "USD",
					  },
					  
					}]
				  });
				},
				onApprove: function(data, actions) {
				  return actions.order.capture().then(function(pdetails) {
				  
					submit(data.orderID, JSON.stringify({data: data, details: pdetails}));
				  });
				}
			  }).render('#paypal-button-container');
		}
    });
  </script>

 

 

Login to Me Too

sharpiemarker
Esteemed Advisor
Esteemed Advisor

@simonpatp 

Disclaimer: I don’t do coding beyond html.

 

All this is alien to me…however on this page https://developer.paypal.com/docs/checkout/standard/customize/pay-now/

It says, “When your buyers are checking out, you can offer either a Pay Now or Continue button.”

I click on the Pay Now or Continue link.

It takes me to https://developer.paypal.com/sdk/js/configuration/#commit

 

Putting 2 & 2 together, I guess you’re supposed to use the Commit call, variable or whatever to use the Pay Now experience.

 

 

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&commit=false"></script>

 

 

 You see the “&commit=false“ up in the script above? replace false with true

 Append &commit=true to the end of the script src url.

 

Option/Description

trueDefault.
Show a Pay Now button in the PayPal Checkout flow. The final amount does not change after the buyer returns from PayPal to your site.
falseShow a Continue button in the PayPal Checkout flow. The final amount might change after the buyer returns from PayPal to your site, due to shipping, tax, or other fees.

 

Or just use a classic standard Buy Now button which is more my speed lol and disable the Shipping address requirement on step 3 of the button maker.


Kudos & Solved are greatly appreciated. 🙂
Login to Me Too

simonpatp
Contributor
Contributor

I tried that, but it still seems to be for "goods", which would make sense as "true" is listed as the default

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.