Shopify Graphql API - draftOrderCreate redirect to Checkout with Discount Code Field - graphql

If you are familiar with Shopify draftOrderCreate API, you know that when retrieving the invoice_url via the graphql mutation, it will redirect you to the checkout page but there will be no DISCOUNT CODE Field, and Shopify docs are clear with this, but upon checking some apps (https://apps.shopify.com/draft-helper) it is possible, but on the said app, you will manually generate the checkout link.
Here's a photo of what that app is doing
I am wondering how do i integrate this automatically via graphql. When checking the Console (Network) it seems like he is only passing the draft order id as payload.

When you create a Draft Order, you can provide a discount. So if you do that, and then send the invoice, the discount should be applied correctly.

Related

Fetch Public App Details Using Shopify Storefront API

I have one scenario where I want to access third-party apps/public apps(shopthru) data using Shopify storefront API.
In my case, I am using shopthru app and I want to fetch data about the created campaign, campaign conditions (like discount for specific walletaddress, or POAP NFT).
I want to know if is it possible to get third party app / public app details using shopify storefront API.
This is not possible. Shopify Apps doesn't integrate and extend Shopify Storefront API. You can try to find out what URL of app is by inspecting iframe, pull out accesstoken from your request and using curl try to extract data but this is very hackish and unstable way.
Other option would be to contact App Developer and ask him to expose some endpoints.
If App is changing your store behavior, you can try to fetch data using GraphQL Admin API and find desired details in discounts object:
https://shopify.dev/apps/discounts/existing
https://shopify.dev/api/admin-graphql/2022-10/queries/codeDiscountNode

Google Analytics Issue for Magento to PayPal

So, having discovered that customers are not returning to our website after making their PayPal payments, our Google Analytics reports are wonky as the landing page (success.phtml) which generates the order completion history/goal is never achieved.
Is there a PayPal APi callback to Magento which can generate the correct Google Analytics data? Is there a way to generate GA code at the PayPal end?
Any pointers appreciated!
Thanks, Joe.
a better question for you is why are your customers not reaching the success.phtml?
Go to Website Payments under Profile on the PayPal website. Setup your return URL and enter the succes url there...
If your customers don't return because they close their browser before returning to the shop:
You could remove the script from success.phtml and add a serverside-call to GA using something like serversidegoogleanalytics but you'll have to implement this for all paymentmethods you are accepting... This serversidecall would be done in the success-action within the controller of the paypal module

Other possible ways to integrate 2checkout payment gateway

Is there any way to implement the checkout process aside from the ones found on the 2checkout site? I would like to have my own checkout page in my website and just pass the data to 2checkout instead of redirecting it to 2checkout's checkout page using the inline method.
2Checkout is currently in the process of beta testing their new checkout API solution which allows you to create a token from the card details client side and then submit the token server side with an API call to create a new sale. It sounds like you would be a great candidate for 2Checkout's API beta program. A ruby library and full documentation will be provided to you once you signup.
I think 2checkout sites ruby example has what you are looking for,
see here, or check out this rubygem

How to provide gift card code automatically to user who likes product on the magento based ecommerce site

Is there any way to link face-book like feature with the magento gift card code. Like if any user/visitor likes any product on the site then store administrator want to sent gift code automatically to that user. This should happen automatically without involvement of any manual process.
Thanks,
Rather than sending a gift card code, you should generate a one time use coupon code and send them that.
In terms of tracking the Facebook like, you can use Facebook's FB.Event.subscribe method which is a part of their JavaScript SDK. A simple snippet will allow you to listen for a "like" event, the SDK will then provide you with a callback containing the URL liked (the current page). You can pretty much do whatever you want from there.
Everything you need should be here: Facebook JS SDK

Google Checkout - Force callback URL API post

I'm building a Magento cart and we set up Google Checkout and went live and unfortunately I was unaware of the 'API Callback URL' setting on the Google side and didn't have that filled in until now. So now we have a few orders that went through and I need to get them into my cart system so I'm wondering if there's a way to force post existing orders across to my system?
See this document for various ways to retrieve Googe Checkout notifications.
http://code.google.com/apis/checkout/developer/Google_Checkout_Beta_Polling_API.html
In your case try the Polling API or the Notification History API.

Resources