Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
<head>
 <meta name="author" content="Red Shepherd">
	<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/themes/prism-coy.min.css" />
	<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
</head>

<div style="float:left; padding-right:10px">
<img src="https://redshepherdmedia.s3-us-west-2.amazonaws.com/orangeLogo.png" style="width: 60px">
</div>

<div style="float:left;margin-top:8px">
<h1>Red Shepherd Demo Payment Widget</h1>
</div>
	
<br style="clear:both;"/>
<br/>
	
<h3>To Learn more about our Secure Payment APIs, Widgets and other Developer tools and to access a Free Sandbox account, please contact us.</h3>
<br/>
<h3>
Website 
<a href="https://www.redshepherd.com" target="_blank">www.redshepherd.com</a>
<br/><br/>
Email <a href="mailto:[email protected]">[email protected]</a>
<br/><br/>
<h3>
<br/>	
<hr/>
<br/>
<h3>To Test the Widget use the following Test card / ACH numbers <br/>and any amount less than $100</h3>
<br/>
<h3>Test Card 4111 1111 1111 1111  <br/> any valid expiration date</h3>
<br/>
<h3>Test ACH Account 1234567890 <br/>Test ACH Routing 121122676</h3>

<br /><br />

<button id="mainButton" class='rsWidgetButton'>MAKE DEMO PAYMENT</button>
<br/><br/><br/>

<h1>Integrating the widget is very simple</h1>

<br/><br/>

<h3>#1 Add these payment libraries to your script section</h3>
<pre><code class="language-js" style="padding:15px;">&lt;!-- Red Shepherd Encrypted card processor library --&gt;
&lt;script type='text/javascript' src='https://www.redshepherd.com/cdn/2.5.0/js/redpay.js'&gt;&lt;/script&gt;
</code></pre>

<br/><br/>
<h3>#2 Add this payment button to your code
	<br/>
	IMPORTANT: The class should be rsWidgetButton, you can use your own styles
</h3>
<pre><code class="language-js" style="padding:15px;">&lt;button id=&quot;mainButton&quot; class='rsWidgetButton'&gt;Pay $20.00&lt;/button&gt;</code></pre>
	
<br/><br/>
<h3>#3 Add this payment widget to your script section (bottom of the page)</h3>
<pre><code class="language-js" style="padding:15px;">&lt;!-- Red Shepherd Payment Widget script --&gt;
&lt;script 
  type='text/javascript' 
  src='https://www.redshepherd.com/cdn/2.1.2/js/widget.js' 
  data-class='rsWidget' 
  data-app='DEMO'
  data-key='MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAtsQxNp3vmKVNYIxfWSi0LIRgCnPaMn0MUNouxgrs4zmg4cnvSeQ3I8YP03YbpXuWA80RvOw/nWErYAKomniJw8Y+xexMfBQ5sgJgewn3ZnRPNM9Y4Z62gwfIlsrs7Bwvpz9uUtLgeQLl1ffNaumnu1IBrqRps0EZ1QyDuu41UckTyo31C40Wez6IbeMfZeusrmPlIWqyBacdviJ5zHCA3zHNq86QMnB8HOP1U81HOSs6GTTelhD7lCoJ+fHKHxcz0MDr37fNpKpC57B0/20wBXFp9tlVtSkHcIty1lyNk2/HDH8knCdqkZk+fCvWgGwdex41x8/rM+LKC13c5J/yG6Gb2PnKhwNk4lvvnz73YAdqTUJ7qNrdtWVnOTWfbMBiNlpBCVqt8xY8UK6u83AVWrWXse0xe2Pn/kRqlXmxWT0mGEoCavjvZ9lQUL7LXAXZ1dff9r+oFUZo6xDQ3ER/OTIKa4jpvaI9S/J1drsrI1f9kkMWFwEh48dCPYplGSxzAgMBAAE='
  data-payment-url='https://redpaystable.azurewebsites.net' 
  data-name='Tron Store'
  data-description='Online Order' 
  data-image='https://redshepherdmedia.s3-us-west-2.amazonaws.com/orangeLogo.png' 
  data-color2='#334657'
  data-color3='#292929'
  data-ach='true'
  data-card='true'
  data-zip='true'
  data-amount-edit='true'
  data-email='true'
  data-email-required='true'
  data-email-receipt='true'
  data-phone='true'
  data-phone-required='true'
  data-phone-receipt='true'
  data-id1='true'
  data-id1-name='Patient Number'
  data-id1-required='true'
  data-id2='true'
  data-id2-name='Patient Name'
  data-id2-required='true'
  data-font='Raleway'
  data-labels='true'
  data-webhook='https://redshepherd.com'
  data-redirect-success='https://www.redshepherd.com/'
  slim-mode='true'
  data-redirect-error='https://www.redshepherd.com/'&gt;
&lt;/script&gt;
</code></pre>
<br/><br/>	
	
	
<h3>#4 Change data-amount or set data-amount-edit to true (Amounts are in cents, $20.00 = 2000</h3>
<br/><br/>	
	
	
<h3>#5 Change data-image to point to your logo</h3>
<br/><br/>
	
	
<h3>#6 Change data-name and data-description to your Business name and order description</h3>
<br/><br/>	
	
	
<h3>#7 Contact us for your production API payment keys</h3>
<br/>	
	
