Stripe Order API and Product API - paypal

Is it possible to use the Stripe Orders API without using Stripe's payments API? I've managed to create some sample products and create an order and invoke the payment related method with a sample token. This all works, but in a live environment I'm not clear what would happen? The orders and products APIs are very useful but because Stripe can't be used with PayPal, we can't use it as the provider for payments...

Test cards won't work in live mode, so the API would return a card_error when you try to pay an order.

Related

server side code for payment gateway integration with flutter

I'm trying to integrate a payment gateway like razorpay or stripe in my flutter app, and for any payment provider we need to generate a token using their API in the backend , but none of these payment providers have mentioned the code for the server side to generate tokens and how/where to deploy that server side code. Essentially I'm creating an ecommerce app and to process payments I can't find resources to implement the server side code for each cart order. Can anyone tell how to implement the server side code or some resource which could be useful?
Docs I have read:
https://pub.dev/packages/razorpay_flutter
https://razorpay.com/docs/payments/payment-gateway/flutter-integration/standard/build-integration#16-create-an-order-in-server
but none of these payment providers have mentioned the code for the server side to generate tokens and how/where to deploy that server side code
This is by design. Payment providers help you lower your PCI compliance burden by not touching raw card details. If you use frontend SDKs (like Stripe's Stripe.js + Elements UI library), they are an iframe that collects your end customer card details directly to their servers meaning your integration does not touch card details and does not have to do tons of paperwork on your own PCI compliance.
https://stripe.com/docs/security/guide
https://stripe.com/guides/pci-compliance
So you absolutely need to use their frontend SDKs to directly create a token from your webpage.
I can't find resources to implement the server side code for each cart order.
Once you have your token, you then send that to your server to create an order and (in Stripe's case) create and confirm a PaymentIntent. Though Stripe's recommended flow is a bit different - you create the PaymentIntent first and "confirm" it on your frontend: https://stripe.com/docs/payments/accept-a-payment
For razorpay integration (atleast as a payment gateway) you will be in need of a client and a server. As you say you have the client with you. After the user initiates the payment and completes it in the flutter client - the client has to send out an api request to the api server that can actually capture the payment with the hash comparisons.
I don't not much idea about Razorpay integration but for Stripe you can use Payment Intent API.
You can divide the process in 3 steps:
Send card details from Front-end, if it's a Stripe Customer then you can even use their default card.
Create a payment Intent in Backend, this will return a payment intent object with client_secret. You also might wanna save the payment intent id in DB.
Send this client_secret to Frontend, where you can use this client secret in Stripe.confirmCardPayment(client_secret).
Listen to webhook events to check on the payment status/progress. It's basically an open endpoint where stripe will make REST calls and provide you with details about your payment progress.
Here's a link to the docs mentioning this process. There was an even better doc/github link that I can't seem to find, it had the entire end-to-end happy process.
If this seems a bit complicated then you go with checkout API of Stripe. I've also attached a few youtube videos that might help ya in getting started.
Checkout API YT link
Payment Intent YT link

PayPal API Subscription Shows 0 (zero) as the purchase total

I'm using the PayPal API from PHP/Laravel and the purchase total is bugged. It results in a payment with the correct amount from the credit card, but when showing the amount to the customer during checkout, it only shows a 0 total
checkout screenshot
Do not include a start_time (date) when creating the subscription.
https://prnt.sc/pOK5-7v5ZYMY
You should always uput text in code blocks, either with indentation or surrounded by three backticks, ``` before and after the code. Never take a screenshot of code.
It would appear you are using the old PayPal-PHP-SDK, which is deprecated. Do not use it for anything. (separately, that SDK also uses an older version of PayPal Subscriptions with billing agreements; current Subscriptions API does not use agreements).
The current version of PayPal Subscriptions integrations is documented here. There is no REST SDK for it. For any API calls, you can use direct HTTPS REST calls, first obtaining an access_token using the client id and secret. (If you need sample code for that, the current Checkout-PHP-SDK's classes or functions might be useful as a base, but it does not include support for Subscriptions API calls, which you need to write yourself)

Paypal OAuth Implementation to onboard merchants on our site

We have an app where we want to onboard Merchants to connect their Paypal account and then they can accept money from the customers directly through our webapp. I read through the docs and am a little lost on how to start.
What I understood is :
Using this document Paypal Doc we first need to generate authorization code then generate refresh and access token. But this document is for Paypal Here.
Also on the Customer Side should I use Smart Buttons Doc where I can generate the order Id and execute the capture step on the Server side using the access token generated for the Merchants in the first part.
Am I heading in the right direction?
If you also need to do things like manage refunds via the API, have the merchants generate a REST client ID and secret via https://www.paypal.com/signin?intent=developer&returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Fapplications and copy this information into your configuration interface
If you don't need to do that, you can integrate PayPal Checkout with your own API credentials, and set a 'payee' object, https://developer.paypal.com/docs/checkout/integration-features/custom-payee/

Paypal Rest API vs Classic Sdk

I am working with paypal first time.
I have a product and I want to integrate paypal with it.
I want to achieve the following tasks :
Client comes to my website and select a plan,which is a monthly recurring plan.
Then client is redirected to Paypal for payment.
Client makes payment.
Return backs to home page.
I have gone through the documentation of paypal and I have the following questions.
What should I use REST API or Classic Sdk, as I want to create Recurring Profile,Work with EXPRESS-CHECKOUT and REFERENCE TRANSACTIONS.
I have customers all over globe and it is stated in the documentation that, for the customers in Germany and China , I have to use REFERENCE TRANSACTION.
Some where in the documentation of Merchant SDK it is stated that the classic API's will be deprecated, so is it a good approach to use Classic SDK
I also wanted to track the transactions(payment) made by user, so that I can show him the amount that is deducted in each month in his profile details.
Please suggest a feasible solution to my problem.
Thanks in advance.
Here's what I use. I went to Web Payments Standard and created a Subscription button. (I like the unencrypted variety, but you can encrypt if you want.) In there, you set the terms of the subscription, as well as where to post the IPN message. When the IPN message comes back, you deal with it. You'll get a subscr_signup at the start along with a subscr_payment. Then, on renewals, you'll get a subscr_payment again. What I like to do is store every verified IPN message in the database for my customer.
For handling the management of those subscriptions for things like tracking info, refunds, subscription cancellations, and voids, you'll need to use NVP API, which is a very simple API. If you stored in a database every IPN message with all those fields, then you should be able to pass certain fields of those to the NVP API in order to get what you need done.
If you're worried about longevity of the APIs, then don't. All they do when they deprecate APIs is stop giving you good docs on them. They still let those older versions run. If they didn't, there would be major upheaval on the web with web commerce products breaking all over the place. However, that said, if you want to prepare for the future, then get on the Braintree Payments API because PayPal bought Braintree and that's the future of their API.

Woocommerce and PayPal Here integration

I'm interested to see if anybody is looking to integrate Woocommerce with the PayPal Here payment App? More so the importing of products from Woocommerce to the PayPal Here App. Be a great addition.
I haven't looked into that specifically, but I will be adding a "virtual terminal" / POS functionality into my PayPal for WooCommerce plugin before long. I've got it planned for the next full version release.
It basically gives you a section in the WP admin panel where site owners can easily put together invoices using their WooCommerce inventory and then process those orders accordingly. I will be including the Invoicing API's so you can create an invoice from the Woo VT order page, or you'll also have the ability to swipe a card using a USBSwiper card reader. Of course, you could also key in card data if you needed to do it that way.
The cool thing about that is even when you key in the transactions you still get your 2.2% - 2.9% rate depending on your volume because it would be processed over Payments Pro in that case. Same with invoicing or swiping.
Back to your original question, though, I'm unaware of any API or tool that allows us to interact directly with the Here inventory. They do have the Sideloader API for PayPal Here, which would allow you to send inventory (or a specific order) into the Here app from your own app in order to complete an order, but I don't think it lets you push inventory directly into the actual Here app.
On that note, what I could potentially do is build a stand-alone app that does nothing but pull in current WooCommerce inventory, and then from there you could create orders through the Sideloader API using that inventory, but it would use the Here app to actually complete the order. Seems a little clunky, but in theory, that should work fine.
If you want to contact me directly we could discuss getting this done for you.
Right at this time PayPal Here is designed to be card present, so you cannot import your products from Woocomerce into the PayPal Here App.
Here is a link to an FAQ on PayPal Here:
PayPal Here FAQ
Here is the current list of PayPal Here Partners:
PayPal Here Partners