Skip to content

Instantly share code, notes, and snippets.

@matthewarkin
Last active April 12, 2016 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewarkin/99b49511ac5083d1998c to your computer and use it in GitHub Desktop.
Save matthewarkin/99b49511ac5083d1998c to your computer and use it in GitHub Desktop.
Commence Docs

#Welcome to Commence

Commence makes adding payments to your website as easy as copy and paste, no server-side code needed.

To use commence you simply need to add a script tag to your website:

	<script src="https://commencepayments.com/js/commence.js"></script>

Then to make the button useable you can add the following configuration attributes to it like:

Then wherever you like the payment button just add a button

<script src="https://commencepayments.com/js/commence.js">
      data-key= "pk_test_OZwJfcF4YXzwNdYj8isCwTmx"
      data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
      data-name="Demo Site"
      data-description="2 widgets ($20.00)"
      data-amount="2000">
</script> 

Clicking the button will open Stripe Checkout. Commence supports most Stripe Checkout customization options, if you would like to customize it more than we currently support, just send us an email, we'd be happy to work with you.

Here are the Stripe Checkout options we support:

data-amount: The amount (in cents) that's shown to the user. This is the amount that will be charged to the user. 	
data-description: The description of the product or service being purchased.
data-currency: The currency of the amount (3-letter ISO code). The default is USD.
data-image: A URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
data-name: The name of your company or website.
data-label: The text to replace "Pay With Card"
data-panel-label: The text you would like on the big bottom on the bottom of the pop-up.
data-description: Text that appears under the name, also gets added to the customer / charge description
data-billing-address: Customer's billing info
data-shipping-address: Customer's shipping info

There are a couple more attributes to the button:

data-type: Always leave this set to CommenceButton, if not, Commence won't work.
data-key: This is your API key provided once you register with Commence. It's available on your account page.
data-redirect: The url that users will be redirected to on successful payment
data-plan: The plan id to subscribe the user to.
data-save-as-customer: If specified will create a customer and save the card, and then charge the customer. Default false
data-setup-fee: an amount in cents. This amount gets set as the customer's starting balance and thus added to their first invoice.

If at anytime you need support, just email support@commencepayments.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment