Tools

Official SDKs

First-party libraries for talking to TagPay. All SDKs share the same resource model (charges, refunds, customers, ...) and the same authentication. Pick the one for your stack and start shipping.

Node.js

AvailableGitHub →

Install

npm install @tagpay/node

Example

import TagPay from '@tagpay/node';
const tagpay = new TagPay(process.env.TAGPAY_SECRET_KEY);
const charge = await tagpay.charges.create({
amount: 500000,
reference: 'ord_1184',
customer_email: '[email protected]',
});
console.log(charge.payment_url);

Python

AvailableGitHub →

Install

pip install tagpay

Example

import os
from tagpay import TagPay
tagpay = TagPay(os.environ['TAGPAY_SECRET_KEY'])
charge = tagpay.charges.create(
amount=500000,
reference='ord_1184',
customer_email='[email protected]',
)
print(charge.payment_url)

PHP

AvailableGitHub →

Install

composer require tagpay/tagpay-php

Example

<?php
require 'vendor/autoload.php';
$tagpay = new \TagPay\Client(getenv('TAGPAY_SECRET_KEY'));
$charge = $tagpay->charges->create([
'amount' => 500000,
'reference' => 'ord_1184',
'customer_email' => '[email protected]',
]);
echo $charge->payment_url;

Ruby

BetaGitHub →

Install

gem install tagpay

Example

require 'tagpay'
tagpay = TagPay::Client.new(ENV['TAGPAY_SECRET_KEY'])
charge = tagpay.charges.create(
amount: 500_000,
reference: 'ord_1184',
customer_email: '[email protected]'
)
puts charge.payment_url

Go

Coming soon

Install

go get github.com/tagpayHQ/tagpay-go

Example

package main
import (
"fmt"
"os"
"github.com/tagpayHQ/tagpay-go"
)
func main() {
client := tagpay.NewClient(os.Getenv("TAGPAY_SECRET_KEY"))
charge, err := client.Charges.Create(&tagpay.ChargeCreateParams{
Amount: 500000,
Reference: "ord_1184",
CustomerEmail: "[email protected]",
})
if err != nil { panic(err) }
fmt.Println(charge.PaymentURL)
}