Skip to content

Commit 9aaf833

Browse files
committed
updated gpay button
1 parent 9e87d80 commit 9aaf833

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

google-apple-pay-demo.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ <h4 class="text-center my-0">Google & Apple Pay Demo</h4>
102102
</div>
103103
<div class="google-pay-support">
104104
<div class="col-0">
105-
<button id="google-pay" class="btn btn-light border px-5" type="button">
105+
<!--<button id="google-pay" class="btn btn-light border px-5" type="button">
106106
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b5/Google_Pay_%28GPay%29_Logo.svg" style="width:2rem"/>
107-
</button>
107+
</button>-->
108108
</div>
109109
</div>
110110
<div class="apple-pay-support col row align-items-center">
@@ -169,11 +169,20 @@ <h5 class="modal-title">Your Payment Was Successful!</h5>
169169
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
170170
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
171171
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.20.0/prism.min.js" integrity="sha256-3teItwIfMuVB74Alnxw/y5HAZ2irOsCULFff3EgbtEs=" crossorigin="anonymous"></script>
172+
<script
173+
src="https://pay.google.com/gp/p/js/pay.js">
174+
</script>
172175
<script src="https://payload.co/Payload.js"></script>
173176

174177
<script>
175178
Payload('test_client_key_3bcr16ohAy8aEcwK3Vffs')
176179

180+
const paymentsClient = new google.payments.api.PaymentsClient({environment: 'TEST'});
181+
const button = paymentsClient.createButton({onClick: () => console.log('TODO: click handler')});
182+
button.setAttribute('id', 'google-pay')
183+
184+
$('.google-pay-support div').append(button)
185+
177186
var checkout_form = new Payload.Form({
178187
form: $('#checkout-form').get(0),
179188
styles: {invalid: 'is-invalid'},

0 commit comments

Comments
 (0)