Changes
Page history
Create home
authored
Dec 10, 2020
by
Ofer Cohen
Show whitespace changes
Inline
Side-by-side
home.md
0 → 100644
View page @
673a8aac
# 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:

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