Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FK-1277] Add recurly integration example for sofort #100

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gilv93
Copy link
Collaborator

@gilv93 gilv93 commented Feb 9, 2022

Added recurly integration example for sofort specifically.

<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- <script src="https://js.recurly.com/v4/recurly.js"></script> -->
<script src="https://js.lvh.me:8020/build/recurly.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to restore this to using the production recurly.js

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely! Wanted to just get it up for now in case others wanted to use it to test out RJS changes as we make 'em

<!-- <script src="https://js.recurly.com/v4/recurly.js"></script> -->
<script src="https://js.lvh.me:8020/build/recurly.js"></script>
<script>window.recurlyConfig = {
publicKey: 'qa2-p14FypnEc7sShkm9ESVPia'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use <script src="/config"></script> instead of hard coding this value. The /config route will cover setting this variable for you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was having trouble getting this to work previously, I'll have to play with it again!


<body>
<h1>Bank Redirect</h1>
<form onsubmit="return false;">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't the form actually submitting to the backend?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually took this as a base from @cyberxander90 and his ideal example. My guess is we don't actually want to be submitting a call to the backend directly, we want to call the bankRedirect.start method that makes the call and outputs our redirect window in an iframe

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... but onsubmit could do that too? hmmm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could be both ways, we can call the start() function on the submit event, my first approach was avoid the submit to avoid reload the page.

@@ -15,6 +16,8 @@ <h1>Bank Redirect</h1>
<div>
Payment Method Type:
<select id="payment_method_type" name="payment_method_type">
<option hidden disabled selected></option>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants