Error trying to capture Pay Later payment

leif_alexander
Contributor
Contributor

Trying to integrate PayPal Checkout using the following configuration and code...

 

 

<script src="https://www.paypal.com/sdk/js?client-id=<clientId>&enable-funding=venmo&disable-funding=card"></script>

 

 

 

<script>
	paypal.Buttons({
		style: {},
		createOrder: function(data, actions) {
			return actions.order.create({
				purchase_units: [{
					amount: {
						value: '<totalPrice>'
					}
				}],
				application_context: {
					shipping_preference: 'NO_SHIPPING'
				}
			});
		},
		onApprove: function(data, actions) {
			return actions.order.capture().then(function(details) {
				console.log(details);
			});
		}
	}).render('#paypal-button-container');
</script>

 

 

Everything works except for the Pay Later option. I get the following error after completing the form...

 

Can not pay order for unauthorized order

 

It works if I use intent=authorize, but I need to capture the funds immediately.

 

Any help would be appreciated!

Login to Me Too
4 REPLIES 4

MTS_Chiranjeevi
Moderator
Moderator

Good day @leif_alexander,

 

Thank you for posting to the PayPal community.

 

We recommend merchants to integrate our latest PayPal Checkout (Smart button) product.

 

Guide link : https://developer.paypal.com/docs/checkout/standard/ 

I would suggest to please contact your website developer or the support of your third party platform(eCommerce) who can above help you add the Smart button code on your website. 

 

To add Pay Later button : Render the Pay Later button in a one-time payment integration by passing enable-funding=paylater in the PayPal JavaScript SDK. For details, see enable funding.

 

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

 

Please refer below guide links :

 

https://developer.paypal.com/docs/checkout/pay-later/us/

 

https://developer.paypal.com/docs/checkout/pay-later/us/#link-howdoyouwanttointegrate 

 

Add Pay Later offers through an e-commerce platform  : https://developer.paypal.com/docs/checkout/pay-later/us/commerce-platforms/ 

 

I would suggest to please cross check your PayPal Business account and make sure it is verified and confirmed without any account limitations

 

Try to process a test payment via card which is not linked to your PayPal account. Since, merchant can't process self payments. 

 

If your still facing any issues, please create a MTS ticket via -  https://www.paypal-support.com/s/?language=en_US with the detail information and error details.

 

Note : Pay Later in the US includes the following:

  • Pay in 4 - Eligible US buyers can pay in four interest-free payments for purchases of $30 to $1,500.
  • Pay Monthly - Eligible US buyers can pay in 6, 12, or 24 monthly installments for purchases of $199 to $10,000.

Sincerely,

Chiranjeevi

PayPal/Braintree MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

leif_alexander
Contributor
Contributor

Thanks for the response @MTS_Chiranjeevi, but I am using the latest PayPal Checkout product. Please see the code I provided.

 

Also I am integrating this into an eCommerce platform of which I am the developer.

 

As I stated above, everything is working except for capturing the Pay Later payment. All other forms of payment are completing as expected. I can provide more detailed error information if that would be helpful.

Login to Me Too

leif_alexander
Contributor
Contributor

Here are some screenshots of the issue. The second screenshot is after I click "Pay Now" to complete the Pay Later payment.

 

paylater-1.pngpaylater-2.png

Login to Me Too

MTS_Chiranjeevi
Moderator
Moderator

@leif_alexander 

 

I could see that your testing the flow via Sandbox test environment, could you please try now via different test card details or sandbox account. 

 

If your still facing any issues, please create a MTS ticket via -  https://www.paypal-support.com/s/?language=en_US with the detail information and error details.

 

NoteTo add Pay Later button : Render the Pay Later button in a one-time payment integration by passing enable-funding=paylater in the PayPal JavaScript SDK. For details, see enable funding.

 

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

 

Add Pay Later offers through an e-commerce platform  : https://developer.paypal.com/docs/checkout/pay-later/us/commerce-platforms/ 

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.