Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

Commit 4d3e49b

Browse files
int2kDerek J. Curtis
authored and
Derek J. Curtis
committed
Feature/transfer va (#13)
* add fixture for request and response of virtual account permata, bri epay and mandiri bill payment adding test file for epay bri charge request adding test file for virtual account charge request adding live test for virtual account and epay bri * add status that returned from virtual account transaction (pending status) * add response class for virtual account (permata, bca, bni, mandiri) add response class for bri epay payment * add payment type class for virtual account (permata, bca, bni, mandiri) add payment type class for bri epay * bump package version to 0.8 * change end point API url - api.veritrans.co.id to api.midtrans.com - api.sandbox.veritrans.co.id to api.sandbox.midtrans.com * remove option --use-mirrors from pip that was deprecated
1 parent 1f596cc commit 4d3e49b

12 files changed

+1124
-19
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ python:
33
- "2.7"
44
- "3.3"
55
- "3.4"
6-
install: pip install -r requirements.txt --use-mirrors
6+
install: pip install -r requirements.txt
77
script: python setup.py nosetests --with-coverage --cover-package=veritranspay

tests/fixtures.py

+334
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,340 @@
116116
"and message [Do not honour]"
117117
}
118118

119+
VIRTUALACCOUNTPERMATA_REQUEST = {
120+
"payment_type": "bank_transfer",
121+
"bank_transfer": {
122+
"bank": "permata"
123+
},
124+
"transaction_details": {
125+
"order_id": "".join([fake.random_letter() for _ in range(10)]),
126+
"gross_amount": 145000
127+
},
128+
"customer_details": {
129+
"first_name": "Andri",
130+
"last_name": "Litani",
131+
"email": "andri@litani.com",
132+
"phone": "081122334455",
133+
"billing_address": {
134+
"first_name": "Andri",
135+
"last_name": "Litani",
136+
"address": "Mangga 20",
137+
"city": "Jakarta",
138+
"postal_code": "16602",
139+
"phone": "081122334455",
140+
"country_code": "IDN"
141+
},
142+
"shipping_address": {
143+
"first_name": "Obet",
144+
"last_name": "Supriadi",
145+
"address": "Manggis 90",
146+
"city": "Jakarta",
147+
"postal_code": "16601",
148+
"phone": "08113366345",
149+
"country_code": "IDN"
150+
}
151+
},
152+
"item_details": [
153+
{
154+
"id": "a1",
155+
"price": 50000,
156+
"quantity": 2,
157+
"name": "Apel"
158+
},
159+
{
160+
"id": "a2",
161+
"price": 45000,
162+
"quantity": 1,
163+
"name": "Jeruk"
164+
}
165+
]
166+
}
167+
168+
VIRTUALACCOUNTPERMATA_CHARGE_RESPONSE_SUCCESS = {
169+
"status_code": "201",
170+
"status_message": "Success, PERMATA VA transaction is successful",
171+
"transaction_id": "6fd88567-62da-43ff-8fe6-5717e430ffc7",
172+
"order_id": "H17550",
173+
"gross_amount": "145000.00",
174+
"payment_type": "bank_transfer",
175+
"transaction_time": "2016-06-19 13:42:29",
176+
"transaction_status": "pending",
177+
"fraud_status": "accept",
178+
"permata_va_number": "8562000087926752"
179+
}
180+
181+
VIRTUALACCOUNTBCA_REQUEST = {
182+
"payment_type": "bank_transfer",
183+
"transaction_details": {
184+
"order_id": "".join([fake.random_letter() for _ in range(10)]),
185+
"gross_amount": 145000
186+
},
187+
"customer_details": {
188+
"first_name": "Andri",
189+
"last_name": "Litani",
190+
"email": "andri@litani.com",
191+
"phone": "081122334455",
192+
"billing_address": {
193+
"first_name": "Andri",
194+
"last_name": "Litani",
195+
"address": "Mangga 20",
196+
"city": "Jakarta",
197+
"postal_code": "16602",
198+
"phone": "081122334455",
199+
"country_code": "IDN"
200+
},
201+
"shipping_address": {
202+
"first_name": "Obet",
203+
"last_name": "Supriadi",
204+
"address": "Manggis 90",
205+
"city": "Jakarta",
206+
"postal_code": "16601",
207+
"phone": "08113366345",
208+
"country_code": "IDN"
209+
}
210+
},
211+
"item_details": [
212+
{
213+
"id": "a1",
214+
"price": 50000,
215+
"quantity": 2,
216+
"name": "Apel"
217+
},
218+
{
219+
"id": "a2",
220+
"price": 45000,
221+
"quantity": 1,
222+
"name": "Jeruk"
223+
}
224+
],
225+
"bank_transfer": {
226+
"bank": "bca",
227+
"va_number": "111111",
228+
"free_text": {
229+
"inquiry": [
230+
{
231+
"id": "Free Text ID Free Text ID Free Text ID",
232+
"en": "Free Text EN Free Text EN Free Text EN"
233+
}
234+
],
235+
"payment": [
236+
{
237+
"id": "Free Text ID Free Text ID Free Text ID",
238+
"en": "Free Text EN Free Text EN Free Text EN"
239+
}
240+
]
241+
}
242+
}
243+
}
244+
VIRTUALACCOUNTBCA_CHARGE_RESPONSE_SUCCESS = {
245+
"status_code": "201",
246+
"status_message": "Success, Bank Transfer transaction is created",
247+
"transaction_id": "9aed5972-5b6a-401e-894b-a32c91ed1a3a",
248+
"order_id": "1466323342",
249+
"gross_amount": "20000.00",
250+
"payment_type": "bank_transfer",
251+
"transaction_time": "2016-06-19 15:02:22",
252+
"transaction_status": "pending",
253+
"va_numbers": [
254+
{
255+
"bank": "bca",
256+
"va_number": "91019021579"
257+
}
258+
],
259+
"fraud_status": "accept"
260+
}
261+
262+
VIRTUALACCOUNTBNI_REQUEST = {
263+
"payment_type": "bank_transfer",
264+
"transaction_details": {
265+
"order_id": "".join([fake.random_letter() for _ in range(10)]),
266+
"gross_amount": 145000
267+
},
268+
"customer_details": {
269+
"first_name": "Andri",
270+
"last_name": "Litani",
271+
"email": "andri@litani.com",
272+
"phone": "081122334455",
273+
"billing_address": {
274+
"first_name": "Andri",
275+
"last_name": "Litani",
276+
"address": "Mangga 20",
277+
"city": "Jakarta",
278+
"postal_code": "16602",
279+
"phone": "081122334455",
280+
"country_code": "IDN"
281+
},
282+
"shipping_address": {
283+
"first_name": "Obet",
284+
"last_name": "Supriadi",
285+
"address": "Manggis 90",
286+
"city": "Jakarta",
287+
"postal_code": "16601",
288+
"phone": "08113366345",
289+
"country_code": "IDN"
290+
}
291+
},
292+
"item_details": [
293+
{
294+
"id": "a1",
295+
"price": 50000,
296+
"quantity": 2,
297+
"name": "Apel"
298+
},
299+
{
300+
"id": "a2",
301+
"price": 45000,
302+
"quantity": 1,
303+
"name": "Jeruk"
304+
}
305+
],
306+
"bank_transfer": {
307+
"bank": "bni",
308+
"va_number": "111111"
309+
},
310+
}
311+
312+
VIRTUALACCOUNTBNI_CHARGE_RESPONSE_SUCCESS = {
313+
"status_code": "201",
314+
"status_message": "Success, Bank Transfer transaction is created",
315+
"transaction_id": "9aed5972-5b6a-401e-894b-a32c91ed1a3a",
316+
"order_id": "1466323342",
317+
"gross_amount": "20000.00",
318+
"payment_type": "bank_transfer",
319+
"transaction_time": "2016-06-19 15:02:22",
320+
"transaction_status": "pending",
321+
"va_numbers": [
322+
{
323+
"bank": "bni",
324+
"va_number": "8578000000111111"
325+
}
326+
],
327+
"fraud_status": "accept"
328+
}
329+
330+
VIRTUALACCOUNTMANDIRI_REQUEST = {
331+
"payment_type": "echannel",
332+
"transaction_details": {
333+
"order_id": "".join([fake.random_letter() for _ in range(10)]),
334+
"gross_amount": 145000
335+
},
336+
"customer_details": {
337+
"first_name": "Andri",
338+
"last_name": "Litani",
339+
"email": "andri@litani.com",
340+
"phone": "081122334455",
341+
"billing_address": {
342+
"first_name": "Andri",
343+
"last_name": "Litani",
344+
"address": "Mangga 20",
345+
"city": "Jakarta",
346+
"postal_code": "16602",
347+
"phone": "081122334455",
348+
"country_code": "IDN"
349+
},
350+
"shipping_address": {
351+
"first_name": "Obet",
352+
"last_name": "Supriadi",
353+
"address": "Manggis 90",
354+
"city": "Jakarta",
355+
"postal_code": "16601",
356+
"phone": "08113366345",
357+
"country_code": "IDN"
358+
}
359+
},
360+
"item_details": [
361+
{
362+
"id": "a1",
363+
"price": 50000,
364+
"quantity": 2,
365+
"name": "Apel"
366+
},
367+
{
368+
"id": "a2",
369+
"price": 45000,
370+
"quantity": 1,
371+
"name": "Jeruk"
372+
}
373+
],
374+
"echannel": {
375+
"bill_info1": "Payment For:",
376+
"bill_info2": "debt"
377+
}
378+
}
379+
380+
VIRTUALACCOUNTMANDIRI_CHARGE_RESPONSE_SUCCESS = {
381+
"status_code": "201",
382+
"status_message": "Success, Mandiri Bill transaction is successful",
383+
"transaction_id": "883af6a4-c1b4-4d39-9bd8-b148fcebe853",
384+
"order_id": "tes",
385+
"gross_amount": "1000.00",
386+
"payment_type": "echannel",
387+
"transaction_time": "2016-06-19 14:40:19",
388+
"transaction_status": "pending",
389+
"fraud_status": "accept",
390+
"bill_key": "990000000260",
391+
"biller_code": "70012"
392+
}
393+
394+
BRIEPAY_REQUEST = {
395+
"payment_type": "bri_epay",
396+
"transaction_details": {
397+
"order_id": "".join([fake.random_letter() for _ in range(10)]),
398+
"gross_amount": 145000
399+
},
400+
"customer_details": {
401+
"first_name": "Andri",
402+
"last_name": "Litani",
403+
"email": "andri@litani.com",
404+
"phone": "081122334455",
405+
"billing_address": {
406+
"first_name": "Andri",
407+
"last_name": "Litani",
408+
"address": "Mangga 20",
409+
"city": "Jakarta",
410+
"postal_code": "16602",
411+
"phone": "081122334455",
412+
"country_code": "IDN"
413+
},
414+
"shipping_address": {
415+
"first_name": "Obet",
416+
"last_name": "Supriadi",
417+
"address": "Manggis 90",
418+
"city": "Jakarta",
419+
"postal_code": "16601",
420+
"phone": "08113366345",
421+
"country_code": "IDN"
422+
}
423+
},
424+
"item_details": [
425+
{
426+
"id": "a1",
427+
"price": 50000,
428+
"quantity": 2,
429+
"name": "Apel"
430+
},
431+
{
432+
"id": "a2",
433+
"price": 45000,
434+
"quantity": 1,
435+
"name": "Jeruk"
436+
}
437+
],
438+
}
439+
440+
BRIEPAY_CHARGE_RESPONSE_SUCCESS = {
441+
"status_code": "201",
442+
"status_message": "Success, BRI E-Pay transaction is successful",
443+
"transaction_id": "f8635cd7-615d-4a6d-a806-c9ca4a56257e",
444+
"order_id": "2014111702",
445+
"redirect_url": "https://api.veritrans.co.id/v3/bri/epay/redirect/f8635cd7-615d-4a6d-a806-c9ca4a56257e",
446+
"gross_amount": "145000.00",
447+
"payment_type": "bri_epay",
448+
"transaction_time": "2016-06-19 16:00:05",
449+
"transaction_status": "pending",
450+
"fraud_status": "accept"
451+
}
452+
119453
INDOMARET_CHARGE_RESPONSE_SUCCESS = {
120454
"status_code": "201",
121455
"status_message": "Success, CSTORE transaction is successful",

0 commit comments

Comments
 (0)