Skip to content

shmakov-xpay/xpay-crypting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library for Xpay

This library aims to perform cryptographic operations for interaction with XPay.

composer require xpay-crypting/crypting

Key generation

This command will create 2 files in a current directory. Send a public key to XPayua. Never share the private-key.

./bin/generate-keys

Usage

$privateKey = ''; // your private key
$publicKey = ''; // key that you've got from XPayua
$manager = new CryptManager($privateKey, $publicKey);


$requestData = ['ID' => ''];

$partner = [
    'PartnerToken' => 'TOKEN', // that you've got from XPayua
    'OperationType' => 12345, // integer id of operation
];
        
$data = [
      'Partner' => $partner,
      'Data' => $cryptManager->encrypt($requestData),
      'KeyAES' => $cryptManager->getEncryptedAESKey(),
      'Sign' => $cryptManager->getSignedKey(),
];

About

Simplify work with xpay api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages