File tree Expand file tree Collapse file tree 2 files changed +64
-1
lines changed
paynova_api_python_client Expand file tree Collapse file tree 2 files changed +64
-1
lines changed Original file line number Diff line number Diff line change @@ -128,4 +128,25 @@ def refund_payment(self, params):
128
128
Refund Payment
129
129
Docs: http://docs.paynova.com/display/API/Refund+Payment
130
130
"""
131
- return self .request ('POST' , 'transactions/{transactionId}/refund/{totalAmount}' , params )
131
+ return self .request ('POST' , 'transactions/{transactionId}/refund/{totalAmount}' , params )
132
+
133
+ def get_customer_profile (self , params ):
134
+ """
135
+ Get Customer Profile
136
+ Docs: http://docs.paynova.com/display/API/Get+Customer+Profile
137
+ """
138
+ return self .request ('GET' , 'customerprofiles/{profileId}' , params )
139
+
140
+ def remove_customer_profile (self , params ):
141
+ """
142
+ Remove Customer Profile
143
+ Docs: http://docs.paynova.com/display/API/Remove+Customer+Profile
144
+ """
145
+ return self .request ('DELETE' , 'customerprofiles/{profileId}' , params )
146
+
147
+ def remove_customer_profile_card (self , params ):
148
+ """
149
+ Remove Customer Profile Card
150
+ Docs: http://docs.paynova.com/display/API/Remove+Customer+Profile+Card
151
+ """
152
+ return self .request ('DELETE' , 'customerprofiles/{profileId}/cards/{cardId}' , params )
Original file line number Diff line number Diff line change @@ -72,6 +72,23 @@ def success(content=None):
72
72
'batchId' : 'batch'
73
73
})
74
74
75
+ # get customer profile
76
+
77
+ elif url [2 ] == '/api/customerprofiles/1' :
78
+ return success ({
79
+ 'profileId' : '1'
80
+ })
81
+
82
+ # remove customer profile
83
+
84
+ elif url [2 ] == '/api/customerprofiles/1' and request .method == 'DELETE' :
85
+ return success ()
86
+
87
+ # remove customer profile card
88
+
89
+ elif url [2 ] == '/api/customerprofiles/1/cards/1' and request .method == 'DELETE' :
90
+ return success ()
91
+
75
92
return {'status_code' : 404 }
76
93
77
94
@@ -132,3 +149,28 @@ def test_refund_payment(self):
132
149
expect (response .get ('transactionId' )).to_equal ('0001' )
133
150
expect (response .get ('batchId' )).to_equal ('batch' )
134
151
152
+ def test_get_customer_profile (self ):
153
+ with HTTMock (paynova_mock ):
154
+ params = {
155
+ 'profileId' : '1'
156
+ }
157
+ response = self .paynova .get_customer_profile (params )
158
+ expect (response ).not_to_be_null ()
159
+ expect (response .get ('profileId' )).to_equal ('1' )
160
+
161
+ def test_remove_customer_profile (self ):
162
+ with HTTMock (paynova_mock ):
163
+ params = {
164
+ 'profileId' : '1'
165
+ }
166
+ response = self .paynova .remove_customer_profile (params )
167
+ expect (response ).not_to_be_null ()
168
+
169
+ def test_remove_customer_profile_card (self ):
170
+ with HTTMock (paynova_mock ):
171
+ params = {
172
+ 'profileId' : '1' ,
173
+ 'cardId' : '1'
174
+ }
175
+ response = self .paynova .remove_customer_profile_card (params )
176
+ expect (response ).not_to_be_null ()
You can’t perform that action at this time.
0 commit comments