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

Typescript Support - TypeScript Desteği - index.d.ts #118

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

cangokceaslan
Copy link

@cangokceaslan cangokceaslan commented Jan 25, 2024

Merhabalar,

Iyzipay içerisindeki tüm module ve methodları haritalayıp bir typescript declaration dosyası hazırladım. Kod bu şekilde npm üzerinde paylaşılırsa otomatik olarak TypeScript desteği eklenmiş olacak.

( index.d.ts içerisinde Type Declaration'lar bulunuyor. )

İyi çalışmalar dilerim

Merhabalar,

Iyzipay içerisindeki tüm modül ve methodları haritalayıp bir typescript declaration dosyası hazırladım. Kod bu şekilde npm üzerinde paylaşılırsa otomatik olarak TypeScript desteği eklenmiş olacak.

İyi çalışmalar dilerim
@cangokceaslan cangokceaslan reopened this Jan 25, 2024
@cangokceaslan cangokceaslan changed the title Type script support Typescript support Jan 25, 2024
@cangokceaslan cangokceaslan changed the title Typescript support Typescript Support - TypeScript Desteği - index.d.ts Jan 30, 2024
@cangokceaslan
Copy link
Author

cangokceaslan commented Feb 1, 2024

Tekrardan merhabalar

Yazdığım TypeScript desteği @types/iyzipay altında yayına çıktı.

https://www.npmjs.com/package/@types/iyzipay

npm install --save-dev @types/iyzipay

veya

yarn add -D @types/iyzipay

komutlarını terminale girerek kurabilirsiniz.

cangokceaslan and others added 5 commits February 2, 2024 02:02
There was a small mistake of namespace variable names. Corrected.
…naming-convention

- Exported all interfaces
- Deduplicated naming according to @eslint/naming-convention
Reversed to default exportation
@omermecitoglu
Copy link

@cangokceaslan bazi type'lar hatali malesef. ornegin;

interface SubscriptionProductRetrieveResult {
    status: string;
    locale?: Locale;
    systemTime: number;
    conversationId?: string;
    productReferenceCode: string;
    name: string;
    description: string;
}

ama API'da donen sonuc su sekilde

{
    "status": "success",
    "systemTime": 1686863264574,
    "data": {
        "referenceCode": "235dbc68-d281-4626-9c85-98002e558ce7",
        "createdDate": 1675684451778,
        "name": "test",
        "status": "ACTIVE",
        "pricingPlans": [
            {
                "referenceCode": "a3dde7ac-dff4-4d96-a6da-5780aeee9c9a",
                "createdDate": 1675684471828,
                "name": "testop",
                "price": 100.00000000,
                "paymentInterval": "MONTHLY",
                "paymentIntervalCount": 1,
                "trialPeriodDays": 0,
                "currencyCode": "TRY",
                "productReferenceCode": "235dbc68-d281-4626-9c85-98002e558ce7",
                "planPaymentType": "RECURRING",
                "status": "ACTIVE"
            }
        ]
    }
}

https://docs.iyzico.com/urunler/abonelik/abonelik-entegrasyonu/abonelik-urunu#ueruen-detayi-1

@cangokceaslan
Copy link
Author

@cangokceaslan bazi type'lar hatali malesef. ornegin;

interface SubscriptionProductRetrieveResult {
    status: string;
    locale?: Locale;
    systemTime: number;
    conversationId?: string;
    productReferenceCode: string;
    name: string;
    description: string;
}

ama API'da donen sonuc su sekilde

{
    "status": "success",
    "systemTime": 1686863264574,
    "data": {
        "referenceCode": "235dbc68-d281-4626-9c85-98002e558ce7",
        "createdDate": 1675684451778,
        "name": "test",
        "status": "ACTIVE",
        "pricingPlans": [
            {
                "referenceCode": "a3dde7ac-dff4-4d96-a6da-5780aeee9c9a",
                "createdDate": 1675684471828,
                "name": "testop",
                "price": 100.00000000,
                "paymentInterval": "MONTHLY",
                "paymentIntervalCount": 1,
                "trialPeriodDays": 0,
                "currencyCode": "TRY",
                "productReferenceCode": "235dbc68-d281-4626-9c85-98002e558ce7",
                "planPaymentType": "RECURRING",
                "status": "ACTIVE"
            }
        ]
    }
}

https://docs.iyzico.com/urunler/abonelik/abonelik-entegrasyonu/abonelik-urunu#ueruen-detayi-1

Selamlar Ömer,

Iyzipay Samples altındaki response'ları aldım. Dökümantasyonla da cross check yaptım.

Bazılarında hatalar olmuş olabilir

https://www.github.com/cangokceaslan/iyzipay-types üzerinden fork ediip güncelleyip merge atarsan. Hem DefinitelyTyped reposunu hem de buradaki PR'ı güncelleyebilirim.

Kolay gelsin

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

Successfully merging this pull request may close these issues.

None yet

2 participants