Update custom fields on Paypal - node.js

I use the NVP integration on Paypal and I'm facing a situation that I need to create a method to update some info on an already placed Paypal order. The only field that I need to update (edit) is PAYMENTREQUEST_0_CUSTOM, but looking on the docs I couldn't find any put/patch methods that would help me here.
Anyone has any inputs on this case? Have anyone ever update info on placed orders on Paypal?
Thanks in advance!

There is no method to patch the information of an already completed PayPal sale transaction. Once such a transaction has completed, it is final.
If using paymentaction=order or paymentaction=authorization, you can update information when doing the DoCapture which is the final step to create a transaction. This final step can fail, so do not change your integration to paymentaction=order or paymentaction=authorization unless you have very specific business needs for those features.

Related

Best way to handle one-time payments with STRIPE webhooks in nodeJS

I am using STRIPE as my payment processor, in an REACT + nodeJS app. I already have something that already works, but I would like some feedback, maybe I'm doing something wrong.
So... I have this Redirect-To-Checkout functionality thats made available by STRIPE, basically I redirect the user to this STRIPE page where all card-data (sensitive information) is processes in order for the payment to full-fill.
What I do in my nodeJS server part is the following:
Once the user acces the redirect to check-out page, I already create a PendingOrder, with the products selected by client (Here I save some information based on client/stripe payment-intent, in order to check in later steps)
Once webhook gives me the 'payment_intent.succeeded' I check for the payment-intent information to see if it exists in my PendingOrder collection, then proceed to add in to ConfirmedOrders and remove it from PendingOrders.
I have to do this whole process because Stripe no longer gives me access to some information I require when the user is checking-out his order(such as observation that the user has based on the type of service he chooses).
Are there any down-sides to this approach or is there any other way to do it?
Thanks in advance!
You’re not really far from the best practices that Stripe recommends here. The only thing that I would change is listening to checkout.session.completed instead of the payment_intent.succeeded event. As of the latest API version, a PaymentIntent is no longer created upfront so a better to way to handle order fulfillment is to either store the Checkout Session ID (e.g. cs_live_xxx) or you could add some metadata when creating the Checkout Session and use that instead to identify the order.
I have to do this whole process because Stripe no longer gives me access to some information I require when the user is checking-out his order
As for this, I’m not sure what you mean, you can always use your app with the success page customization described here alongside webhooks. I wouldn’t use that to fulfill the order though since the user might close the page before the redirection completes which means that the fulfillment wouldn’t be done in that case. As such, webhooks are essential to order fulfillment.

When I create an Azure AD user, the calendars "allowedOnlineMeetingProviders" is empty, how do I update this?

I need a users calendar to have the property "allowedOnlineMeetingProviders" contain "teamsForBusiness". I am not able to add the calendar via the create user call (graph api) so I had to subsequently update the existing calendar but it wont let me update the property (only name seems to update). Anyone know how I can programmatically set this property?
Its because its not expected workflow ~ Microsofts response:
Hope you are doing good.
Apologies for the delayed response, I have tried to gather more details on this behavior internally, but unfortunately since this is an existing behavior in the system i.e. by design we can say since the new user needs to have some kind of interaction with the MS teams initially.
Unfortunately, we aren't much help on this scenario from MS graph api standpoint.
We request you to provide your feedback/ideas/suggestion https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform
We regret not being helpful to you on this case since this is a known issue.
Kindly let us know if you have any queries.

Programmatically create order in shopware plugin

I need to create ShopWare 6 plugin that creates new orders from products that are received via AJAX POST request. I don't know how to do that. I googled and checked documentation but I couldn't find any info on how can it be done.
Does someone know how can it be done?
In my opinion, the best solution would be to create Cart object from products that you get from request probably you know context token so you can use the current customer's cart and add products to it, but also you can create a new cart and then call \Shopware\Core\Checkout\Cart\Order\OrderPersister::persist() method to persist order from your cart.
Take a look here how to load/create a Cart
\Shopware\Core\Checkout\Cart\SalesChannel\CartLoadRoute::load()

how to add coupons to stripe's checkout

To enable SCA changes, I am now integrating https://stripe.com/docs/payments/checkout/client stripe's (stripe v3 js file) checkout feature to my app, which makes it easy for integration of my subscription system.
Question
how to pass coupons to stripe.redirectToCheckout() method, don't see anything related to this in documentation.
code sample
stripe.redirectToCheckout({
items: plans_and_addons,
successUrl: successUrl,
cancelUrl: cancelUrl,
clientReferenceId: customer_id, // helpful in webhook response
})
I am also facing the same issue so I contacted stripe support.
Please check the support team's reply.
I did a thorough research on your query and I'm afraid, Checkout supports only a limited set of customizations (e.g. name, description, logo) and fields. Focusing the UI allows us to iterate on it more effectively to improve conversions and maintain support across a wide range of platforms.
They provided me one document link you can also check it. https://stripe.com/docs/payments/checkout/customization
I think you can solve your problem by creating custom checkout with helping stipe API. --not tried.
As Daniel says above, you can't enable the promo codes when you call redirectToCheckout but you can enable the promo codes when you create the stripe session from your API.
So, to sum app, when you create the checkout session using Stripe.checkout.sessions.create() you have to also pass the allow_promotion_codes: true and this will actually allow you to apply promo codes to the products you have created in the stripe -> products page.
You can find more informations on this page: https://stripe.com/docs/billing/subscriptions/coupons/codes
I also ran into this, and what I've deduced from the Stripe docs is that you can't apply a coupon directly to the redirectToCheckout method, you have to create a Checkout session first and then use that.
Add a discount to Checkout the sample code is calling Checkout.session.create, not Checkout directly
redirectToCheckout Reference Docs doesn't mention a discount or coupon parameter at all, and the sample code again is creating a Checkout session using fetch (to one's own server backend, which is where my expertise ceases and where I'm stifled), to generate a session ID and then passing that into the result where redirectToCheckout is called.

Get all DocuSign EnvelopeIds that originated from a powerform

Using DocuSign's REST API, is there a way to retrieve a list of all envelope Ids from an account where the envelopes have a completed status and originated from a specific power form?
I've tried using the follow call and still see all completed envelopes after 9/12 regardless of where they originated from:
GET https://demo.docusign.net/restapi/v2/accounts/1655678/envelopes?from_date=2016-09-12&powerformids=2fc0a56d-f6c7-4e96-be93-258d0c038e3c&status=completed HTTP/1.1
The best working solution I have now is to add a custom field to the envelope and filter on it using the custom_field parameter. This requires additional setup from users and is not optimal.
Thanks.
Have you looked at DocuSign Connect for this? If you setup a specific user for your Powerform, Connect can publish events to you for just the envelopes created from that user. Then you wouldn't even need to make calls to get the Envelope IDs (or even other information).
Your idea of adding a custom field on the template level is the best way to go. It will help return accurate results, though I would agree it adds some overhead/upkeep during template/powerform creation.
The powerformids parameter you are including in your sample is not a supporter parameter and is simply being ignored.

Resources