New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/acgyiyo/payment_api_test

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/acgyiyo/payment_api_test

  • v0.0.0-20241014010444-36cff1ed77dc
  • Source
  • Go
  • Socket score

Version published
Created
Source

API Payment Application

Overview

This Go application provides a simple payment processing system that allows users to register new payments, retrieve existing ones, and process refunds.

Getting Started

Prerequisites

  • Go programming language (version 1.18 or later)
  • A Go module compatible environment
  • Docker

Installation

  1. Clone the repository:
    git clone https://github.com/acgyiyo/payment_api_test.git
    
   cd project-directory
   go mod tidy
   go run cmd/main.go 

By default, the application will listen on port 8082. You can customize this by setting the PORT environment variable.

Available Endpoints

Register a payment: Endpoint: /payments Method: POST Request body: A JSON object containing payment details (e.g., amount, currency, customer information) Retrieve a payment: Endpoint: /payments/{paymentId} Method: GET Path parameter: paymentId is the unique identifier of the payment Refund a payment: Endpoint: /payments/refund Method: POST

Example

curl --location 'localhost:8082/payment/refund' \
--header 'Content-Type: application/json' \
--data '{
    "transaction_id": "txn-20241012204528+7"
}'

Additional Notes

Database: The application uses a database to store payment information. You'll need to configure the database connection details in the configuration file and run doccker-compose file

internal\config\schemas\local.json

FAQs

Package last updated on 14 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc