Skip to content
Snippets Groups Projects
Commit fe398566 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

integrated credit card payments

parent 7c3fb0a3
No related branches found
No related tags found
No related merge requests found
...@@ -83,13 +83,12 @@ function initialize_paypal_payments() { ...@@ -83,13 +83,12 @@ function initialize_paypal_payments() {
}, },
}, },
createOrder: checkout_data.createOrder, createOrder: checkout_data.createOrder,
onApprove: checkout_data.onApprove,
}).then((cardFields) => { }).then((cardFields) => {
document document
.getElementById("paypal-card-form") .getElementById("paypal-card-form")
.addEventListener("submit", (e) => { .addEventListener("submit", (e) => {
e.preventDefault(); e.preventDefault();
cardFields.submit(); cardFields.submit().then(() => checkout_data.onApprove());
}); });
}); });
console.log("Hosted Fields"); console.log("Hosted Fields");
......
...@@ -174,6 +174,7 @@ ...@@ -174,6 +174,7 @@
<label for="cvv">Sicherheitscode (CVV)</label> <label for="cvv">Sicherheitscode (CVV)</label>
<div id="cvv" class="card_field"></div> <div id="cvv" class="card_field"></div>
</div> </div>
<button type="submit" id="submit-credit-card" class="button">Jetzt bezahlen</button> <button type="submit" id="submit-credit-card" class="button">Jetzt bezahlen</button>
</form> </form>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment