-
Notifications
You must be signed in to change notification settings - Fork 0
/
padmoney-sdk-node.html
80 lines (66 loc) · 3.59 KB
/
padmoney-sdk-node.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
layout: page
---
<h1>
Padmoney SKD for JavaScript (Node.js)
</h1>
<p>
<a href="https://travis-ci.org/padmoney/padmoney-sdk-node" rel="nofollow"><img src="https://camo.githubusercontent.com/818b24f696dd681f588a7b11ad150aad7c05a6b2/68747470733a2f2f7472617669732d63692e6f72672f7061646d6f6e65792f7061646d6f6e65792d73646b2d6e6f64652e7376673f6272616e63683d6d6173746572" alt="Build Status" data-canonical-src="https://travis-ci.org/padmoney/padmoney-sdk-node.svg?branch=master" style="max-width:100%;"></a>
<a href="https://www.npmjs.com/package/@padmoney/sdk" rel="nofollow"><img src="https://camo.githubusercontent.com/56937b059b6ef22eb76818004c8ac0c4d5282f15/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f407061646d6f6e65792f73646b" alt="Version" data-canonical-src="https://img.shields.io/npm/v/@padmoney/sdk" style="max-width:100%;"></a>
<a target="_blank" rel="noopener noreferrer" href="https://camo.githubusercontent.com/f26f83fce9dc2ad9b30d7f7656c2cb11bffac33a/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f407061646d6f6e65792f73646b"><img src="https://camo.githubusercontent.com/f26f83fce9dc2ad9b30d7f7656c2cb11bffac33a/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f407061646d6f6e65792f73646b" alt="NPM" data-canonical-src="https://img.shields.io/npm/l/@padmoney/sdk" style="max-width:100%;"></a>
<a target="_blank" rel="noopener noreferrer" href="https://camo.githubusercontent.com/e9a59f951756ecf706b003a1f1e1c715c1b908ee/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f74797065732f407061646d6f6e65792f73646b"><img src="https://camo.githubusercontent.com/e9a59f951756ecf706b003a1f1e1c715c1b908ee/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f74797065732f407061646d6f6e65792f73646b" alt="Types" data-canonical-src="https://img.shields.io/npm/types/@padmoney/sdk" style="max-width:100%;"></a>
</p>
<h3>
Código fonte
</h3>
<p>
<a href="https://github.com/padmoney/padmoney-sdk-node">https://github.com/padmoney/padmoney-sdk-node</a>
</p>
<h3>
Instalação
</h3>
<pre><code class="language-sh">npm i @padmoney/sdk
</code></pre>
<h3>
Como usar
</h3>
<p>
<a href="https://github.com/padmoney/padmoney-sdk-node">Nosso SDK está disponível na plataforma Github</a>, onde além de todo o código fonte temos o diretório <a href="https://github.com/padmoney/padmoney-sdk-node/tree/master/samples">/samples</a> contendo exemplos das mais diversas funcionalidades.
</p>
<h3>
Exemplo
</h3>
<pre><code class="language-js">
Invoices
import Padmoney, { CredentialsToken } from '@padmoney/sdk';
const TOKEN = 'JDJhJDEwJHYyMGVYOXRLU2pZUTJBckJ6YWV4Q2V1eUpqMTBINi5Jd3NiRDR4QjhOSE04SC9tQlQ5b1RP'
const SECRET = '123'
async function main() {
const credentials = new CredentialsToken(TOKEN, SECRET)
const padmoney = new Padmoney(credentials)
await padmoney.configure()
const invoice = await padmoney
.invoices
.builder()
.addItem(25.50, new Date(2020, 6, 20))
.addItem(25.50, '2020-07-20')
.setPayer({
name: 'John Doe',
nickname: 'John Doe',
cellPhone: '27999999999',
document: '64773865261',
address: {
country: 'BR',
state: 'ES',
city: 'Vitória',
neighborhood: 'Jardim da Penha',
address: 'Rua José Neves Cypreste',
number: '400',
zipcode: '29060300'
}
})
.create()
console.log(invoice)
}
main()
</code></pre>