Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 032ef1a

Browse files
- Added issuers object and resource
- Added issuers and direct order examples - Added Payafter to paymentmethod
1 parent 6a34c46 commit 032ef1a

File tree

6 files changed

+71
-1
lines changed

6 files changed

+71
-1
lines changed

multisafepay/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from multisafepay.resources.orders import Orders
22
from multisafepay.objects.paymentmethod import PaymentMethod
3+
from multisafepay.objects.issuers import Issuer
34
from multisafepay.resources.gateways import Gateways
5+
from multisafepay.resources.ideal_issuers import Issuers
46
import requests
57
import json
68

@@ -10,9 +12,11 @@ def __init__(self, modus=None, api_key=None):
1012
self.modus = modus
1113
self.api_url = None
1214
self.api_key = api_key
13-
self.order = Orders(self)
1415
self.paymentmethod = PaymentMethod
16+
self.issuer = Issuer
17+
self.order = Orders(self)
1518
self.gateways = Gateways(self)
19+
self.ideal_issuers = Issuers(self)
1620

1721
def set_api_key(self, api_key):
1822
self.api_key = self.validate_api_key(api_key)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from multisafepay.client import Client
2+
3+
msp_client = Client()
4+
# Here you can set the mode to TEST or LIVE based on the API you want to use
5+
msp_client.set_modus('TEST')
6+
msp_client.set_api_key('REPLACE WITH API KEY')
7+
8+
# The following code will create a iDEAL order with ING as issuer
9+
# Issuers can only be used with iDEAL
10+
print(msp_client.order.create({
11+
"type": "direct",
12+
"order_id": "My-order-id-5",
13+
"currency": "EUR",
14+
"amount": 1000,
15+
"gateway": msp_client.paymentmethod.IDEAL,
16+
"description": "product description",
17+
"gateway_info": {
18+
"issuer_id": msp_client.issuer.ING
19+
},
20+
"payment_options": {
21+
"notification_url": "http://www.example.com/client/notification?type=notification",
22+
"redirect_url": "http://www.example.com/client/notification?type=redirect",
23+
"cancel_url": "http://www.example.com/client/notification?type=cancel",
24+
"close_window": False
25+
}
26+
}))
27+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from multisafepay.client import Client
2+
3+
msp_client = Client()
4+
# Here you can set the mode to TEST or LIVE based on the API you want to use
5+
msp_client.set_modus('TEST')
6+
msp_client.set_api_key('REPLACE WITH API KEY')
7+
# To retrieve a list of all the iDEAL issuers you can use the following example
8+
print(msp_client.ideal_issuers.get())

multisafepay/objects/issuers.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
class Issuer:
2+
3+
TESTBANK = '3151'
4+
ABNAMRO = '0031'
5+
SNSBANK = '0751'
6+
ING = '0721'
7+
RABOBANK = '0021'
8+
ASNBANK = '0761'
9+
REGIOBANK = '0771'
10+
TRIODOSBANK = '0511'
11+
LANSCHOT = '0161'
12+
KNAB = '0801'
13+
BUNQ = '4371'
14+
MONEYOU = '1234'
15+
HANDELSBANKEN = '1235'
16+
17+
18+
19+
20+

multisafepay/objects/paymentmethod.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class PaymentMethod:
2020
SANTANDER = 'SANTANDER'
2121
SOFORT = 'DIRECTBANK'
2222
TRUSTLY = 'TRUSTLY'
23+
PAYAFTER = 'PAYAFTER'
2324

2425

2526

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Issuers:
2+
def __init__(self, client):
3+
self.endpoint = 'issuers/ideal'
4+
self.msp_client = client
5+
self.method = 'GET'
6+
7+
def get(self):
8+
endpoint = '{0}'.format(self.endpoint)
9+
return self.msp_client.execute_http_call(self.method, endpoint)
10+

0 commit comments

Comments
 (0)