Solgateway Documentation
  • Introduction
  • Getting Started
  • API Documentation
  • Integration Guides
  • Configuration
  • Troubleshooting
  • Best Practices
  • FAQs
  • Additional Resources
  • Changelog
Powered by GitBook
On this page

Integration Guides

Integration Guides

Welcome to the Solgateway Integration Guides! This section provides step-by-step instructions for integrating Solgateway into your applications using various programming languages and platforms. Whether you are a developer or a business owner, these guides will help you get up and running with crypto payments quickly and efficiently.

PHP Integration

1. Install Solgateway PHP SDK

Use Composer to install the Solgateway PHP SDK:

bashCopy codecomposer require solgateway/solgateway-php

2. Configure API Key

Set up your API key in your application:

phpCopy coderequire 'vendor/autoload.php';

use Solgateway\SolgatewayClient;

$client = new SolgatewayClient('YOUR_API_KEY');

3. Create a Payment

To create a payment transaction:

phpCopy code$response = $client->createTransaction([
    'amount' => '100.00',
    'currency' => 'SOL',
    'description' => 'Payment for Order #1234',
    'callback_url' => 'https://yourdomain.com/callback'
]);

echo $response->payment_url;

4. Retrieve Transaction Status

To check the status of a transaction:

phpCopy code$status = $client->getTransactionStatus('transaction_id');
echo $status->status;

JavaScript Integration

1. Install Solgateway Node.js SDK

Use npm to install the Solgateway Node.js SDK:

bashCopy codenpm install solgateway

2. Configure API Key

Set up your API key in your Node.js application:

javascriptCopy codeconst Solgateway = require('solgateway');

const client = new Solgateway('YOUR_API_KEY');

3. Create a Payment

To create a payment transaction:

javascriptCopy codeclient.createTransaction({
    amount: '100.00',
    currency: 'SOL',
    description: 'Payment for Order #1234',
    callback_url: 'https://yourdomain.com/callback'
}).then(response => {
    console.log(response.payment_url);
});

4. Retrieve Transaction Status

To get the status of a transaction:

javascriptCopy codeclient.getTransactionStatus('transaction_id')
    .then(status => {
        console.log(status.status);
    });

Golang Integration

1. Install Solgateway Go SDK

Use Go modules to install the Solgateway Go SDK:

bashCopy codego get github.com/solgateway/solgateway-go

2. Configure API Key

Set up your API key in your Go application:

goCopy codepackage main

import "github.com/solgateway/solgateway-go"

func main() {
    client := solgateway.NewClient("YOUR_API_KEY")
}

3. Create a Payment

To create a payment transaction:

goCopy coderesponse, err := client.CreateTransaction(solgateway.TransactionRequest{
    Amount:      "100.00",
    Currency:    "SOL",
    Description: "Payment for Order #1234",
    CallbackURL: "https://yourdomain.com/callback",
})
if err != nil {
    log.Fatal(err)
}
fmt.Println(response.PaymentURL)

4. Retrieve Transaction Status

To retrieve the status of a transaction:

goCopy codestatus, err := client.GetTransactionStatus("transaction_id")
if err != nil {
    log.Fatal(err)
}
fmt.Println(status.Status)

Python Integration

1. Install Solgateway Python SDK

Use pip to install the Solgateway Python SDK:

bashCopy codepip install solgateway

2. Configure API Key

Set up your API key in your Python application:

pythonCopy codefrom solgateway import SolgatewayClient

client = SolgatewayClient(api_key='YOUR_API_KEY')

3. Create a Payment

To create a payment transaction:

pythonCopy coderesponse = client.create_transaction(
    amount='100.00',
    currency='SOL',
    description='Payment for Order #1234',
    callback_url='https://yourdomain.com/callback'
)
print(response.payment_url)

4. Retrieve Transaction Status

To get the status of a transaction:

pythonCopy codestatus = client.get_transaction_status('transaction_id')
print(status.status)

WooCommerce Plugin

1. Install the Plugin

  • Download the Solgateway WooCommerce plugin from the Solgateway website.

  • Upload the plugin to your WordPress site and activate it through the Plugins menu.

2. Configure the Plugin

  • Navigate to WooCommerce > Settings > Payments.

  • Select Solgateway and enter your API key.

  • Configure additional settings like transaction modes and webhook URLs as needed.

3. Start Accepting Payments

Once configured, Solgateway will be available as a payment method at checkout, allowing you to accept crypto payments seamlessly.

Conclusion

These guides provide a foundation for integrating Solgateway into various applications and platforms. For additional details, examples, or custom integration requirements, please refer to the specific API documentation or contact our support team.

PreviousAPI DocumentationNextConfiguration

Last updated 8 months ago