PHP code example of clubfixinsurtech / valorempay

1. Go to this page and download the library: Download clubfixinsurtech/valorempay library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

clubfixinsurtech / valorempay example snippets




$clientId = '';
$clientSecret = '';
$isSandbox = true;

$connector = new \ValoremPay\ValoremPayConnector(clientId: $clientId, clientSecret: $clientSecret, isSandbox: $isSandbox);

// Create transaction
$transaction = (new \ValoremPay\Strategies\TransactionCreateStrategy(
    installments: 1,
    installment_type: \ValoremPay\Enums\InstallmentType::STORE_WITHOUT_INTEREST,
    amount: 1000,
))->setAdditionalData(
    (new \ValoremPay\Entities\AdditionalData(
        status_notification_url: 'example.com',
    )),
);

$request = $connector->valoremPay()->transactionCreate($transaction);
$response = $request->object();

dump($request, $response);