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

Commit cc9f45b

Browse files
committed
- Added Ordertypes
1 parent 032ef1a commit cc9f45b

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

multisafepay/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from multisafepay.resources.orders import Orders
2-
from multisafepay.objects.paymentmethod import PaymentMethod
3-
from multisafepay.objects.issuers import Issuer
42
from multisafepay.resources.gateways import Gateways
53
from multisafepay.resources.ideal_issuers import Issuers
4+
from multisafepay.objects.paymentmethod import PaymentMethod
5+
from multisafepay.objects.issuers import Issuer
6+
from multisafepay.objects.ordertype import OrderType
67
import requests
78
import json
89

@@ -14,6 +15,7 @@ def __init__(self, modus=None, api_key=None):
1415
self.api_key = api_key
1516
self.paymentmethod = PaymentMethod
1617
self.issuer = Issuer
18+
self.ordertype = OrderType
1719
self.order = Orders(self)
1820
self.gateways = Gateways(self)
1921
self.ideal_issuers = Issuers(self)

multisafepay/examples/create_direct_order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# The following code will create a iDEAL order with ING as issuer
99
# Issuers can only be used with iDEAL
1010
print(msp_client.order.create({
11-
"type": "direct",
11+
"type": msp_client.ordertype.REDIRECT,
1212
"order_id": "My-order-id-5",
1313
"currency": "EUR",
1414
"amount": 1000,

multisafepay/examples/create_order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# The following code will create a iDEAL order
99
print(msp_client.order.create({
10-
"type": "redirect",
10+
"type": msp_client.ordertype.REDIRECT,
1111
"order_id": "my-order-id-1",
1212
"gateway": msp_client.paymentmethod.IDEAL,
1313
"currency": "EUR",

multisafepay/objects/ordertype.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class OrderType:
2+
REDIRECT = 'redirect'
3+
DIRECT = 'direct'
4+
CHECKOUT = 'checkout'
5+
PAYMENTLINK = 'paymentlink'
6+
7+
8+

0 commit comments

Comments
 (0)