continuous-software / node-authorize-net

Node.js SDK for Authorize.net payment gateway.
https://authorize.net/
11 stars 24 forks source link

Please, make it pass extra options like x_duplicate_window #17

Closed ghost closed 8 years ago

ghost commented 8 years ago

How I solved that: const body = { transactionType: 'authCaptureTransaction', amount: args.amount, profile: { customerProfileId: args.customerProfileId, paymentProfile: { paymentProfileId: args.customerPaymentProfileId }, shippingProfileId: args.customerShippingAddressId, }, transactionSettings: {setting: {settingName:'duplicateWindow', settingValue: 0} } };

ghost commented 8 years ago

This is used using direct method like this: return this.anet.sendTransactionRequest( body, function( transaction ) { return { authCode: transaction.authCode[ 0 ], _original: transaction, transactionId: transaction.transId[ 0 ], }; } ). catch( error => { console.log(error.message); throw new this.error( 'Error charging client', 'ESTR', error ); } );