Skip to content

Instantly share code, notes, and snippets.

View MarkCheshire's full-sized avatar

Mark Cheshire MarkCheshire

  • Red Hat
  • Barcelona, Spain
View GitHub Profile
@MarkCheshire
MarkCheshire / Paid APIs with 3scale and Stripe.md
Last active October 22, 2023 01:50
3scale with Stripe make it explicit to edit Credit Card details
  • 3scale API Management includes an easy integration with Strip to monetize your API
  • Default Developer Portal templates cover most needs
  • See general tips to configure a credit card workflow in your Developer portal
  • If you want to further customize the integration this is easy. For example to make it a separate explicit step to edit the credit card details from other payment information such as the invoice address:
  1. Add a new page for the intermediate step to only edit invoice address:
  • Create a new page in the CMS e.g. /account/edit-payment-address
  • In advanced options enable Liquid.
  • Paste in the file from A) below
  1. Modify the existing edit payment details page (optional if you want to remove the address edit form or the previous stored credit card details)
@MarkCheshire
MarkCheshire / 0_reuse_code.js
Created August 7, 2014 11:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@MarkCheshire
MarkCheshire / invoices3scale.rb
Created August 4, 2014 09:30
3scale utility to export invoice data into an XML file
require 'restclient'
require 'nokogiri'
# Access details to the 3scale API are grabbed from environment variables for security
DOMAIN = ENV['DOMAIN'] # Admin domain in the form: mydomain-admin.3scale.net
PROVIDER_KEY = ENV['PROVIDER_KEY'] # From your 3scale account page in the admin console
def invoices_for_month(month)
done = false
<script src="/active_docs/application.js" ></script>
<link href="/active_docs/application.css" media="screen" rel="stylesheet" />
<div class='api-docs-wrap'></div>
<script>
{% comment %}
// if you are hosting you specs elsewhere, load them by:
ThreeScale.APIDocs.host = 'https://{your-own-server}';
{% endcomment %}
$(function(){ ThreeScale.APIDocs.init([]); });
</script>