I am begginer and i want to integrate stripe plugin in my elgg website

I want to integrate stripe plugin in my elgg website i have downloaded and activated the plugin. But i want to know that in which php file i have to add the codes written below.

### Example: adding a card
 
```php
$token = get_input('token'); // this would have been generated by stripe.js
$user = elgg_get_logged_in_user_entity();
 
$client = new StripeClient();
$client->createCard($user, $token);
```
 
### Example: creating a charge
 
```php
 
$user_guid = elgg_get_logged_in_user_guid();
 
$charge = array(
'amount' => 12545, // amount in cents
'currency' => 'USD',
'card' => $card_id, // optional if the customer has a card on file
'metadata' => array(
'cart_guid' => $cart_guid,
'shop_guid' => $shop_guid,
),
);
 
$client = new StripeClient();
$client->createCharge($user_guid, $charge);
```