Skip to content

aleksxp/robokassa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP library for Robokassa payment system

Latest Unstable Version Latest Stable Version Total Downloads License

Installation

Install this package through Composer. To your composer.json file, add:

{
    "require": {
        "idma/robokassa": "dev-master"
    }
}

Examples

Create payment:

$payment = new \Idma\Robokassa\Payment(
    'john_doe', 'password1', 'password2', true
);

$payment
    ->setInvoiceId($order->id)
    ->setSum($order->amount)
    ->setDescription('Payment for some goods');

// redirect to payment url
$user->redirect($payment->getPaymentUrl());

Check payment result:

// somewere in result url handler...
...
$payment = new \Idma\Robokassa\Payment(
    'john_doe', 'password1', 'password2', true
);

if ($payment->validate($_GET) {
    $order = Orders::find($payment->getInvoiceId());

    if ($payment->getSum() == $order->sum) {

    }

    // send answer
    echo $payment->getSuccessAnswer(); // "OK1254487\n"
}
...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages