Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $input = @file_get_contents("php://input");
- $event_json = json_decode($input, true);
- if ($event_json['type'] == 'checkout.session.completed') {
- $uniqid = $event_json['data']['object']['client_reference_id'];
- $customerId = $event_json['data']['object']['customer'];
- $dir = BASE_PATH . '/files/orders/';
- $orderFile = $dir . $uniqid . '.json';
- $json = json_decode(file_get_contents($orderFile), true);
- $company = $companyMapper->get($json['companyId']);
- $company = $companyMapper->getByVat($company['vat']);
- if($company->getStripeId() !== $customerId){
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement