Skip to content

Instantly share code, notes, and snippets.

@rudiedirkx
Created May 1, 2023 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudiedirkx/32ad1e409d00ba9b0d745e03f964e715 to your computer and use it in GitHub Desktop.
Save rudiedirkx/32ad1e409d00ba9b0d745e03f964e715 to your computer and use it in GitHub Desktop.
<?php
// Using https://packagist.org/packages/mollie/mollie-api-php
$info = [
'amount' => [
'currency' => $this->config['currency'] ?: 'EUR',
'value' => number_format($this->payment->amount, 2, '.', ''),
],
'description' => $this->payment->order_description,
'redirectUrl' => $this->getReturnUrl('return'),
];
if ( $this->withWebhook() ) {
$info['webhookUrl'] = $this->getReturnUrl('webhook');
}
$trx = $this->mollie()->payments->create($info); // Exception here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment