Aanmaken payment met mollie geeft geen reactie
Ik ben al een tijdje bezig om uit te zoeken hoe ik Mollie integreer in mijn website.
Ik heb een account bij Mollie aangemaakt en alles hoort daar goed te zijn (site is goedgekeurd).
Echter als ik een payment wil aanmaken reageert mijn script (gekopieerd van de Mollie documentatie) nergens op, ik heb het path gecontroleerd en deze staat ook goed.
Hoe kan ik dit werkend krijgen, of wat doe ik fout?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require_once 'mollieapi/src/Mollie/API/Autoloader.php';
$mollie = new Mollie_API_Client;
$mollie->setApiKey('**knip**');
try
{
$payment = $mollie->payments->create(
array(
'amount' => 10.00,
'description' => 'My first payment',
'redirectUrl' => 'https://webshop.example.org/order/12345/',
'metadata' => array(
'order_id' => '12345'
)
)
);
/*
* Send the customer off to complete the payment.
*/
header("Location: " . $payment->getPaymentUrl());
exit;
}
catch (Mollie_API_Exception $e)
{
echo "API call failed: " . htmlspecialchars($e->getMessage());
echo " on field " . htmlspecialchars($e->getField());
}
$mollie = new Mollie_API_Client;
$mollie->setApiKey('**knip**');
try
{
$payment = $mollie->payments->create(
array(
'amount' => 10.00,
'description' => 'My first payment',
'redirectUrl' => 'https://webshop.example.org/order/12345/',
'metadata' => array(
'order_id' => '12345'
)
)
);
/*
* Send the customer off to complete the payment.
*/
header("Location: " . $payment->getPaymentUrl());
exit;
}
catch (Mollie_API_Exception $e)
{
echo "API call failed: " . htmlspecialchars($e->getMessage());
echo " on field " . htmlspecialchars($e->getField());
}
Gewijzigd op 01/09/2016 11:58:59 door - Ariën -
Alvast bedankt.
Ik kwam er toevallig afgelopen zaterdag voor een klant achter dat als cURL niet geactiveerd is op een server, dat de Mollie api dan niet werkt
Dit was mijn response bij het kopje cURL
Quote:
cURL support enabled
cURL Information 7.19.7
Age 3
Features
AsynchDNS No
CharConv No
Debug No
GSS-Negotiate Yes
IDN Yes
IPv6 Yes
krb4 No
Largefile Yes
libz Yes
NTLM Yes
SPNEGO No
SSL Yes
SSPI No
Protocols tftp, ftp, telnet, dict, ldap, ldaps, http, file, https, ftps, scp, sftp
Host x86_64-redhat-linux-gnu
SSL Version NSS/3.16.2.3 Basic ECC
ZLib Version 1.2.3
libSSH Version libssh2/1.4.2
cURL Information 7.19.7
Age 3
Features
AsynchDNS No
CharConv No
Debug No
GSS-Negotiate Yes
IDN Yes
IPv6 Yes
krb4 No
Largefile Yes
libz Yes
NTLM Yes
SPNEGO No
SSL Yes
SSPI No
Protocols tftp, ftp, telnet, dict, ldap, ldaps, http, file, https, ftps, scp, sftp
Host x86_64-redhat-linux-gnu
SSL Version NSS/3.16.2.3 Basic ECC
ZLib Version 1.2.3
libSSH Version libssh2/1.4.2
Gewijzigd op 01/09/2016 11:22:40 door Wouter Verdegaal
Dit is helaas weinig relevante informatie. Wat gebeurt er wel en wat gebeurt er niet? Wat krijg je te zien en wat verwacht je dat er zou moeten gebeuren?
Wordt je wel doorgestuurd naar Mollie? Staan de foutmeldingen aan op de webserver?