Building a simple web form that connects to Recurly's API to allow a subscriber to change their subscription plan - rest

I am trying to build a simple web form that would ideally sit on a WordPress page to allow the subscribers on our platform to change or update their subscriptions, without having to ask our support team (currently they can only cancel, but we want to offer them the option to upgrade).
We use Recurly to manage our billing, and their support team said:
'You would essentially want to build a form that will input values into the Subscription Update API request, that would then be sent to Recurly to make the changes on your customer account.'
They also shared the following document: https://dev.recurly.com/docs/update-subscription
I have limited experience of working with APIs and am also aware that because this form deals with sensitive information (the user ID of a subscriber in this case), I don't want to inadvertently jeopardise the accounts of the subscribers that choose to do this.
Any help would be much appreciated. I have tried searching for a solution but am unsure how to word my request effectively.

It sounds like using the Recurly Hosted UI might be your best bet. Instead of having to build a a web form you can just redirect your customer to the Recurly Hosted UI on a button click. You can retrieve and redirect the url using the Recurly API on your Wordpress site using some simple PHP and then that allows the customer to view invoices, change their plan (if you allow), and change CC information.

Related

Does SendGrid support double opt-in as a feature?

Does SendGrid support double opt-in to Lists as a feature or is that something we will have to implement for ourselves?
https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/add-recipients
It doesn't appear to me to be anywhere in the docs, but I thought I'd ask in case I missed it.
Not as of the current date; I asked their support staff and received the following answer:
Double opt-in needs to be implemented by you in the form/page you're subscribing your recipients. The confirmation email can be sent through SendGrid.
For Marketing Campaigns we have the SendGrid’s WordPress Subscription Widget that makes it easy for people visiting your WordPress site to subscribe to your marketing emails;
or Building a SendGrid Subscription Widget.
I got this answer from their support. It turns out we have to implement it by ourselves.
The double opt-in functionality is not something SendGrid provides as
we expect our customers to handle any opt-in practices on their side.
We apologize for any inconvenience.
SendGrid will be GDPR compliant by May, 25, 2018. Please note that
SendGrid does not – and does not currently have plans to – use servers
or data centers in the European Union to process email. Thus, SendGrid
cannot restrict data to the EU. However, neither current EU law nor
the GDPR require this. Instead, what is required is that SendGrid must
provide "appropriate safeguards" for data that it hosts and processes
on its US servers (see Art 46 of the GDPR here). SendGrid offers a
Data Processing Addendum (DPA) to provide such adequate safeguards,
which includes provisions for when GDPR goes into effect.
More info on GDPR can be found here. Our DPA can be reviewed and
signed by filling out the information here.
They do not support it. I asked support many times, which is a strange as it would seem a company of that size could spare the dev resources to build a feature that literally all of their customers need.
However, https://sgwidget.com is a third party product that provides double opt in functionality for Sendgrid accounts.
Full Disclosure: I am a developer at SG Widget.
No, indeed still today, they do not. Not in their forms, nor in their API is there simple, flip-switchable support for double opt-in. But, with email automation fairly recently implemented in their marketing services ("free" and "advanced" plans, not "essential") you can send an automated email directly upon sign-up.
My solution is to have 2 lists for new contacts, where one is a "pre-confirmation" list and the other being the "real" list. Here´s a way to use automation:
Create initial signup form, either via their sparse Web forms or via your own, using HTML/JS/PHP and API endpoint:
Create 2 separate lists, one for "pre-confirmation" emails and the other for people who confirm their addresses.
Make the form sign up new contacts to the first list, "pre-confirmation".
Create a marketing automation flow that triggers upon new signups to the "pre-confirmation" list. Make the automation trigger an email that contains a button or a link with the following link structure:
https://yoursite.com?email=user#email.com&passphrase=[phrase-you-set-manually]
where ?email= is your user´s email, substitute this in the email template/design by {{ Sender_Email }}
where &passphrase= is a phrase long enough to not be guessed. Since you only have one single email design here, and you can only enter one single phrase, unless you make a script or a hash, you make it difficult enough for people to think it was generated by a server :).
On your server/application, yoursite.com, use $_POST['email'] and $_POST['passphrase'], or whatever you name them, to validate the email clicks from your list and then enter all validated emails to the correct list using the PUT
/marketing/contacts endpoint.
you may also have to delete the user from the previous list, using DELETE
/marketing/lists/{id}/contacts, but I do think that the PUT /marketing/contacts takes care of placing the contact in only the lists specified in the list_ids field.
once the contact has been entered into the correct list, you can also have a marketing automation set up for that list, which sends him/her a welcome message.
This method takes care of double opt-in for SendGrid without using one single email credit from the Email API (transactional plan). The only catch is that we utilize one initial and one second/final list to achieve it.
Note: the initial sign-up message that here acts as the "confirm your email" message, will be tied to the first list and will require a marketing unsubscribe link in the footer. Make it clear in the bottom of the email that it is a temporary list, to not get any spam complaints. But it will not be an issue, as we wont be sending to anyone in that list except for this initial time. Unless you have a user who enters his/her email twice, after some time of inactivity when they forgot they already signed up. That could happen. But it´s a separate issue.
I think this is possible by switching the flow of a typical email subscriber. When the user clicks your subscribe button, instead of calling the sendgrid members/contact PUT api to add to your list, send an email with a link to a URL of yours that will then trigger the members/contact PUT api call.
Not sure what stack you are using but I was able to build something like this with next.js utilizing their api routes

I would like to create a script for collecting multiple subscription requests and generating an e-mail notification

We have an existing website that is built on DNN. I would like to add a script to an existing page that collects a user's request for to subscribe to various e-mails we publish and then to generate an e-mail that idenfies those requested newsletter subscription titles. Any ideas?
Data springs has some good subscription tools available, check out their suite of modules.
If you want to just collect names and email addresses with a request, the DNN Form and List module will work just fine.
If you just want a "subscribe to our newsletter" type of link on your page, you could couple that with a modal popup that shows the form when the link is clicked(Here is an excellent tutorial: http://www.dnncreative.com/Tutorials/DNNTutorialsforAdministrators/EasilycreatePopupsusingdnnModalshow/tabid/679/Default.aspx that will show you how to do it.)

Questionary and user oriented CMS with subscription support

I'm looking for the CMS to run subscription service.
customer signs up and fills in preliminary question-form
customer can subscribe to receive informations based on the question-form and other question-forms filled periodically
admin is able to create new question-forms, send it to specific customer and based on his response send him an information
customer can see the admin's response in his dashboard
Some of the key features are:
user management
subscriptions support (Paypal, payment cards)
JSON API to connect the mobile iOS/Android application to the system
analysis atc.
I know there are Drupal and Joomla or commerce systems like Magento. But is there any CSM that will fit my needs?
I think that correctly modified WordPress would do the trick.
You will have to extend it's functionality with plugins. There are some nice ones for PayPal subscription and advanced Q forms making. Built in functionality will allow you to manage users and additional plugins of either your or others authorship will allow you to easily connect with JSON POST/GET requests depending what your specific needs are.
WordPress is very neat, has a great developing community, and you may create beautiful designs with it.
But system like Joomla is also very "customizable", with enough time spent you will have the features you need.
I'm sorry if that's not what you were looking for, but there will never be a 100% match to features you have specified.

Automate distribution of redemption codes for Custom B2B app

I have built a Custom B2B app for one of our clients. My question is how to automate the distribution of the redemption codes.
I have already looked at some of the MDM providers. Their solutions are too expensive and all we really need is a way to distribute the app from a webserver, not manage a bunch of mobile devices.
As you probably already know, when a client buys a Custom B2B app through the Apple VPP program, they get a spreadsheet with valid redemption codes for the number of licenses they have built. This spreadsheet has 2 columns: 1) redemption code 2) URL to redeem the code
I want to provide my client with a URL where they can send their users to download the app. They just don't have the expertise/infrastructure to distribute the app themselves. And emailing clients is not going to work.
I'm not a web guy, but it seems to me that we could write a webpage that would look at the spreadsheet for the next available activation code and then redirect the user to the associated URL. I'm not concerned with the number of licenses they distribute since I have another way of auditing the real number of users (Flurry). So I want this to be as painless as possible.
In fact, I have multiple clients and want to provide them each with their own URL for their clients. It seems like this shouldn't be too difficult to code.
The problem is, I'm not the guy to write that code. Any ideas on how best to do this?
Assuming that you don't want to show the user a website you should be able to do this with an online service like parse.com and the features it offers.
From a user POV you would supply them with a link which directed them to parse.com with a path and parameters indicating the action to be taken (get app) and what account is associated. This would redirect the users browser to the appropriate destination.
The main issue (and this applies to any solution) is knowing if the user actually followed through and used the code. i.e. should it be removed from the DB so it isn't offered to another user in future. Then you would update the DB each time you get a new spreadsheet.
Anyway, this could be achieved with a little javascript in parse.com, specifically, by using cloud code which can interrogate and modify the DB and then redirect the user.
Obviously if you need user authentication of some kind or other restrictions then you would need to start adding some web interface on top of this in order to collect the details.

How to generate unique payment URL using Paypal?

I'm trying to work out how I can generate a unique payment token that I can redirect users to so they can pay for a digital item.
I think the Button Manager SDK is what I need. However, I can not see how I can set the receiver email? For a particular item, there is a different receiver and I want to dynamically set this.
However, it seems I just have to set my credentials as the receiver. I want to use many receivers for different items rather than one sdk config file.
What I currently use is simply a HTML Paypal button but I'd rather dynamically create a unique URL to redirect a user to stop users tampering with things.
Have you considered the Express Checkout API? -- (perhaps with SOLUTIONTYPE=Sole to allow guest checkout?)
I believe it's a better tool for this job; token redirection is a core feature of EC.