Create a new payment method

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/settings/ticketsales/paymentmethods

Example

Request

 1use Ticketmatic\Endpoints\Settings\Ticketsales\Paymentmethods;
 2
 3$result = Paymentmethods::create($client, array(
 4    "name" => "Creditcard",
 5    "config" => array(
 6        "apikey" => "dfggrezrf456gdsertg5GRZds",
 7    ),
 8    "internalremark" => "Processed by Mollie",
 9    "paymentmethodtypeid" => 1001,
10    "pspid" => 10001,
11));

Response

 1object(\Ticketmatic\Model\PaymentMethod) (9) {
 2  ["id"]=>
 3  int(0)
 4  ["name"]=>
 5  string(10) "Creditcard"
 6  ["config"]=>
 7  array(1) {
 8    ["apikey"]=>
 9    string(25) "dfggrezrf456gdsertg5GRZds"
10  }
11  ["internalremark"]=>
12  string(19) "Processed by Mollie"
13  ["paymentmethodtypeid"]=>
14  int(0)
15  ["pspid"]=>
16  int(0)
17  ["isarchived"]=>
18  bool(false)
19  ["createdts"]=>
20  object(\DateTime) (3) {
21    ["date"]=>
22    string(26) "2014-09-26 15:24:36.000000"
23    ["timezone_type"]=>
24    int(3)
25    ["timezone"]=>
26    string(3) "UTC"
27  }
28  ["lastupdatets"]=>
29  object(\DateTime) (3) {
30    ["date"]=>
31    string(26) "2014-09-26 15:24:36.000000"
32    ["timezone_type"]=>
33    int(3)
34    ["timezone"]=>
35    string(3) "UTC"
36  }
37}

Request

 1import (
 2    "github.com/ticketmatic/tm-go/ticketmatic"
 3    "github.com/ticketmatic/tm-go/ticketmatic/settings/ticketsales/paymentmethods"
 4)
 5
 6result, err := paymentmethods.Create(client, &ticketmatic.PaymentMethod{
 7    Name: "Creditcard",
 8    Config: map[string]interface{}{
 9        "apikey": "dfggrezrf456gdsertg5GRZds",
10    },
11    Internalremark: "Processed by Mollie",
12    Paymentmethodtypeid: 1001,
13    Pspid: 10001,
14})

Response

 1result := &ticketmatic.PaymentMethod{
 2    Id: 123,
 3    Name: "Creditcard",
 4    Config: map[string]interface{}{
 5        "apikey": "dfggrezrf456gdsertg5GRZds",
 6    },
 7    Internalremark: "Processed by Mollie",
 8    Paymentmethodtypeid: 1001,
 9    Pspid: 10001,
10    Isarchived: false,
11    Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
12    Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
13}

Request

 1POST /api/1/{accountname}/settings/ticketsales/paymentmethods HTTP/1.1
 2Content-Type: application/json
 3
 4{
 5    "name": "Creditcard",
 6    "config": {
 7        "apikey": "dfggrezrf456gdsertg5GRZds"
 8    },
 9    "internalremark": "Processed by Mollie",
10    "paymentmethodtypeid": 1001,
11    "pspid": 10001
12}

Response

 1HTTP/1.1 200 OK
 2Content-Type: application/json
 3
 4{
 5    "id": 123,
 6    "name": "Creditcard",
 7    "config": {
 8        "apikey": "dfggrezrf456gdsertg5GRZds"
 9    },
10    "internalremark": "Processed by Mollie",
11    "paymentmethodtypeid": 1001,
12    "pspid": 10001,
13    "isarchived": false,
14    "createdts": "2014-09-26 15:24:36",
15    "lastupdatets": "2014-09-26 15:24:36"
16}

Request body fields

FieldDescription
name
mlstring 
(required)

Name of the payment method

Example value:"Creditcard"
config
map<string, mixed
(required)

Specific configuration for the payment method, content depends on the payment method type.

Example value:{ "apikey": "dfggrezrf456gdsertg5GRZds" }
internalremark
string 
(required)

Internal remark, will not be shown to customers

Example value:"Processed by Mollie"
paymentmethodtypeid
int 
(required)

Type of the paymentmethod. For a list of possible types see here

Example value:1001
pspid
int 
(required)

Payment Service Provider this payment method is linked to

Example value:10001

Type reference: PaymentMethod

Result fields

FieldDescription
id
int

Unique ID

Example value:123
name

Name of the payment method

Example value:"Creditcard"
config
map<string, mixed>

Specific configuration for the payment method, content depends on the payment method type.

Example value:{ "apikey": "dfggrezrf456gdsertg5GRZds" }
internalremark
string

Internal remark, will not be shown to customers

Example value:"Processed by Mollie"
paymentmethodtypeid
int

Type of the paymentmethod. For a list of possible types see here

Example value:1001
pspid
int

Payment Service Provider this payment method is linked to

Example value:10001
isarchived
bool

Whether or not this item is archived

createdts
timestamp

Created timestamp

Example value:"2014-09-26 15:24:36"
lastupdatets
timestamp

Last updated timestamp

Example value:"2014-09-26 15:24:36"

Type reference: PaymentMethod