PHP code example of krve / epay

1. Go to this page and download the library: Download krve/epay 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/ */

    

krve / epay example snippets


Epay::setMerchantNumber($merchant_number);
Epay::setPassword('secret');
Epay::useCurrency('EUR', 978)

$customer = Customer::retrieve($customer_id);

$customer = Customer::retrieve($customer_id);
$customer->delete();

$subscriptions = $customer->subscriptions();

$charge = Charge::create([
    'amount' => 1000,
    'customer' => $customer_id,
    'order' => uniqid(),
    'description' => 'Charge description'
]);

$charge = Charge::create([
    'amount' => 1000,
    'customer' => $customer_id,
    'order' => uniqid(),
    'description' => 'Charge description',
    'currency' => 840,
]);

$plan = Plan::create([
    'amount' => 2000,
    'interval' => 'yearly',
    'name' => 'Test Plan',
]);

$subscriptions = $plan->subscriptions();

$subscription = Subscription::create([
    'customer' => $customer_id,
    'plan' => $plan_id,
    'email' => '[email protected]'
]);

$subscription = Subscription::retrieve($subscription_id);
$subscription->cancel();

$subscriptions = Subscription::all();

$customer = $subscription->customer();

$plan = $subscription->plan();