All Projects → ozgur-soft → nestpay.go

ozgur-soft / nestpay.go

Licence: MIT License
Asseco NestPay (EST) Virtual POS API with golang

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to nestpay.go

EPAYMENT
EPayment - Multi Payment Provider for .Net Core
Stars: ✭ 43 (+95.45%)
Mutual labels:  sanalpos, akbank, asseco, isbank, finansbank, halkbank
laravel-pos
Türk bankaları için sanal pos paketi (Laravel 5/6/7/8)
Stars: ✭ 61 (+177.27%)
Mutual labels:  est, sanalpos
opencart-3-sanalpos
OpenCart 3.x Sanal Pos Entegrasyonu Ücretsiz
Stars: ✭ 18 (-18.18%)
Mutual labels:  sanalpos, akbank
acme2certifier
library implementing ACME server functionality
Stars: ✭ 62 (+181.82%)
Mutual labels:  est
GarantiVp
Garanti Bankası Sanal Pos İstemcisi
Stars: ✭ 65 (+195.45%)
Mutual labels:  sanalpos

license documentation

Nestpay.go

NestPay (EST) (Asseco, Akbank, İş Bankası, Ziraat Bankası, Halkbank, Finansbank, TEB) Virtual POS API with golang

Installation

go get github.com/ozgur-soft/nestpay.go

Sanalpos satış işlemi

package main

import (
	"context"
	"encoding/xml"
	"fmt"

	nestpay "github.com/ozgur-soft/nestpay.go/src"
)

func main() {
	// Banka adı : "akbank","isbank","ziraatbank","halkbank","finansbank","teb"
	api, req := nestpay.Api("banka adı", "müşteri no", "kullanıcı adı", "şifre")
	// Test : "T" - Production "P" (zorunlu)
	req.SetMode("P")
	// Müşteri IPv4 adresi (zorunlu)
	req.SetIPAddress("1.2.3.4")
	// Kart numarası (zorunlu)
	req.SetCardNumber("4242424242424242")
	// Son kullanma tarihi (Ay ve yılın son 2 hanesi) AA,YY (zorunlu)
	req.SetCardExpiry("02", "20")
	// Cvv2 kodu (kartın arka yüzündeki 3 haneli numara) (zorunlu)
	req.SetCardCode("000")
	// Satış tutarı (zorunlu)
	req.SetAmount("1.00")
	// Para birimi (zorunlu)
	req.SetCurrency("TRY")
	// Taksit sayısı (varsa)
	req.SetInstalment("")

	// Fatura
	req.BillTo = new(nestpay.To)
	req.BillTo.Name = ""     // Kart sahibi
	req.BillTo.TelVoice = "" // Telefon numarası

	// 3D (varsa)
	//req.PayerTxnId = ""
	//req.PayerSecurityLevel = ""
	//req.PayerAuthenticationCode = ""
	//req.CardholderPresentCode = ""

	// Satış
	ctx := context.Background()
	res := api.Pay(ctx, req)
	pretty, _ := xml.MarshalIndent(res, " ", " ")
	fmt.Println(string(pretty))
}

Sanalpos iade işlemi

package main

import (
	"context"
	"encoding/xml"
	"fmt"

	nestpay "github.com/ozgur-soft/nestpay.go/src"
)

func main() {
	// Banka adı : "akbank","isbank","ziraatbank","halkbank","finansbank","teb"
	api, req := nestpay.Api("banka adı", "müşteri no", "kullanıcı adı", "şifre")
	// Test : "T" - Production "P" (zorunlu)
	req.SetMode("P")
	// Sipariş numarası (zorunlu)
	req.SetOrderId("ORDER-")
	// İade tutarı (zorunlu)
	req.SetAmount("1.00")
	// Para birimi (zorunlu)
	req.SetCurrency("TRY")

	// İade
	ctx := context.Background()
	res := api.Refund(ctx, req)
	pretty, _ := xml.MarshalIndent(res, " ", " ")
	fmt.Println(string(pretty))
}

Sanalpos iptal işlemi

package main

import (
	"context"
	"encoding/xml"
	"fmt"

	nestpay "github.com/ozgur-soft/nestpay.go/src"
)

func main() {
	// Banka adı : "akbank","isbank","ziraatbank","halkbank","finansbank","teb"
	api, req := nestpay.Api("banka adı", "müşteri no", "kullanıcı adı", "şifre")
	// Test : "T" - Production "P" (zorunlu)
	req.SetMode("P")
	// Sipariş numarası (zorunlu)
	req.SetOrderId("ORDER-")
	// İptal tutarı (zorunlu)
	req.SetAmount("1.00")
	// Para birimi (zorunlu)
	req.SetCurrency("TRY")

	// İptal
	ctx := context.Background()
	res := api.Cancel(ctx, req)
	pretty, _ := xml.MarshalIndent(res, " ", " ")
	fmt.Println(string(pretty))
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].