xpay-crypting/crypting

Simplify work with xpay api

Installs: 4 592

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/xpay-crypting/crypting

dev-main 2021-06-30 13:53 UTC

This package is auto-updated.

Last update: 2025-10-29 03:14:56 UTC


README

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(),
];