PHP code example of jdavidbakr / laravel-profitstars

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

    

jdavidbakr / laravel-profitstars example snippets

 php
jdavidbakr\ProfitStars\ProfitStarsServiceProvider::class
 bash
php artisan vendor:publish
 php
$proc = new \jdavidbakr\ProfitStars\ProcessTransaction;

// Test connection
if($proc->TestConnection()) {
	// Success
}

// Test credentials
if($proc->TestCredentials()) {
	// Success
}

 php
$proc = new \jdavidbakr\ProfitStars\ProcessTransaction;
$trans = new \jdavidbakr\ProfitStars\WSTransaction;

// AuthorizeTransaction
$trans->RoutingNumber = 111000025;
$trans->AccountNumber = 5637492437;
$trans->TotalAmount = 9.95;
$trans->TransactionNumber = 12334;
$trans->NameOnAccount = 'Joe Smith';
$trans->EffectiveDate = '2015-11-04';
if($proc->AuthorizeTransaction($tras)) {
	// ReferenceNumber in $proc->ReferenceNumber	
} else {
	// Error message in $proc->ResponseMessage
}

// CaptureTransaction
$proc->ReferenceNumber = 'reference number';
if($proc->CaptureTransaction(9.95)) {
	// Success 
} else {
	// Error message in $proc->ResponseMessage
}

// VoidTransaction
$proc->ReferenceNumber = 'reference number';
if($proc->VoidTransaction()) {
	// Success;
} else {
	// Error message in $proc->ResponseMessage
}

// RefundTransaction
$proc->ReferenceNumber = 'reference number';
if($proc->RefundTransaction()) {
	// Success, refund info in $proc->ResponseMessage
} else {
	// Error message in $proc->ResponseMessage
}

 php

$reporter = new \jdavidbakr\ProfitStars\TransactionReporting;

// Retrieve a collection of \jdavidbakr\ProfitStars\CreditAndDebitReportsResponse
$start_date = Carbon::now()->subDays(90); // Max 90 days from start to end
$end_date = Carbon::now();
$batches = $reporter->CreditAndDebitReports($start_date, $end_date);

// Retrieve a collection of \jdavidbakr\ProfitStars\WSSettlementBatch objects for a batch
$batch = $batches->first();
$transactions = $reporter->CreditsAndDebitsTransactionDetailReport($batch->batchID);