11'use strict'
22
3- const { normalizeDate, normalizeBoolean , normalizeNotes } = require ( '../utils/razorpay-utils' )
3+ const { normalizeDate } = require ( '../utils/razorpay-utils' )
44
55module . exports = function ( api ) {
66 return {
@@ -22,7 +22,7 @@ module.exports = function (api) {
2222
2323 count = Number ( count ) || 10
2424 skip = Number ( skip ) || 0
25- authorized = normalizeBoolean ( authorized )
25+ authorized = authorized
2626
2727 return api . get ( {
2828 url : '/orders' ,
@@ -49,19 +49,13 @@ module.exports = function (api) {
4949 } ,
5050
5151 create ( params = { } , callback ) {
52- let { amount, currency, receipt, partial_payment, payment_capture, notes, method,
53- ...otherParams } = params
52+ let { currency, ...otherParams } = params
5453 currency = currency || 'INR'
5554
5655 let data = Object . assign ( {
57- amount,
5856 currency,
59- receipt,
60- method,
61- partial_payment : normalizeBoolean ( partial_payment ) ,
62- payment_capture : normalizeBoolean ( payment_capture ) ,
6357 ...otherParams
64- } , normalizeNotes ( notes ) )
58+ } )
6559
6660 return api . post ( {
6761 url : '/orders' ,
@@ -70,17 +64,14 @@ module.exports = function (api) {
7064 } ,
7165
7266 edit ( orderId , params = { } , callback ) {
73- let { notes } = params
7467
7568 if ( ! orderId ) {
7669 throw new Error ( '`order_id` is mandatory' )
7770 }
7871
79- let data = Object . assign ( normalizeNotes ( notes ) )
80-
8172 return api . patch ( {
8273 url : `/orders/${ orderId } ` ,
83- data
74+ data : params
8475 } , callback )
8576 } ,
8677
0 commit comments