miladxandi / intellectmoney-sdk
Intellectmoney PHP SDK
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/miladxandi/intellectmoney-sdk
Requires
- php: >=8.0
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.0|^7.8
README
Generate a secretKey:
- Go here: https://lk.intellectmoney.ru/profile/security/api and generate credentials and set all of them in your code  by \Intellectmoney\Configurations::static propertes.
- Then go here and select your shop for change: https://lk.intellectmoney.ru/eshops
- Now put the secretKey in the "Connecting the store" tab, in its related input field.
Do Pay
try{
    \Intellectmoney\Configurations::$eshopId = 111111;
    \Intellectmoney\Configurations::$secretKey = "111111";
    $gateway = new \Intellectmoney\Merchant\Payment();
    
    
    $url = "https://www.example.com/";
    $email = "info@example.com";
    $orderId = 145; //Random number or string generated by your internal system
    $amount = 2000;
    
    $invoiceId = $gateway->createInvoice(
        $orderId,
        $amount,
        $email,
        resultUrl: $url,
    )->Result->InvoiceId;
    if ($invoiceId!=null){
        $paymentLink = $gateway->pay($invoiceId)->Result->PaymentLink;
        header("Location: ".$paymentLink);
    }
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}