Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kart türleri #64

Open
innthebox opened this issue Apr 10, 2022 · 4 comments
Open

kart türleri #64

innthebox opened this issue Apr 10, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@innthebox
Copy link

innthebox commented Apr 10, 2022

No description provided.

@nuryagdym nuryagdym added the enhancement New feature or request label Apr 10, 2022
@nuryagdym
Copy link
Collaborator

Selam,
tesekkurler, iyi fikir, musait olunca ekleriz.

@nuryagdym
Copy link
Collaborator

Bu ozelligi yeterli kadar oylama gelirse gelistiririz. Biraz arastirdim, kart firmalari yeni kart numaralari (patternleri) cikardikca bu ozellik sorun cikar. Bunun icin kutuphaneyi surekli guncel tutulmasi gerekecek.
https://stackoverflow.com/a/55019607/4896948

Belki bunun icin baska kutuphane kullanilabilirsiniz.
Ornegin: https://github.com/jlorente/php-credit-cards

@zeydduran
Copy link
Contributor

Bu ozelligi yeterli kadar oylama gelirse gelistiririz. Biraz arastirdim, kart firmalari yeni kart numaralari (patternleri) cikardikca bu ozellik sorun cikar. Bunun icin kutuphaneyi surekli guncel tutulmasi gerekecek. https://stackoverflow.com/a/55019607/4896948

Belki bunun icin baska kutuphane kullanilabilirsiniz. Ornegin: https://github.com/jlorente/php-credit-cards

Bu soruna çözüm üretmek adına kart bin numaralarını veritabanında tutuyorum kullanıcılar (E-ticaret sisteminin admini) bin numaralarını isteklerine göre düzenliyorlar. Örnek; Bin numarasına taksit,puan kullanma yetkisi, bin numarası hangi sanal pos ile çalışacak, bin numarası hangi organizasyona ait(visa,master vb.), bin numarası hangi bankaya ait, bin numarası hangi markaya ait (World,Bonus vb.), bin numara markası hangi sanal pos ile çalışacak.
Esnek bir yapı olduğunu düşünüyorum.
Bankalar kendi müşterilerine bin numaralarında bir ekleme vs olduğunda mail ile bilgilendirme yapıyorlar. Bize bu tarz bilgilendirmeler yapmadıkları için böyle bir yapı kullanıyorum.

@Smokietr
Copy link

Smokietr commented Jul 9, 2024

https://lookup.binlist.net/ üzerinden çekebilirsiniz. Dikkat limit var.


<?php

namespace App\Services;

use GuzzleHttp\Exception\GuzzleException;

class BinService
{
    protected \GuzzleHttp\Client $client;

    public function __construct()
    {
        $this->client = new \GuzzleHttp\Client([
            'verify' => false,
            'options' => [
                'CURLOPT_INTERFACE' => request()->ip // Set the IP address to be used for the request
            ]
        ]);
    }

    /**
     * @throws GuzzleException
     */
    private function getBinInformation(string $bin): array
    {
        $response = $this->client->get('https://lookup.binlist.net/' . $bin);

        if ($response->getStatusCode() !== 200) {
            return [];
        }

        return json_decode($response->getBody()->getContents(), true);
    }

    /**
     * @throws GuzzleException
     */
    public function getBinInformationByCardNumber(string $cardNumber): array
    {
        $bin = substr($cardNumber, 0, 6);

        return $this->getBinInformation($bin);
    }

    // TODO Exception handling
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants