Authorization and charging flow with Shopify - asp.net

I am developing an addon for Shopify platform and using the Shopify NET library I have managed to authorize the user shop and gather some data.
Now I need to charge the usage of the Addon with a monthly fee (providing 7 days trial) but I cannot figure out the flow I must follow.
I guess that I have to call Recurring Application Charge API after the user authenticates (at the callback from the authorization URL) and if the user declines the charge then I have to log him out. Is that correct?
Do I have to care for providing 7 days trial by myself or the Shopify RACharge API with manage it by itself?
What do I have to do when the user cancel the subscription or freeze it?
Can anyone point me out a document that analyze the charging flow except the Shopify Billing API which is not that helpful after all?

First question, you're right. You either have to log out the user or you just let him authed without permission to see some views or all of them.
There's a propperty on Recurring Application which allows you to define the days of the trial: "Number of days that the customer is eligible for a free trial.", so Shopify handles this for you.
When user cancels a subscription or his store is put on "frozen" status, you should make sure he doesn't have access to your App functionalities, though if it's frozen, he won't even be able to log into his store.

Related

BuildFire: Tracking Commerce and Conversion Analytics

I am attempting to track certain events in Buildfire's platform and have a few questions. I've integrated Firebase into a plugin not using the Buildfire API but by following Firebase's steps to integrating with a web app.
I'd like to be able to register the following events but don't see them mentioned in the Buildfire Wiki:
When a user signs up (creates an account) on an app - I believe Firebase registers users anonymously the first time they use an app since Firebase has been integrated but was wondering if there was a signup event when a user actually creates an account to distinguish between people who view the app and those who create an account
Paywall view (when a user tries to see premium content and is directed to the paywall).
When a user subscribes to a paid plan - additionally, I'd like to access the subscription information such as the price of the subscription.
These events would help drive funnels and deliver better conversion rate statistics. I've looked but just haven't found the documentation related to tracking these events within Buildfire. I've looked at the getUser methods under Authentication in Buildfire's API but don't see any user information returned regarding subscriptions.
Any information would be appreciated!
There are many ways to accomplish what you are looking for. I'll try to describe several so you can pick the method that best suits you.
Use the BuildFire integration with Firebase. This doesn't really change much on your implementation. However, you now will have the BuildFire Auth Servers sending your Firebase server, secure user information along with User Tags. If you have the user tagged when they view premium content, then you can run queries on this directly in firebase.
https://github.com/BuildFire/sdk/wiki/Buildfire-Firebase-Integration
Send your Analytics to BuildFire. This way you have one spot to view the users' journey
https://github.com/BuildFire/sdk/wiki/How-to-capture-Analytics-for-your-plugin
For more advanced analytics and funnel creation you can send your analytics to BuildFire and use BuildFire's integration with Segment.io which will allow you to pipe the data into your database, google analytics, mixpanel, or anyone of the hundreds of integrations they have.
https://learn.buildfire.com/en/articles/3225298-how-to-integrate-segment-with-your-app-for-additional-analytics

How do you apply for a refresh token in the LinkedIn API?

We have a client application that runs on Windows that is used by thousands of users in the financial market in order to make analyses and charts. Since long we have an integration with Twitter where you can easily post a chart together with short text. Many users have asked us to implement a similar feature for LinkedIn since this is becoming increasingly popular among our users.
The API for sharing on LinkedIn works fine for us, but we need to refresh the access token every 60th day, which cannot be made completely seamless for the user. Since our application is not a web app, we need to launch a browser on order to refresh the access token and this is disruptive for the users.
The docs at Authorization Code Flow (3-legged OAuth) says that some selected partners can get refresh tokens as a complement to access tokens. That would be perfect for our integration. How can we become one of those "partners"? I have not found any information how to apply for this.
I have looked for a way to apply to become a partner that can get a refresh token, but failed to find any information.

Can I trigger google analytics events for a user from different environments?

We are trying to have a full view of user journeys through the web application we are developing. In the middle of the journey, there's no problem because it's more or less a traditional web application, but the beginnings and the end are not usual.
The journey begins with us sending email to the customers (don't worry, it's not spam). Is it possible to send events to Google Analytics about email being sent? I can include the UserID in those events. If I then implement user id in my web application, would I be able to correlate emails send to website visits?
At the other end of the journey, the conversions don't happen by the user that's being coverted but by a manager manually marking the user as converted in a sort-of admin-side to the web application. Can I then again inject the event that the user was converted with the appropriate UserID? Will Google Analytics then be able to map the whole journey? Do I need anything else?
The goal is for those events to end up mapped in the charts that look like this:
You'll need to do what you're asking in a CRM.
That said, I think what you CAN do is use campaign tracking and track the links in the email sent to the users. This way you'd know if they've acted on the emails or not.
Then you'd be able to track them on your site when they interact with the email. If there are CTAs on your site for the users to contact a manager to be converted, then you can track those as events, then set up goals around these events to see conversions.

Charge user on a per month & per post basis for directory

I'm looking for a way to charge users to post to a directory site.
I've tried using the WPMU Dev directory plugin, but it didn't have this feature.
You could either charge a one time fee per post, or you could charge a monthly rate.
Oh, and for now the gateway would be PayPal.
Cheers.
There are a number of ways you could do that on the PayPal platform, but with the limited info I have here I would probably recommend the Adaptive Payments API, specifically Preapproval and Pay.
Using Preapproval, you would have users create a preapproval profile which gives you authentication to make payments on their behalf without further approval. This way you could take payments based on any trigger you want, be it a post, a specific date coming up, or whatever.

Tridion profiling/tracking

We're looking at a requirement to track a users journey through a Tridion-managed website, then be able identify this user as a "prospect" based on this behaviour and then trigger an email to this user if they dont return after X number of days.
Can SmartTarget "track" a user journey between pages out-the-box or would it require some sort of custom Ambient Data Framework cartridge?
The older P&P module did this kind of tracking but I don't recall there being away to use that data in an Outbound Email triggered mail - so send an email when a tracking count for user got above a certain figure?
Cheers
SmartTarget nor P&P is not going to help you here.
Because your requirement is sending an email you need you user to be an audience manager user,
you could do the tracking in ADF and then have that update an extended detail for the user when the threshold is reached,
Create a Dynamic Distribution list on the ext. detail en create a triggered mailing on that list
To do this "out of the box" is a long standing wish of mine, might be possible in the future :)

Resources