Skip to content

Instantly share code, notes, and snippets.

@WietseWind
Created May 19, 2016 10:33
Show Gist options
  • Save WietseWind/3df3ae349c672cb89d3c2d3d1b9c4ba3 to your computer and use it in GitHub Desktop.
Save WietseWind/3df3ae349c672cb89d3c2d3d1b9c4ba3 to your computer and use it in GitHub Desktop.
Mollie iDeal betaling test + sample met nodum.io
{% if param.post.id %}
{# Callback from Mollie? #}
{% do api.IO_staticFile('mollie.txt').set(api.Payment_Mollie.getPayment(param.post.id)|print_r) %}
{% endif %}
<h4>Betalen via Mollie</h4>
{% set payAmount = 1.50 %}
{% if rest.get.pay and api.Payment_Mollie.getMethods[rest.get.pay] %}
<h2>Betalen met <b>{{ api.Payment_Mollie.getMethods[rest.get.pay].description }}</b>...</h2>
{% set continue = true %}
{% if rest.get.pay == 'ideal' and not param.post.issuer %}
<b>Kies de bank</b>
<br />
<form method="post" action="{{ index }}">
<select id="issuer" name="issuer" required="required" class="form-control">
<option value="">Maak een keuze...</option>
{% for issuer in api.Payment_Mollie.getiDealIssuers %}
<option value="{{ issuer.id }}">{{ issuer.name }}</option>
{% endfor %}
</select>
<button class="btn btn-groen btn-sm" type="submit">Afrekenen</button>
</form>
{% set continue = false %}
{% endif %}
{% if continue %}
{% set payment = api.Payment_Mollie.createPayment(
payAmount,
'Een voorbeeldbetaling',
{
order_id: 123123,
customer: "Wietse"
},
baselocation ~ folder ~ '/' ~ page ~ '?thanks=true',
baselocation ~ folder ~ '/' ~ page,
rest.get.pay,
param.post.issuer
) %}
{{ payment|pre }}
<a href="{{ payment.links.paymentUrl }}" target="_blank">Ga door met betalen van transactie {{ payment.id }}...</a>
{% endif %}
{% else %}
<h5>Status van transactie <b>tr_BUBekCht7h</b></h5>
{{ api.Payment_Mollie.getPayment('tr_BUBekCht7h').isPaid()|pre }}
<h5>Betalen: Kies methode</h5>
{% for method in api.Payment_Mollie.getMethods %}
{% if payAmount >= method.amount.minimum and payAmount <= method.amount.maximum %}
<li>
<img src="{{ method.image.normal }}" />
<a href="{{ index }}/pay:{{ method.id }}/">{{ method.description }} ({{ method.id }})</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment