List external payments method
List all external payments available for your shop.
GET
/payments/list.json
With APIs for third-party payments, you have the option of integrating payment methods outside of Storeden's systems.
By creating a Storeden application you will receive one keyset for each installation.
With this keyset you have the possibility to enter the payment authorization in the shop that installed the application.
Each keyset can only have one payment authorization.
List all external payments available for your shop.
GET
/payments/list.json
$storeden = new Storeden\Storeden($config);
$payments_list = $storeden->get('/payments/list.json');
[
{
"id": "5876525216f46a8729d1585e",
"label": "Pay with NFC"
},
{
"id": "5a02d8f016f46ab87f4e6b25",
"label": "Pay By Cash"
}
]
Get information about payment authorization attached to the current api key set.
GET
/payments/payment.json
$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/payments/payment.json');
{
"groupUID": 132,
"instance": "5a02dcd516f46a7d6c4e6b5c",
"label": "Pay By Cash",
"redirect_url": "\/payments\/success\/{orderid}",
"id": "5a04233316f46ad334bf3290"
}
Add payment to the current keyset.
POST
/payments/payment.json
label required (string) | Default name for payment method |
callback_url required (string) | The url which user is redirected to, after new order placed. Must contains {orderid} to get OrderID param. |
get_more (string) | The url fetching alternative methods. Require authorization |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['label'] = 'Pay by DummyPayments';
$payload['callback_url'] = 'https://www.dummypayments.net/storeden-payments/{orderid}';
$result = $storeden->post('/payments/payment.json', $payload);
{
"id": "5a265db216f46a0c157b23c6",
"translation_key": "admin.payments.5a265db216f46a0c157b23c6",
"payment_authorization": {
"label": "Pay by DummyPayments",
"callback_url": "https:\/\/www.dummypayments.net\/storeden-payments\/{orderid}"
}
}
Remove payment authorization from shop. Instance, translation_key and id can be not the same in reinstallation case
DELETE
/payments/payment.json
payment_id required (StoredenID) | Your "ID" for payment |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['payment_id'] = '5a265db216f46a0c157b23c6';
$result = $storeden->delete('/payments/payment.json', $payload);
{
"n": 1,
"err": null
}
GET
/payments/configured_payment.json
$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/payments/configured_payment.json');
{
"payments_index": [
"paypalcheckout",
"paypal",
"amazonpay",
"stripe",
"630c6997d4029db14a9c2157"
],
"payments": {
"paypalcheckout": {
"available": 1,
"cost": 0,
"label": "Paypal and credit card"
},
"paypal": {
"available": 1,
"cost": 0,
"label": "Paypal"
},
"amazonpay": {
"available": 1,
"cost": 0,
"label": "AmazonPay"
},
"stripe": {
"available": 1,
"cost": 0,
"label": "Credit card"
},
"630c6997d4029db14a9c2157": {
"available": 1,
"cost": 0,
"label": "Klarna",
"can_have_child": false
}
}
}