Helcim Payment platform

JPBleau 13d ago

My customer wants to use the Helcim payment platform for a donation website. This is a hospital foundation and it is a volunteer work for me and I want it as easy as possible to implement. I see ChronoForms supports some payment platforms, but I don't see Helcim. Helcim looks similar to Stripe as it has PHP, tokens and variables to  manage the payments. Can you help ?

Max_admin 12d ago
Answer

Hi JPBleau

You can try to use the CURL action and implement a connection yourself, but if the requirements is complex then a special payment action will need to be written for them specifically.

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
JPBleau 12d ago

Hi Max,

Thanks for your response.

I have PHP code to initiate the connection, I will try to put it in a PHP action in the submit section. Hope it will work. I will perform some tests,

Regards.

JPBleau 12d ago

Here is the code:

header('Content-Type: application/json');

$amount = floatval($_POST['amount'] ?? 0);
if ($amount <= 0) {
  http_response_code(400);
  echo json_encode(['error' => 'Montant invalide']);
  exit;
}

$apiToken = 'API_TOKEN_HELCIM_ICI'; // stocké côté serveur

$payload = [
  'amount' => number_format($amount, 2, '.', ''),
  'currency' => 'CAD',
  'language' => 'fr',
  'description' => 'Don – Fondation CHDL'
];

$ch = curl_init('https://api.helcim.com/v2/helcim-pay/initialize');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    'Content-Type: application/json',
    'api-token: ' . $apiToken
  ],
  CURLOPT_POSTFIELDS => json_encode($payload)
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;

Max_admin 12d ago

Great, did you get it working ?

$_POST['amount'] // this variable should be replaced by a number

and the $response should have some variable to give you more info I guess ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply