Activate payfast payment driver

This commit is contained in:
David Bomba 2021-07-10 18:59:19 +10:00
parent d7e39cff14
commit 9c2e02d47e
2 changed files with 33 additions and 26 deletions

View File

@ -26,9 +26,9 @@ class PayFastPaymentDriver extends BaseDriver
{
use MakesHash;
public $refundable = true; //does this gateway support refunds?
public $refundable = false; //does this gateway support refunds?
public $token_billing = true; //does this gateway support token billing?
public $token_billing = false; //does this gateway support token billing?
public $can_authorise_credit_card = true; //does this gateway support authorizations?
@ -42,15 +42,14 @@ class PayFastPaymentDriver extends BaseDriver
const SYSTEM_LOG_TYPE = SystemLog::TYPE_PAYFAST;
//developer resources
//https://sandbox.payfast.co.za/
public function gatewayTypes(): array
{
$types = [];
if($this->client->currency()->code == 'ZAR')
$types[] = GatewayType::CREDIT_CARD;
return $types;
@ -116,35 +115,14 @@ class PayFastPaymentDriver extends BaseDriver
public function refund(Payment $payment, $amount, $return_client_response = false)
{
return $this->payment_method->yourRefundImplementationHere(); //this is your custom implementation from here
return false;
}
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
{
$this->init();
return (new Token($this))->tokenBilling($cgt, $payment_hash);
}
// public function generateSignature($data, $passPhrase = null)
// {
// // Create parameter string
// $pfOutput = '';
// foreach( $data as $key => $val ) {
// if($val !== '') {
// $pfOutput .= $key .'='. urlencode( trim( $val ) ) .'&';
// }
// }
// // Remove last ampersand
// $getString = substr( $pfOutput, 0, -1 );
// if( $passPhrase !== null ) {
// $getString .= '&passphrase='. urlencode( trim( $passPhrase ) );
// }
// nlog($getString);
// return md5( $getString );
// }
public function generateSignature($data)
{
$fields = array();

View File

@ -0,0 +1,29 @@
<?php
use App\Models\Gateway;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ActivatePayfastPaymentDriver extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Gateway::whereIn('id', [11])->update(['visible' => 1]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}