Skip to content

Commit

Permalink
Add validationSendMoneyToAdvcashCard method
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Nakata authored and Erik Nakata committed May 8, 2017
1 parent df99f39 commit 12c3fc8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,10 @@ export default async ({ password, apiName, accountEmail, advcashSoapUrl = 'https
arg0,
arg1: { from, count, sortOrder, startTimeFrom, startTimeTo, transactionName, transactionStatus, walletId }
}, historyMap),

validationSendMoneyToAdvcashCard: ({ amount, currency, email, cardType, walletId, note, savePaymentTemplate }) => advcashClient("validationSendMoneyToAdvcashCard", {
arg0,
arg1: { amount, currency, email, cardType, walletId, note, savePaymentTemplate }
}),
}
}
30 changes: 30 additions & 0 deletions test/validation-send-money-to-advcash-card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import advcash from '../src/index'
import chai from 'chai'
import chaiAsPromised from 'chai-as-promised'

const expect = chai.expect
const password = process.env.ADVCASH_PASSWORD
const accountEmail = process.env.ADVCASH_ACCOUNT_EMAIL
const apiName = process.env.ADVCASH_API_NAME
const advcashSoapUrl = process.env.ADVCASH_SOAP_URL

chai.use(chaiAsPromised)

describe('Validation Send Money To Advcash Card', () => {
it('Should return a null object', async () => {
const client = await advcash({ password, apiName, accountEmail })

const promise = client.validationSendMoneyToAdvcashCard({
amount: 0.10,
currency: "USD",
email: "[email protected]",
cardType: "PLASTIC",
note: "teste",
savePaymentTemplate: true
})

return Promise.all([
expect(promise).to.eventually.equal(null)
])
})
})
2 changes: 1 addition & 1 deletion test/validation-send-money.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const advcashSoapUrl = process.env.ADVCASH_SOAP_URL
chai.use(chaiAsPromised)

describe('Validation Send Money', () => {
it('Should return an object { amount, currency, email, walletId, note, savePaymentTemplate }', async () => {
it('Should return a null object', async () => {
const client = await advcash({ password, apiName, accountEmail })

const promise = client.validationSendMoney({
Expand Down

0 comments on commit 12c3fc8

Please sign in to comment.