kamba_signature_generation 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -15
- data/lib/kamba_signature_generation/api.rb +1 -1
- data/lib/kamba_signature_generation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7babd61322506a12e7b51f422530eca75cd15967fbfbd4c835e67812e4e0862d
|
4
|
+
data.tar.gz: 1225edac8c67556ef2ef00f04ab2a7d3dee4881c454dc59c3d56accfdff3df1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71044b37e67cec57a445dcad022243d94e209695f63847dc416dce1a12bc9c7bb8430f8b7985db2d0451b6dc3f2085e2c30d3f4e3e2534cf4bb139ddf0f2c33d
|
7
|
+
data.tar.gz: bbecfa45eea0d602b12e7cc460061546547b4083295e8fbba998e41bc7c267ddab950ff65eaa14d61935d2b5753fc2489b1b0f175b925d7a4ef65b0697b1d8c3
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# Kamba Signature Generation
|
2
2
|
|
3
3
|
Gem ruby para gerar a assinatura necessária para processar o checkout nos serviços da Kamba.
|
4
|
+
|
4
5
|
## Instalação
|
5
6
|
|
6
|
-
Adicione
|
7
|
+
Adicione a linha abaixo ao Gemfile da sua aplicação:
|
7
8
|
|
8
9
|
```ruby
|
9
10
|
gem 'kamba_signature_generation'
|
@@ -13,7 +14,7 @@ E execute:
|
|
13
14
|
|
14
15
|
$ bundle
|
15
16
|
|
16
|
-
ou instale
|
17
|
+
ou instale através da linha de comandos:
|
17
18
|
|
18
19
|
$ gem install kamba_signature_generation
|
19
20
|
|
@@ -22,26 +23,26 @@ ou instale por você mesmo:
|
|
22
23
|
```ruby
|
23
24
|
require 'kamba_signature_generation'
|
24
25
|
|
25
|
-
KambaSignatureGeneration.secret_key = '
|
26
|
+
KambaSignatureGeneration.secret_key = 'SUA_CHAVE_SECRETA_KAMBA'
|
26
27
|
```
|
27
28
|
|
28
|
-
|
29
|
+
**Nota:** Use sempre configurações de variáveis de ambiente para manter os seus dados em segurança e nunca compartilhe a sua chave secreta ou adicione ao seu cliente frontend.
|
30
|
+
Exemplo: `ENV['SUA_CHAVE_SECRETA_KAMBA']`.
|
29
31
|
|
30
|
-
Usando Ruby on Rails
|
32
|
+
**Usando Ruby on Rails?**
|
33
|
+
Adicione o código acima em `config/initializers` em um arquivo chamado `kamba_signature_generation.rb`.
|
31
34
|
|
32
|
-
##
|
35
|
+
## Como gerar a assinatura
|
33
36
|
|
34
37
|
```ruby
|
35
38
|
checkout_config = {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
@signature = KambaSignatureGeneration::API.generate_signature(
|
39
|
+
channel: 'WEB',
|
40
|
+
initial_amount: 10000,
|
41
|
+
notes: 'Curso API Iniciantes',
|
42
|
+
redirect_url_success: 'https://seusite.com/curso/api-iniciantes'
|
43
|
+
}
|
44
|
+
@signature = KambaSignatureGeneration::API.generate_signature(checkout_config)
|
42
45
|
```
|
43
|
-
Obs: `KAMBA-API-MODE: sandbox, staging ou production`
|
44
|
-
|
45
46
|
|
46
47
|
**Configurações `checkout_config`:**
|
47
48
|
- Para o nosso propósito o valor do campo `channel`, permanecerá igual à **WEB** como no exemplo.
|
@@ -49,4 +50,4 @@ Obs: `KAMBA-API-MODE: sandbox, staging ou production`
|
|
49
50
|
- Substitua o valor do campo `notes` por uma anotação ou descrição geral a cerca do pagamento, e coloque o preço do mesmo no valor do campo `initial_amount`.
|
50
51
|
- O campo `redirect_url_success` recebe o endereço da página na qual pretende-se ser redirecionada após o pagamento com sucesso.
|
51
52
|
|
52
|
-
Finalmente, use o valor de `@signature` para assinar processar o checkout.
|
53
|
+
Finalmente, use o valor de `@signature` para assinar processar o checkout no seu cliente frontend.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kamba_signature_generation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hernani Neto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|