<br/><br/>
<h1>Widget configuration options</h1>
	<br/><br/>
	<table class="guidetext">
	<thead>
		<tr>
			<th>Key</th>
			<th>Example</th>
			<th>Description</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>
				<span class="guidekey">data-app</span>
				<p class="required">required</p>
			</td>
			<td><span class="guideval">DEMO</span></td>
			<td>Unique APP Id of the business processing the payment. Contact us for your Id</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-key</span>
				<p class="required">required</p>
			</td>
			<td><span class="guideval">see sample code</span></td>
			<td>This is the unique Api key to your Account, Contact us for your prod api key</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-payment-url</span>
				<p class="required">required</p>
			</td>
			<td><span class="guideval">see sample code</span></td>
			<td>This is the gateway URL, Contact us</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-name</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">ACME Inc</span></td>
			<td>This is your Business name (optional)</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-description</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">Online payment</span></td>
			<td>This is an additional sub text describing your order / checkout (optional)</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-logo</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">https://yourlogo.com/..</span></td>
			<td>Your Business logo, prefer a square logo (optional)</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-color1</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">#404040</span></td>
			<td>Primary background HTML color code</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-color2</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">#334657</span></td>
			<td>Widget header HTML color code</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-color3</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">#292929</span></td>
			<td>Widget body HTML color code</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-ach</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Enable ACH Payments</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-card</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Enable Credit Card Payments</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-zip</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Capture Zip code during Card Payments for additional Zip code verification. We recommend setting this to true</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-amount</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">4000</span></td>
			<td>This value is in cents. If this is set, the widget will be setup to only accept this amount and the customer cannot edit it. This is a good setting for charging subscription fees as those are not customer editable but fixed by the business</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-amount-edit</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Setting this to true allows users to enter any amount they choose, great for donations, online bill payments where customers can pay partial payments</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-email</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Setting this to true allows the widget to ask the customer for their email address</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-email-required</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Is the email field required</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-email-receipt</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Email payment receipt to customer</td>
		</tr>
				<tr>
			<td>
				<span class="guidekey">data-phone</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Setting this to true allows the widget to ask the customer for their phone number</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-phone-required</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Is the phone field required</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-phone-receipt</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Text payment receipt to customer</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-id1</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Additional Reference field 1</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-id1-name</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">Patient name</span></td>
			<td>Reference field 1 Name</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-id1-required</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Reference field 1 is required</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-id2 ... 5</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Additional Reference field 2 ... 5</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-id2-name</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">Account number</span></td>
			<td>Reference field 2 ... 5 Name</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-id2 ... 5-required</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Reference field 2 ... 5 is required, Widget supports 5 business defined reference fields, use the same syntax as field1 above and replace 1 with 2,3,4,5</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-font</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">Raleway</span></td>
			<td>Master font for the widget, use Google Fonts for different options</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-labels</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Display labels on top of the inputs</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-webhook</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">https://thisismywebhook.com/payment</span></td>
			<td>Your url which will receive a POST message from the widget with the json response object, webhook will be triggered for all payment responses (success /fail / error / exception responses)</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-redirect-success</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">https://mywebsite.com/successpayment</span></td>
			<td>URL to redirect the customer to in case of a successful payment</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">data-redirect-error</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">https://mywebsite.com/errorpayment</span></td>
			<td>URL to redirect the customer to in case of a failed payment or error</td>
		</tr>
		<tr>
			<td>
				<span class="guidekey">slim-mode</span>
				<p class="optional">optional</p>
			</td>
			<td><span class="guideval">true / false</span></td>
			<td>Slim down the widget size</td>
		</tr>
	</tbody>
	</table>
	
<!-- Red Shepherd Encrypted card processor library -->
<script type='text/javascript' src='https://www.redshepherd.com/cdn/2.5.0/js/redpay.js'></script>

<!-- Red Shepherd Browser compatibility library
<script type='text/javascript' src='https://www.redshepherd.com/cdn/browserCompatibility.js'></script>
-->

<!-- Red Shepherd Payment Widget script -->
<script 
  type='text/javascript' 
  src='https://www.redshepherd.com/cdn/2.5.0/js/widget.js' 
  data-class='rsWidget' 
  data-app='DEMO'
  data-key='MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAtsQxNp3vmKVNYIxfWSi0LIRgCnPaMn0MUNouxgrs4zmg4cnvSeQ3I8YP03YbpXuWA80RvOw/nWErYAKomniJw8Y+xexMfBQ5sgJgewn3ZnRPNM9Y4Z62gwfIlsrs7Bwvpz9uUtLgeQLl1ffNaumnu1IBrqRps0EZ1QyDuu41UckTyo31C40Wez6IbeMfZeusrmPlIWqyBacdviJ5zHCA3zHNq86QMnB8HOP1U81HOSs6GTTelhD7lCoJ+fHKHxcz0MDr37fNpKpC57B0/20wBXFp9tlVtSkHcIty1lyNk2/HDH8knCdqkZk+fCvWgGwdex41x8/rM+LKC13c5J/yG6Gb2PnKhwNk4lvvnz73YAdqTUJ7qNrdtWVnOTWfbMBiNlpBCVqt8xY8UK6u83AVWrWXse0xe2Pn/kRqlXmxWT0mGEoCavjvZ9lQUL7LXAXZ1dff9r+oFUZo6xDQ3ER/OTIKa4jpvaI9S/J1drsrI1f9kkMWFwEh48dCPYplGSxzAgMBAAE='
    data-payment-url='https://redpaystable.azurewebsites.net'
		data-image='https://s3-us-west-2.amazonaws.com/s.cdpn.io/857760/red_logo.svg'
    data-name='Tron Store'
    data-color2='#334657'
    data-color3='#292929'
    data-ach='true'
    data-card='true'
    data-zip='true'
    data-amount-edit='true'
    data-email='true'
    data-email-required='true'
    data-email-receipt='true'
    data-phone='true'
    data-phone-required='true'
    data-phone-receipt='true'
    data-font='Lato'
    data-labels='true'
		data-amount-edit='false'
		slim-mode='true'>
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/prism.min.js"></script>
</html>
<!--
		data-id1="true"
    data-id1-name="Patient Number"
    data-id1-required="true"
    data-id2="true"
    data-id2-name="Patient Name"
    data-id2-required="true"
    data-image='https://s3-us-west-2.amazonaws.com/s.cdpn.io/857760/red_logo.svg' 
    data-webhook='https://redshepherd.com'
    data-redirect-success='https://www.redshepherd.com/'
    data-redirect-error='https://www.redshepherd.com/'
-->
              
            
!

CSS

              
                *,
*:before,
*:after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	padding: 50px;
	background-image: linear-gradient(to bottom right, #dff0f1, #bdccd1, #72add7, #3eb5cb);
	background-size: 100% 10000vh;
	background-repeat: no-repeat;
	font-family: 'Montserrat', sans-serif;
	letter-spacing: 1px;
}

#mainButton {
	color: white;
	border: none;
	outline: none;
	font-size: 24px;
	font-weight: 200;
	overflow: hidden;
	position: relative;
	border-radius: 2px;
	letter-spacing: 2px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
	text-transform: uppercase;
	background-color: #00a7ee;
	-webkit-transition: all 0.2s ease-in;
	-moz-transition: all 0.2s ease-in;
	-ms-transition: all 0.2s ease-in;
	-o-transition: all 0.2s ease-in;
	transition: all 0.2s ease-in;
	padding: 8px 25px;
}
#mainButton .btn-text:hover {
	cursor: pointer;
}
#mainButton:after {
	top: -50%;
	z-index: 1;
	content: "";
	width: 150%;
	height: 200%;
	position: absolute;
	left: calc(-150% - 40px);
	background-color: rgba(255, 255, 255, 0.2);
	-webkit-transform: skewX(-40deg);
	-moz-transform: skewX(-40deg);
	-ms-transform: skewX(-40deg);
	-o-transform: skewX(-40deg);
	transform: skewX(-40deg);
	-webkit-transition: all 0.2s ease-out;
	-moz-transition: all 0.2s ease-out;
	-ms-transition: all 0.2s ease-out;
	-o-transition: all 0.2s ease-out;
	transition: all 0.2s ease-out;
}
#mainButton:hover {
	cursor: default;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}
#mainButton:hover:after {
	-webkit-transform: translateX(100%) skewX(-30deg);
	-moz-transform: translateX(100%) skewX(-30deg);
	-ms-transform: translateX(100%) skewX(-30deg);
	-o-transform: translateX(100%) skewX(-30deg);
	transform: translateX(100%) skewX(-30deg);
}

.guidekey {
	font-size: 1.3em;
	font-family: monospace;
	background-color: #fff;
	border-radius: 5px;
	border: 1px solid #c2c5e2;
	padding: 4px; 8px;
	display: block;
	white-space: pre;
}
.guideval {
	font-size: 1.3em;
	font-family: monospace;
	border-radius: 5px;
	border: 1px solid #c2c5e2;
	padding: 4px 8px;
	display: block;
	white-space: pre;
}
.required {
	font-weight: 600;
	font-size: 0.8em;
	margin-top: 4px;
	margin-left: 4px;
	color: rgb(226, 71, 71);
}
.optional {
	font-weight: 600;
	font-size: 0.8em;
	margin-top: 4px;
	margin-left: 4px;
	color: #606060;
}
.guidetext {
	font-size: 1.1em;
}

table {
  width: 99%;
	border-color: #fefefe;
	border-size: 1;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
	vertical-align: top;
}
th,
td {
	font-size: 1em;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.2);
  color: #202020;
	vertical-align: top;
}
th {
  text-align: left;
}
thead th {
  background-color: #358ccb;
	color: #fff
}
tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.3);
}
tbody td {
  position: relative;
}
tbody td:hover:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -9999px;
  bottom: -9999px;
  background-color: rgba(255, 255, 255, 0.2);
  z-index: -1;
}

              
            
!

JS

              
                
              
            
!
999px

Console