addMerchantId("346875024") ->addAccount("internet") ->addAmount("1001") ->addCurrency("EUR") ->addAutoSettleFlag(TRUE); $realexHpp = new RealexHpp("pfm36MUH1T2"); try { $requestJson = $realexHpp->requestToJson($hppRequest); echo $requestJson; // code here for your application to pass the JSON string to the client-side library return $requestJson; } catch (RealexValidationException $e) { return $e->getMessage(); } catch (RealexException $e) { return $e->getMessage(); } ?>