Skip to content

🟢 SDK for payme.uz API 2023 — 09

Notifications You must be signed in to change notification settings

PayTechUz/paymego

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payme Implementation

This MVP project helps for implementing payme-doc.

Installation

1 - go get -v github.com/paytechuz/paymego

Example

package main

import (
	"fmt"

	"github.com/paytechuz/paymego"
)

func main() {
	s, err := paymego.NewSubscribeAPI(paymego.SubsribeAPIOpts{
		PaycomID:  "paycom-id",
		PaycomKey: "paycom-key",
		BaseURL:   "https://checkout.test.paycom.uz/api/",
	})

	if err != nil {
		panic(err)
	}

	// Example usage:
	cardClient := paymego.CardData{
		ID:    "123456789",
		Token: "card-token",
	}

	cardDriver := paymego.CardData{
		ID:    "123456789",
		Token: "card-token",
	}

	paymentDataClient := paymego.PaymentData{
		OrderID:  "order123",
		CardData: cardClient,
	}

	paymentDataDriver := paymego.PaymentData{
		OrderID:  "order123",
		CardData: cardDriver,
	}

	paymentDetails := paymego.PaymentDetails{
		Client: paymentDataClient,
		Driver: paymentDataDriver,
		Amount: 100000,
	}

	resp, err := s.Pay(paymentDetails)

	if err != nil {
		panic(err)
	}

	fmt.Println("Response: ", resp)

}


Buy Me A Coffee