Modify an existing payment method

Content

Resource URL

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

Example

Request

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

Response

 1object(\Ticketmatic\Model\PaymentMethod) (8) {
 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  ["isarchived"]=>
16  bool(false)
17  ["createdts"]=>
18  object(\DateTime) (3) {
19    ["date"]=>
20    string(26) "2014-09-26 15:24:36.000000"
21    ["timezone_type"]=>
22    int(3)
23    ["timezone"]=>
24    string(3) "UTC"
25  }
26  ["lastupdatets"]=>
27  object(\DateTime) (3) {
28    ["date"]=>
29    string(26) "2014-09-26 15:24:36.000000"
30    ["timezone_type"]=>
31    int(3)
32    ["timezone"]=>
33    string(3) "UTC"
34  }
35}
36

Request

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

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    Isarchived: false,
10    Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
11    Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
12}

Request

 1PUT /api/1/{accountname}/settings/ticketsales/paymentmethods/{id} 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}

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    "isarchived": false,
13    "createdts": "2014-09-26 15:24:36",
14    "lastupdatets": "2014-09-26 15:24:36"
15}

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

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
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