mastercard

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mastercard mocks the Mastercard Payment Gateway Services (MPGS) surface area. Real-world shape: result (SUCCESS | FAILURE | PENDING) + response.gatewayCode (APPROVED | DECLINED | INVALID_CSC | TIMED_OUT | BLOCKED | EXPIRED_CARD | ...) + order.id + transaction.id.

DTO shapes for Mastercard Payment Gateway Services (MPGS). Derived from the production reference library (test-dto-/mastercard.go). Kept scoped to the subset this mock actually emits on BuildResponse / BuildWebhookPayload — extend when a new failure mode needs additional surface area.

Reference types used (of the 551-line source):

  • MasterCardPaymentResponse -> paymentResponse
  • MasterCardOrderExtended -> orderResponse
  • MasterCardResponseExtended -> responseBlock
  • MasterCardCardSecurityCode -> cardSecurityCode
  • MasterCardTransactionExtended-> transactionResponse
  • MasterCardAcquirerExtended -> acquirerBlock
  • MasterCardAuthorizationResponse -> authorizationResponse
  • MasterCardError -> errorBlock

Status constants mirror MasterCardSuccessStatus / FailedStatus / PendingStatus / ErrorStatus / UnknownStatus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct{}

func New

func New() *Adapter

func (*Adapter) BuildResponse

func (a *Adapter) BuildResponse(result *engine.Result, body []byte) (int, []byte, map[string]string)

func (*Adapter) BuildWebhookPayload

func (a *Adapter) BuildWebhookPayload(result *engine.Result, chargeID string, amount int64, currency string, requestBody map[string]any) map[string]any

func (*Adapter) Name

func (a *Adapter) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL