payflowpro

package module
v0.0.0-...-9aaf4ad Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2015 License: MIT Imports: 11 Imported by: 0

README

go-payflowpro

PayflowPro - Library for accessing PayPal's Payflow Pro HTTP interface

The go-payflowpro package is a simple port based on the PayflowPro Perl module by Vivek Khera.

Caveats/TODO

I haven't quite yet taken care of the differences beween the original untyped language (Perl) and the typed languge Go. So for example, at the moment all results values are strings, meaning you must check for:

if res["RESULT"] == "0" {

instead of:

if res["RESULT"] == 0 {

which matches the Perl code.

Installation

Simply install the package to your $GOPATH with the go tool from shell:

$ go get github.com/dsparling/go-payflowpro

Make sure Git is installed on your machine and in your system's PATH.

go get installs the latest tagged release

Examples

Example.go is a sort of hello world for go-payflowpro and should get you started for the barebones necessities of using the package.

cd examples
go run example.go

Recurring Inquiry

package main

import (
	"fmt"
	"github.com/dsparling/go-payflowpro"
)

func main() {

	data := map[string]string{
		"USER":    "MyUserId",
		"VENDOR":  "MyVendorId",
		"PARTNER": "MyPartnerId",
		"PWD":     "MyPassword",

		"TRXTYPE":       "R", // Required - transaction type (Recurring)
		"ACTION":        "I", // Required - recurring action (Inquiry)
		"TENDER":        "C", // Required - method of payment
		"ORIGPROFILEID": "12DigitProfileId",
	}

	res := payflowpro.Pfpro(data)
	if res["RESULT"] == "0" {
		fmt.Println("Success")
	} else {
		fmt.Println("Failure")
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pfdebug

func Pfdebug(mode bool) bool

* Set debug mode on or off. Turns on some warn statements to track progress * of the request. Default mode is off (C<$mode> == 0). * * Returns current setting.

func Pfpro

func Pfpro(data map[string]string) map[string]string

func Pftestmode

func Pftestmode(testmode bool) bool

* Set test mode on or off. Test mode means it uses the testing server * rather than the live one. Default mode is live. (testmode=false)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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