Code Monkey home page Code Monkey logo

iyzipay-js's Introduction

Iyzipay JS SDK

Türkçemi bağışlayın, bu metnin tamamı otomatik olarak çevrilmiştir.

EN: An alternative TypeScript SDK for iyzico payment service. TR: iyzico ödeme servisi için alternatif bir TypeScript SDK.

NOTE EN: This project is not affiliated with iyzico. This is an unofficial SDK. This sdk is also still a work in progress. NOT TR: Bu proje iyzico ile ilişkili değildir. Bu resmi olmayan bir SDK'dır. Bu sdk hala geliştirme aşamasındadır.

Goal EN: Allow this SDK to work in other environments and frameworks like NextJS and potentially React Native. Goal TR: Bu SDK'nın NextJS ve potansiyel olarak React Native gibi diğer ortamlarda ve çerçevelerde çalışmasına izin vermek.

Requirements

  • NVM or Node.js v20.12.2 or greater

Quick Setup

1 - Install Depdenencies

# FROM: ./

pnpm install;

2 - Add Environment Variables

# FROM: ./

cp .env.example .env;

File: ./.env

IYZICO_API_KEY="<YOUR_IYZICO_API_KEY>"
IYZICO_SECRET_KEY="<YOUR_IYZICO_SECRET_KEY>"
IYZICO_BASE_URL="https://sandbox-api.iyzipay.com" # Optional

3 - Run Tests

Example Test

# FROM: ./

pnpm test:example;

# [Expected Output]:
# ...
# {
#   response: {
#     status: "success",
#     locale: "tr",
#     systemTime: 1714445286140,
#     conversationId: "123456789",
#     token: "<GENERATED_TOKEN>",
#     checkoutFormContent: "<script type=\"text/javascript\">if (typeof iyziInit == 'undefined') {var iyziInit = {currency:\"TRY\",token:\"<GENERATED_TOKEN>\",price:1.20,locale:\"tr\",baseUrl:\"https://sandbox-api.iyzipay.com\", merchantGatewayBaseUrl:\"https://sandbox-merchantgw.iyzipay.com\", registerCardEnabled:false,bkmEnabled:true,bankTransferEnabled:false,bankTransferTimeLimit:{\"value\":5,\"type\":\"day\"},bankTransferRedirectUrl:\"https://www.merchant.com/callback\",bankTransferCustomUIProps:{},campaignEnabled:false,campaignMarketingUiDisplay:{},paymentSourceName:\"\",plusInstallmentResponseList:null,payWithIyzicoSingleTab:false,payWithIyzicoSingleTabV2:false,payWithIyzicoOneTab:false,newDesignEnabled:false,mixPaymentEnabled:true,creditCardEnabled:true,bankTransferAccounts:[],userCards:[],fundEnabled:false,memberCheckoutOtpData:{},force3Ds:false,isSandbox:true,storeNewCardEnabled:true,paymentWithNewCardEnabled:true,enabledApmTypes:[\"SOFORT\",\"IDEAL\",\"QIWI\",\"GIROPAY\"],payWithIyzicoUsed:false,payWithIyzicoEnabled:false,payWithIyzicoCustomUI:{},buyerName:\"John\",buyerSurname:\"Doe\",merchantInfo:\"\",merchantName:\"Sandbox Merchant Name - 60383\",cancelUrl:\"\",buyerProtectionEnabled:false,hide3DS:false,gsmNumber:\"\",email:\"[email protected]\",checkConsumerDetail:{},subscriptionPaymentEnabled:false,ucsEnabled:false,fingerprintEnabled:false,payWithIyzicoFirstTab:false,creditEnabled:false,payWithIyzicoLead:false,goBackUrl:\"\",metadata : {},createTag:function(){var iyziJSTag = document.createElement('script');iyziJSTag.setAttribute('src','https://sandbox-static.iyzipay.com/checkoutform/v2/bundle.js?v=1714445286139');document.head.appendChild(iyziJSTag);}};iyziInit.createTag();}</script>",
#     tokenExpireTime: 1800,
#     paymentPageUrl: "https://sandbox-cpp.iyzipay.com?token=<GENERATED_TOKEN>&lang=tr"
#   }
# }
# Script complete!

Tests

# FROM: ./

pnpm test;

Building

# FROM: ./

pnpm build;

# [Expected Output]:
# ...

iyzipay-js's People

Contributors

codingwithmanny avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.