1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 00:41:34 +02:00

PayFast Webhook URL listener

This commit is contained in:
David Bomba 2021-06-24 19:45:45 +10:00
parent 94c424a15b
commit 3baa0e3d9a
3 changed files with 22 additions and 3 deletions

View File

@ -11,6 +11,7 @@
namespace App\PaymentDrivers; namespace App\PaymentDrivers;
use App\Http\Requests\Payments\PaymentWebhookRequest;
use App\Models\ClientGatewayToken; use App\Models\ClientGatewayToken;
use App\Models\GatewayType; use App\Models\GatewayType;
use App\Models\Payment; use App\Models\Payment;
@ -91,4 +92,8 @@ class DriverTemplate extends BaseDriver
{ {
return $this->payment_method->yourTokenBillingImplmentation(); //this is your custom implementation from here return $this->payment_method->yourTokenBillingImplmentation(); //this is your custom implementation from here
} }
public function processWebhookRequest(PaymentWebhookRequest $request, Payment $payment = null)
{
}
} }

View File

@ -128,5 +128,12 @@ class PayFastPaymentDriver extends BaseDriver
$getString .= '&passphrase='. urlencode( trim( $passPhrase ) ); $getString .= '&passphrase='. urlencode( trim( $passPhrase ) );
} }
return md5( $getString ); return md5( $getString );
}
public function processWebhookRequest(PaymentWebhookRequest $request, Payment $payment = null)
{
nlog($request->all());
return response()->json([], 200);
} }
} }

View File

@ -17,6 +17,7 @@
<input type="hidden" name="subscription_type" value="{{ $subscription_type }}"> <input type="hidden" name="subscription_type" value="{{ $subscription_type }}">
<input type="hidden" name="passphrase" value="{{ $passphrase }}"> <input type="hidden" name="passphrase" value="{{ $passphrase }}">
<input type="hidden" name="signature" value="{{ $signature }}"> <input type="hidden" name="signature" value="{{ $signature }}">
@if(!Request::isSecure()) @if(!Request::isSecure())
<p class="alert alert-failure">{{ ctrans('texts.https_required') }}</p> <p class="alert alert-failure">{{ ctrans('texts.https_required') }}</p>
@ -28,9 +29,15 @@
{{ ctrans('texts.credit_card') }} {{ ctrans('texts.credit_card') }}
@endcomponent @endcomponent
@component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'server_response']) <div class="bg-white px-4 py-5 flex justify-end">
{{ ctrans('texts.add_payment_method') }} <button
@endcomponent type="submit"
id="{{ $id ?? 'pay-now' }}"
class="button button-primary bg-primary {{ $class ?? '' }}">
<span>{{ ctrans('texts.add_payment_method') }}</span>
</button>
</div>
</form> </form>
@endsection @endsection