|
|
|
# Background
|
|
|
|
|
|
|
|
CreditGuard provides sophisticated technology solutions for the payments.
|
|
|
|
|
|
|
|
# Quick start
|
|
|
|
```
|
|
|
|
$paymentSettings = [
|
|
|
|
'user' => '',
|
|
|
|
'password' => '',
|
|
|
|
'redirectTerminal' => '',
|
|
|
|
'chargingTerminal' => '',
|
|
|
|
'mid' => '',
|
|
|
|
'endpointUrl' => '',
|
|
|
|
];
|
|
|
|
$gateway = OmniPay::create('CreditGuard\Server')->initialize($paymentSettings);
|
|
|
|
$authSettings = array(
|
|
|
|
'amount' => 100,
|
|
|
|
'currency' => 'ILS',
|
|
|
|
'returnUrl' => 'http://<RETURN_HOST>/paymentgateways/okpage?name=CreditGuard\Server'
|
|
|
|
)
|
|
|
|
$response = $gateway->authorize($authSettings)->send();
|
|
|
|
if($response->isRedirect()){
|
|
|
|
$txid = $response->getToken();
|
|
|
|
//save the txid, tenantUrl and aid
|
|
|
|
$response->redirect();
|
|
|
|
} else {
|
|
|
|
$message = $response->getMessage();
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
this will take you to creditguard page:
|
|
|
|
|
|
|
|
![Screenshot_from_2020-12-10_18-40-21](/uploads/285cb556d1519aad73000f23feced769/Screenshot_from_2020-12-10_18-40-21.png)
|
|
|
|
|
|
|
|
After fillilng the credit details, if success it will return you to the returnUrl.
|
|
|
|
|
|
|
|
In the returnUrl method we need to get txid field from the response (similar to $txid we store before).
|
|
|
|
then check the transaction with:
|
|
|
|
```
|
|
|
|
$transaction = [
|
|
|
|
'token' => $txid
|
|
|
|
];
|
|
|
|
$response = $gateway->transactionDetails($transaction)->send();
|
|
|
|
if ($response->isSuccessful()){
|
|
|
|
$cardRef = $response->getCardReference();
|
|
|
|
$authNumber = $response->getTxAuthNo();
|
|
|
|
$personalId = $response->getPersonalId() ;
|
|
|
|
$cardExp = $response->getCardExpiration();
|
|
|
|
///save this for the aid payment details - with this can create pay/credit request.
|
|
|
|
}else {
|
|
|
|
$message = $response->getMessage();
|
|
|
|
}
|
|
|
|
``` |
|
|
|
\ No newline at end of file |