PHPackages                             dofinity/creditguard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. dofinity/creditguard

ActiveLibrary[Payment Processing](/categories/payments)

dofinity/creditguard
====================

PHP Library for integrating CreditGuard based payments.

18894[1 issues](https://github.com/dofinity/creditguard/issues)[1 PRs](https://github.com/dofinity/creditguard/pulls)PHP

Since Nov 22Pushed 2y ago4 watchersCompare

[ Source](https://github.com/dofinity/creditguard)[ Packagist](https://packagist.org/packages/dofinity/creditguard)[ RSS](/packages/dofinity-creditguard/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

[![Maintainability](https://camo.githubusercontent.com/177d43dcf6676cd12c638318f2242a9228c9eb8f570ffc832e17b4d87df2b2a1/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f32663830643538636563616361383039656436382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/dofinity/creditguard/maintainability)

CreditGuard
===========

[](#creditguard)

A lightweight PHP helper library for integrating CreditGuard API payments.

Installation
------------

[](#installation)

### Install the library via Composer

[](#install-the-library-via-composer)

```
$ composer require dofinity/creditguard:dev-master
```

### Using custom WSDL (customized API from CreditGuard)

[](#using-custom-wsdl-customized-api-from-creditguard)

At the moment in order to use custom classes, you have two options:

1. Export your changes as patch and apply that on the library (not recommended)
2. Fork the repository and apply your custom WSDL

##### Generating CG Classes via WSDL

[](#generating-cg-classes-via-wsdl)

As mentioned above, the library comes with a pre-generated CG classes, generated from our demo endpoint. If your terminal provides a different classes that are customized for your specific needs, you will to generate the classes again using `wsdl2phpgenerator` which is already defined as a dev dependency under our composer.json.

```
$ composer install --dev
```

Then execute `generateWsdl.php?wsdl_path=https%3A%2F%2Fxxx.creditguard.co.il%2Fxpo%2Fservices%2FRelay%3Fwsdl` and you should now see the updated classes in your `/wsdl` directory.

Note that the URL must be encoded for that to work.

### Security considerations and tweaks

[](#security-considerations-and-tweaks)

- Make sure that wsdlGenerate.php is read only on production environment (400)
- Don't use `composer install --dev` on non development environments

Basic usage
-----------

[](#basic-usage)

### Payment page setup

[](#payment-page-setup)

`examples/newTransactionRedirectUrl.php`

### Payment validation

[](#payment-validation)

```
// callback.php
require __DIR__ . '/vendor/autoload.php';

$CreditguardTransactionId = $_GET['CreditguardTransactionId'];
$CreditguardStatusCode = $_GET['CreditguardStatusCode'];
$ConfirmationKey = $_GET['ConfirmationKey'];
$Total = 100;

$PaymentResponse = new \Creditguard\PaymentResponse(
    $CreditguardStatusCode, $CreditguardTransactionId, '', '', $ConfirmationKey, 100
);

$payment = new \Creditguard\CreditguardPayment();
$payment->setPaymentResponse($PaymentResponse);

if ($payment->ValidatePayment()) {
    echo 'Ok. Payment has been verified';
} else {
    echo 'Fail. Payment forged';
}
```

### Retrieve Transaction info

[](#retrieve-transaction-info)

```
// callback.php
require __DIR__ . '/vendor/autoload.php';

// change terminal, user and password to real credentials
$terminal = '0123456';
$user = 'user';
$password = 'password';

$CreditguardTransactionId = $_GET['CreditguardTransactionId'];

$transaction = new \Creditguard\CreditguardTransaction(
    $terminal, $user, $password, $CreditguardTransactionId
);

// use properties from src/Creditguard/CreditguardTransaction.php class
var_dump($transaction);
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a37de1eec762df3ab902fd0fe6491f3c2add32ae01828978a29d5dbcf93e620?d=identicon)[Dofinity](/maintainers/Dofinity)

---

Top Contributors

[![reissr](https://avatars.githubusercontent.com/u/6906341?v=4)](https://github.com/reissr "reissr (19 commits)")[![yonatan0](https://avatars.githubusercontent.com/u/12760917?v=4)](https://github.com/yonatan0 "yonatan0 (15 commits)")[![pelegr](https://avatars.githubusercontent.com/u/24872040?v=4)](https://github.com/pelegr "pelegr (6 commits)")[![rotemreiss](https://avatars.githubusercontent.com/u/9288082?v=4)](https://github.com/rotemreiss "rotemreiss (3 commits)")

### Embed Badge

![Health badge](/badges/dofinity-creditguard/health.svg)

```
[![Health](https://phpackages.com/badges/dofinity-creditguard/health.svg)](https://phpackages.com/packages/dofinity-creditguard)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
