Skip to content

Instantly share code, notes, and snippets.

@sadam1807
Created October 30, 2019 15:27
Show Gist options
  • Save sadam1807/bca6d2154672c6f7d79e8004f68b51a5 to your computer and use it in GitHub Desktop.
Save sadam1807/bca6d2154672c6f7d79e8004f68b51a5 to your computer and use it in GitHub Desktop.
import React from 'react';
import config from '../Utils/paymentForm';
const Square = ({ paymentForm }) => {
paymentForm = new paymentForm(config);
paymentForm.build();
const requestCardNonce = () =>{
paymentForm.requestCardNonce();
}
return (
<div id="form-container">
<div id="sq-card-number"></div>
<div className="third" id="sq-expiration-date"></div>
<div className="third" id="sq-cvv"></div>
<div className="third" id="sq-postal-code"></div>
<button id="sq-creditcard" className="button-credit-card" onClick={requestCardNonce}> Pay £ 1.00</button>
</div>
)
}
export default Square;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment