Professionally style a stripe elements credit card input form using stripe elements CSS? - stripe-payments

I am in need of any standard way of making the Stripe credit card input form from the Stripe docs look professional. Here is what it looks like with nothing done to it:
Stripe docs talk extensively about 'Stripe Elements' - a set of CSS that allows for easy styling - the problem is I have no idea how to apply it to this form.
Stripe give an example, but it doesn't work, and their IRC currently is down
Here is the code for the form, which is straight from the Stripe docs (functionally, it works great, it just looks drab):
<form id="payment-form">
<div id="card-element">
<!-- Elements will create input elements here -->
</div>
<!-- We'll put the error messages in this element -->
<div id="card-errors" role="alert"></div>
<br>
<button id="submit">Pay</button>
</form>
I would like it to look like the one in the docs (note that mine doesn't have an email field, but is otherwise very similar):

I got it looking half respectable through trial and error of the different classes found in the stripe example, some bootstrap classes, and form border from here. I'm sure there are (much) better looking forms, but here's what this results in:
<div class="col-lg-4">
</div>
<div class="col-lg-4">
<form id="payment-form">
<label for="card-element">Credit or debit card:</label><br>
<div id="card-element" class="form-control" style='height: 2.4em; padding-top: .7em;'>
<!-- Elements will create input elements here -->
</div>
<!-- We'll put the error messages in this element -->
<div id="card-errors" role="alert"></div>
<br>
<button id="submit" class="btn btn-lg btn-primary btn-block">Pay</button>
</form>
</div>
<div class="col-lg-4">
</div>

Related

Angular 8 Button type="file" does not open dialog for file selection

Recently a new bug came up which disabled the output window of the file select dialog.
<!-- shown in Maximilian Schwarzmuller Angular & NodeJS - The MEAN Stack Guide -->
<form [formGroup]="form" style="width: 100%">
<div class="row" [ngStyle]="{'height': editing[0] ? 'fit-content' : '200%'}">
<div class="col-12 d-flex justify-content-center" *ngIf="editing[0]">
<button mat-button [color]="'edit-color'" type="button" (click)="image.click()">Add Image</button>
</div>
<input type="file" (change)="onImagePicked($event)" (click)="clicked()" #image>
</div>
...form of image display...
</form>
whenever i call a click event in the mat-button it always gets called, same as in type="file", but the dialog in which i should select a file is never opened.
I assume the problem stems from this page being inside a mat-dialog, which is probably somehow conflicting with the browsers internal dialogs.
for now error has been seen in chrome and safari in development and production.
I am searching for a way to open a file dialog(browser) in my current page architecture.
Strange enough the issue wasn't the dialog. It was a click event called in html a bit higher up.
<h2 matRipple (click)="hamburgerClicked = !hamburgerClicked">
<i class="fas fa-bars" mat-icon-button aria-label="Close dialog"></i>
</h2>
i just changed it to a function
<h2 matRipple (click)="clicked()">
<i class="fas fa-bars" mat-icon-button aria-label="Close dialog"></i>
</h2>
and it works like a charm.

Stripe form not showing properly

My Stripe Form isn't showing properly. Here is the screenshot.
I included the stripe script tag in my head tag. Added the form and the css and javascript per instructions in stripe docs.
I thought maybe some other links or scripts are overwriting the stripe script so I tried to uncomment them, but nothing changed the stripe form.
I also made sure than my classes aren't overwriting each other.
<head>
...
<!-- Stripe -->
<script src="https://js.stripe.com/v3/"></script>
...
</head>
<body>
...
<form action="/charge" method="post" id="payment-form">
<div class="form-row">
<label for="card-element">
Credit or debit card
</label>
<div id="card-element">
<!-- A Stripe Element will be inserted here. -->
</div>
<!-- Used to display form errors. -->
<div id="card-errors" role="alert"></div>
</div>
<button>Submit Payment</button>
</form>
...
</body>
Figured it out. I just ended up making my own styles tho it took some time.

Easy start with BlueSnap hosted payment fields;

Hi – I'm looking for a simple script I can Copy&Paste into my website so I can start selling with BlueSnap's HPF fields.
The form should include the most basic elements needed to get the token back and charge the shopper, I'm not looking for any design, just functionality.
I have the basics - but I need to see how this would look like if it was done:
<form id="checkoutForm">
<div>
<label>Full Name:</label>
<input type="text" id="fullName">
</div>
<div>
<label>Card Number:</label>
<input type="text" id="cardNumber" data-bluesnap="ccn">
</div>
<div>
<label>Security Code:</label>
<input type="text" id="securityCode" data-bluesnap="cvv">
</div>
<div>
<label>Expiration Date (MM/YYYY):</label>
<input type="text" id="expirationDate" data-bluesnap="exp">
</div>
<button type="submit" id="buynowButton">Buy Now</button>
</form>
Can anyone help me with that?
In order to implement BlueSnap Hosted Payment fields all you need to do is
plnkr simple example link
Obtain the Hosted Payment Field token for the session
Add the BlueSnap JavaScript file to your checkout form
<script type="text/javascript" src="BLUESNAPDOMAINPATH/services/hosted-payment-fields/v2.0/bluesnap.hpf.min.js"></script>
Add the Hosted Payment Fields to your checkout form
<div data-bluesnap="ccn"></div>
<div data-bluesnap="exp"></div>
<div data-bluesnap="cvv"></div>
Add a script to initiate the Hosted Payment Fields with your Hosted Fields token
Add a script to submit credit card, expiration date and CVV data

How do I localise the strings used by the Azure API Management Developer Portal ?

I can't seem to find a way to edit the localised strings using the provided template editor , does anyone have any pointers on this ?
For example if I wanted to change the text 'search products' to something else for example... Where/How can I edit the template and its data ?
Thank you
Le Roi
The ugly way to do this:
Edit the template, remove the
<search-control></search-control>
And add a custom text to the input placeholder
<div>
<form action="/Products" class="pull-right" method="get">
<input type="hidden" name="startEditTemplate" value="ProductList">
<div class="form-group has-feedback">
<input placeholder="My Custom Search products" id="pattern" type="search" class="form-control" name="pattern" spellcheck="false">
<button class="glyphicon glyphicon-search form-control-feedback ap-ininput-button"></button>
</div>
</form>
</div>
The bad part about this is that you are now responsible for updating this piece of code and template.

Is there any way to control/route content by referrer value in Expression Engine?

Let’s say that I have a carousel on my index page.
Inside the template for index, it loads a particular channel, “Foo”
<div "slider">
<ul class="slides">
{exp:low_reorder:entries set="foo" dynamic="no"}
<li class="foo_{entry_id}">
<div class="container">
<div class="row-fluid">
<div class="span12">
{foo_html}
<style type="text/css">{foo_css}</style>
</div>
</div>
</div>
</li>
{/exp:low_reorder:entries}
</ul>
</div>
That channel, naturally, has a list of content items
I want the list of content items displayed to exclude one of the items in the channel if the referrer is not bing.
Can anyone show me the way that they would go about accomplishing that? I'm not getting any traction on the ellislab forum.
I whipped up a plugin for you, which you can find here
You can wrap the item in a conditional using that plugin to check if it should be output.

Resources