codepso / techgenies-mm
Helper for the Mow Manage project of TechGenies
v1.0.19
2025-01-17 15:30 UTC
Requires
- php: ^7.4|^8.0
This package is not auto-updated.
Last update: 2025-03-26 02:20:47 UTC
README
Requirements
- php >= 8.0.0
- laravel >= 8.12.0
- composer >= 2.0.7
Installation
composer require mowmanagers/paytrace php artisan vendor:publish --tag=mm-config (optional) composer update mowmanagers/paytrace (optional)
Installation (Docker)
docker run --rm -it -v $(pwd):/var/www codepso/php:8.0-cli-pgsql composer require mowmanagers/paytrace docker run --rm -it -v $(pwd):/var/www codepso/php:8.0-cli-pgsql composer update mowmanagers/paytrace
Configuration
.env
PAY_TRACE_API_URL==https://api.paytrace.com PAY_TRACE_USERNAME=abc@abc.com PAY_TRACE_PASSWORD=abc123
app/Exceptions/Handler.php
use TechGenies\MM\Exceptions\PayTraceException; public function register() { // $this->renderable(function (PayTraceException $e, $request) { return $e->getError(); }); }
Use
use TechGenies\MM\Api\PayTraceApi; try { $payTraceApi = new PayTraceApi(); return $payTraceApi->customers->create($data); } catch (PayTraceException $e) { return $e->getError(); }
use TechGenies\MM\Api\PayTraceApi; $payTraceApi = new PayTraceApi(); return $payTraceApi->customers->create($data);
Docs
credentials: getCredentials($params)
$credentials = $payTraceApi->getCredentials();
customers: customers->export($params)
- $params:
array | required
- customer_id:
string | required
- customer_id:
// Get customer $params = [ 'customer_id' => 'customerTest1' ]; $customer = $payTraceApi->customers->export($params);
customers: customers->create($params)
- $params:
array | required
- customer_id:
string | required
- customer_id:
$params = [ 'customer_id' => $validated['customer_id'], 'credit_card' => [ 'number' => $validated['credit_card_number'], 'expiration_month' => $validated['credit_card_expiration_month'], 'expiration_year' => $validated['credit_card_expiration_year'], ], 'billing_address' => [ 'name' => 'Mow Managers', 'street_address' => '8320 E. West St.', 'city' => 'Spokane', 'state' => 'WA', 'zip' => '85284', ], 'check' => [ 'account_number' => '123456', 'routing_number' => '325070760' ] ]; $customer = $payTraceApi->customers->create($params);
ACH: ach->vaultSale($params)
- $params:
array | required
- customer_id:
string | required
- customer_id:
$params = [ 'customer_id' => 'customerTest1', 'amount' => 2.00 ]; $payTraceApi->ach->vaultSale($params);
Testing
laravel new testing composer remove mowmanagers/paytrace php artisan serve
"repositories": [ { "type": "path", "url": "./packages/techgenies/techgenies-mm" } ]
composer update composer require mowmanagers/paytrace composer remove mowmanagers/paytrace (remove)