capture-and-details

command
v0.0.0-...-d0b5d59 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 13 Imported by: 0

README

Capture or details request on eCom v2 transactions

Requires the programming language Go

To run capture requests on a batch batch in production
go run main.go -config config.json -orders orders.txt -capture -production

To run detail requests on a batch of orders in production
go run main.go -config config.json -orders orders.txt -detail -production

To run cancel requests on a batch orders in production
go run main.go -config config.json -orders orders.txt -cancel -production

To run refund requests on a batch of orders in production
go run main.go -config config.json -orders orders.txt -refund -production

To run in test (MT) simply omit "-production"

conf.json and orders.txt need to either be filled in or you can refer to some other file above.

Running program without any arguments will give you the list of parameters available

Input

Orders input

The order input must be filled with a single OrderID and the amount to be captured per line.
For REFUND and CAPTURE you also have the possibility to add a IdempotencyKey that will be used in the request
this way you will not be able to capture or refund the same amount twice.

The IdempotencyKey can be empty, but the column must exist in the order file.

Regardless of if you wish to perform a details request or a capture on the orders.
If you only wish to perform a details request just fill in 0

OrderID;CaptureAmount;IdempotencyKey
Woo123;0;
Woo200;5000;

Note The amount captured should be an integer and "øre" (cent in EUR/USD) in case of NOK.
Thus "NOK 50,95" would written as 5095 and NOK 50,- would be 5000.
0 means "capture/refund everything"

Configuration file

You'll find the required information for this file in the developer portal.
See: Getting started for help on getting started with the developer portal.

Production & Test

Specify if you wish to run in the production environment by adding -production as an argument on the command line.
If you don't specify -production, the tool will default to the Merchant Test (MT) environment.

Tips & tricks

Since you can specify the config file as a parameter you can create multiple config files like this: conf.SaleUnitName.json if you have multiple sale units.
That way you don't need to re-edit the same config file if you have multiple sale units you need to capture and/or perform details requests on.

This of course also works for the order input, i.e. orders_SaleUnitName.txt

The .gitignore file for this particular directory is setup to ignore orders_*.txt and conf.*.json

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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