kandi X-RAY | PayPal-NET-SDK Summary
kandi X-RAY | PayPal-NET-SDK Summary
The PayPal .NET SDK makes it easy to add PayPal support to your .NET web application and is built on PayPal's REST APIs.
Top functions reviewed by kandi - BETA
PayPal-NET-SDK Key Features
PayPal-NET-SDK Examples and Code Snippets
Trending Discussions on PayPal-NET-SDK
I'm using the PayPal SDK nuget package to process online orders on my website. The issue is all products are set as "physical" by default.
In this link PayPal shows how to set the type of an order/product https://developer.paypal.com/docs/api/catalog-products/v1/
But in the PayPal asp.net sdk, there's nothing like that. https://paypal.github.io/PayPal-NET-SDK/Samples/PaymentWithPayPal.aspx.html
Has anyone had any experience with this or is able to find out how to set products/orders as "Service" or "Digital" through the sdk?...
ANSWERAnswered 2020-Sep-27 at 19:54
First of all the v1/payments PayPal-NET-SDK is deprecated, use the v2/checkout/orders Checkout-NET-SDK instead
Secondly the catalog-products API only applies to things like subscription payments. If you aren't creating products for subscription plans, this API is not relevant to you.
With the v2 items API, if your purchase_units includes an
items array (and the required separate
amount_breakdown, in cases of passing an items array) , there is a
category field for each item: https://developer.paypal.com/docs/api/orders/v2/#definition-item
The above is getting a little in to the weeds though, when you probably should first take a step back and review the basics of implementing a v2 checkout.
Create two routes on your server, one for 'Set Up Transaction' and another for 'Capture Transaction', documented here: https://developer.paypal.com/docs/checkout/reference/server-integration/
Then connect to them with this front-end for the payer approval: https://developer.paypal.com/demo/checkout/#/pattern/server
does anyone know the state of the Paypal .NET SDK? I just wonder, according to https://github.com/paypal/PayPal-NET-SDK/releases, the latest version is a V2.0 Release Candidate, but it is already 2 years old, and it seems like there was never an actual V2.0 release. Has this project died? Should I rather use the Paypal REST API directly?...
ANSWERAnswered 2020-Mar-18 at 17:10
Don't use any version of the v1 PayPal-NET-SDK (neither 1.x nor 2.0 rc2)
Use the new v2 Checkout-NET-SDK
If it does not (yet) support the API you want to integrate (e.g. the new Subscriptions API would be one example), then use direct HTTPS calls for that REST API
I am trying to run payments through PayPal in sandbox mode with my .NET CORE 3 project. The idea is to give the customer ability to choose whether to pay using his/her PayPal account or Credit Card. I am using the PayPal-NET-SDK v2.0.0-rc2
I am trying to understand whether this is the right order to run things:
- Create Payment using
- At this point, I get the approval_url. I redirect the customer and approve the payment/order using Credit Card
- Execute payment using
PaymentExecuteRequest, using the PAYID and PAYERID I get from the redirect URL. Here I get an order object
- Authorize order using
OrderAuthorizeRequestwith the order id (setting body to a
- Capture order using
OrderCaptureRequestwith the order id (setting body to a
Is that a correct execution order?...
ANSWERAnswered 2020-Feb-02 at 21:45
Rather than the old v1/payments, you should use v2/orders; the v2 SDK can be downloaded here
Rather than an old-style full page redirect to an approval_url , it's much nicer to use the new checkout's in-context UI that keeps your site loaded in the background. Here is a demo pattern. Another benefit is that it gives an embedded/in-line credit card form.
- As a finishing touch once you have everything working, don't neglect to gracefully handle/propagate funding failures back from your server, so the buyer can choose something else when declined.
If you start out with intent=capture(v2) or sale(v1), the capture(v2)/execution(v1) call will be final and complete the transaction, there will be no authorize step, so (4) on your list is skipable. (You should only bother with implementing something other than intent=capture/sale if you find you have a specific business need for delaying captures, as it adds complexity)
More general information on implementing the server-side portion of the integration: https://developer.paypal.com/docs/checkout/reference/server-integration/set-up-transaction/
No vulnerabilities reported
Reuse Trending Solutions
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page